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

Fix problem with heredoc parsing \n as newlines, not as literal string #1131

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

Conversation

cseufert
Copy link
Collaborator

@cseufert cseufert commented Mar 8, 2024

I am trying to fox #1130 however need some help with this one, for the prettier plugin we want to keep the original intent, and not parse the \n as a newline, so we can rebuild the original string in the output.

Do I create a special AST token for \n in a HEREDOC, or should ignore the \n as a special case, and parse it as a regular string?

@czosel
Copy link
Collaborator

czosel commented Mar 8, 2024

Hmm, I don't have any intuition on this. Might be worth checking how this is handled in https://github.com/nikic/PHP-Parser?

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.

2 participants