61523ab396
1. Now, for the expression 'new A' the correct values EndLine, EndPos, and not -1 will be set; 2. Also, for expressions from php5 '$a = &new Foo', the condition for parsing is fixed when it is necessary to set the Args values and the initialization of the NewTkn field is added, in the case when this condition is false. ## Problem description The reason why the positions after parsing became incorrect is that the check that is responsible for separating expressions like 'new A' and 'new A (args)' relied on comparison with nil, however, when the parser was updated, 'ctor_arguments' began to return not nil, but &ArgumentList{}, so the condition was always true, and in this case, when calculating the position, the second argument of the 'NewTokenNodePosition' function was nil, which is why -1 was returned there. For the second, the reasons are similar. In addition, there was a mistake in the number that needs to be checked. In the expression: 'variable' '=' '&' T_NEW class_name_reference ctor_arguments' it is necessary to check not 3, but 6 elements for nil. |
||
---|---|---|
.. | ||
node.go | ||
parser_test.go | ||
parser.go | ||
php5_bench_test.go | ||
php5.go | ||
php5.y | ||
test.php |