diff options
Diffstat (limited to 'vendor/nikic/php-parser/grammar/php5.y')
-rw-r--r-- | vendor/nikic/php-parser/grammar/php5.y | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/vendor/nikic/php-parser/grammar/php5.y b/vendor/nikic/php-parser/grammar/php5.y index f9e7e7dd1..a62e9a310 100644 --- a/vendor/nikic/php-parser/grammar/php5.y +++ b/vendor/nikic/php-parser/grammar/php5.y @@ -689,9 +689,7 @@ array_expr: scalar_dereference: array_expr '[' dim_offset ']' { $$ = Expr\ArrayDimFetch[$1, $3]; } - | T_CONSTANT_ENCAPSED_STRING '[' dim_offset ']' - { $attrs = attributes(); $attrs['kind'] = strKind($1); - $$ = Expr\ArrayDimFetch[new Scalar\String_(Scalar\String_::parse($1), $attrs), $3]; } + | T_CONSTANT_ENCAPSED_STRING '[' dim_offset ']' { $$ = Expr\ArrayDimFetch[Scalar\String_::fromString($1, attributes()), $3]; } | constant '[' dim_offset ']' { $$ = Expr\ArrayDimFetch[$1, $3]; } | scalar_dereference '[' dim_offset ']' { $$ = Expr\ArrayDimFetch[$1, $3]; } /* alternative array syntax missing intentionally */ @@ -793,10 +791,8 @@ ctor_arguments: common_scalar: T_LNUMBER { $$ = $this->parseLNumber($1, attributes(), true); } - | T_DNUMBER { $$ = Scalar\DNumber[Scalar\DNumber::parse($1)]; } - | T_CONSTANT_ENCAPSED_STRING - { $attrs = attributes(); $attrs['kind'] = strKind($1); - $$ = new Scalar\String_(Scalar\String_::parse($1, false), $attrs); } + | T_DNUMBER { $$ = Scalar\DNumber::fromString($1, attributes()); } + | T_CONSTANT_ENCAPSED_STRING { $$ = Scalar\String_::fromString($1, attributes(), false); } | T_LINE { $$ = Scalar\MagicConst\Line[]; } | T_FILE { $$ = Scalar\MagicConst\File[]; } | T_DIR { $$ = Scalar\MagicConst\Dir[]; } |