Revert "Recover from error inside alternative array deref syntax"

This reverts commit 9d44edf85dc5882e45fed37a6c541bf20e7c8495.
This commit is contained in:
Nikita Popov 2019-05-24 22:58:13 +02:00
parent a167aa2061
commit 94d93f27a5
3 changed files with 453 additions and 518 deletions

View File

@ -891,7 +891,6 @@ callable_variable:
| dereferencable '[' optional_expr ']' { $$ = Expr\ArrayDimFetch[$1, $3]; }
| constant '[' optional_expr ']' { $$ = Expr\ArrayDimFetch[$1, $3]; }
| dereferencable '{' expr '}' { $$ = Expr\ArrayDimFetch[$1, $3]; }
| dereferencable '{' error '}' { $$ = Expr\ArrayDimFetch[$1, new Expr\Error(stackAttributes(#3))]; }
| function_call { $$ = $1; }
| dereferencable T_OBJECT_OPERATOR property_name argument_list
{ $$ = Expr\MethodCall[$1, $3, $4]; }

File diff suppressed because it is too large Load Diff

View File

@ -1415,51 +1415,3 @@ $a = ["a "thing"];
-----
!!php7
Syntax error, unexpected T_STRING, expecting ',' or ')' or ']' from 2:11 to 2:15
-----
<?php
$obj->
if ($foo) {
echo "foo";
$a->b();
}
$c->d();
-----
!!php7
Syntax error, unexpected T_ECHO from 4:5 to 4:8
array(
0: Stmt_Expression(
expr: Expr_ArrayDimFetch(
var: Expr_MethodCall(
var: Expr_Variable(
name: obj
)
name: Identifier(
name: if
)
args: array(
0: Arg(
value: Expr_Variable(
name: foo
)
byRef: false
unpack: false
)
)
)
dim: Expr_Error(
)
)
)
1: Stmt_Expression(
expr: Expr_MethodCall(
var: Expr_Variable(
name: c
)
name: Identifier(
name: d
)
args: array(
)
)
)
)