Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle T_ENCAPSED_WHITESPACE as StringLiteral #393

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dantleech
Copy link
Contributor

@dantleech dantleech commented Nov 12, 2022

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 added a commit to phpactor/tolerant-php-parser that referenced this pull request Jan 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant