tolerant-php-parser
tolerant-php-parser copied to clipboard
Handle T_ENCAPSED_WHITESPACE as StringLiteral
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.