invalid ast for offsetlookup and encapsed
See original GitHub issueInput:
$var = "string ${juices['FOO']} string";
Encapsedpart node contains variable
node, but should contains offsetlookup
node.
PHP parser output:
array(
0: Stmt_Expression(
expr: Expr_Assign(
var: Expr_Variable(
name: var
)
expr: Scalar_Encapsed(
parts: array(
0: Scalar_EncapsedStringPart(
value: string
)
1: Expr_ArrayDimFetch(
var: Expr_Variable(
name: juices
)
dim: Scalar_String(
value: FOO
)
)
2: Scalar_EncapsedStringPart(
value: string
)
)
)
)
)
)
Expr_ArrayDimFetch
is same as offsetlookup
Maybe will be great add tests for propertylookup
and staticlookup
to ensure ast correct for lookup nodes.
Issue Analytics
- State:
- Created 5 years ago
- Comments:14 (5 by maintainers)
Top Results From Across the Web
mutation issue with Unhandled Rejection (Error): Invalid AST ...
It provides me this error: Unhandled Rejection (Error): Invalid AST Node: [function sslCertsRenewalChecklistAddItemsQuery]. I search around and ...
Read more >Changelog - php-parser
235 : invalid ast for self and parent ... 182 : strange with parens, staticlookup and offsetlookup ... 204 : [bug] invalid start...
Read more >php-parser/CHANGELOG and php-parser Releases | LibHunt
:herb: NodeJS PHP Parser - extract AST or tokens ... #175 : impossible detect curly in encapsed AST enhancement; #210 : [bug] invalid...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
hm, maybe wen can refactor to one variable: “syntax:
curly
|dollar
|null
”curly
-"test {$test}";
dollar
-"test ${test}";
null
-"test $test";
Thanks, look on this at this week