tolerant-php-parser icon indicating copy to clipboard operation
tolerant-php-parser copied to clipboard

Handle T_ENCAPSED_WHITESPACE as StringLiteral

Open dantleech opened this issue 3 years ago • 0 comments
trafficstars

Currently the parser interprets the "node" at the offset indicated by <> below as a SourceFileNode (or CompoundStatementNode):

$container->get('foo<>

This is because the token is a T_ENCAPSED_WHITESPACE token.

I would expect this to be a StringLiteral.

This PR changes the behavior to return a StringLiteral in this case.


I've made this a draft as not entirely sure if this is the correct behavior (I think it is) or if there are other places for it to be fixed. In the meantime I will be using a fork with Phpactor.

dantleech avatar Nov 12 '22 07:11 dantleech