-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
(php) Support indented heredoc closing marker #2651
Comments
Yes, the first capture group in both the being and end is what is used by default with END_SAME_AS_BEGIN... looks like it'd be a fairly straight forward PR. You'd just need to add the match groups and remove the We've a love a PR! |
I am working on a PR but sadly, it is not as simple as you said, look at the this for the details : https://wiki.php.net/rfc/flexible_heredoc_nowdoc_syntaxes |
What seems to be the problem? We just have to match the beginning and ending. We already do it for "normal" heredocs (although poorly since we're not even making sure the end tag matches, etc). So you just need to edit the If you make a PR of what you have so far I can take a look. |
I followed your advice, I was too focused on the rfc but we only need the level of precision of an highlighter. |
Closed by #2658 |
Indented closing markers are valid in heredoc strings since PHP version 7.3
Here is a fiddle that reproduces the issue : https://jsfiddle.net/ywhrtvzo/
The string mode should end at the second
EOTEXT
markerI've checked the code to see if I could fix it myself, and the END_SAME_AS_BEGIN used in the ruby language for heredoc seems very promising, but I was not able to figure out how to adapt the php mode.
If I understand it well, a capturing group in the
begin
regex could be used for theend
matching, which would be perfect !The text was updated successfully, but these errors were encountered: