glayzzle / php-parser

:herb: NodeJS PHP Parser - extract AST or tokens
https://php-parser.glayzzle.com/
BSD 3-Clause "New" or "Revised" License
534 stars 71 forks source link

Heredoc fails to parse escaped newlines #1130

Open cseufert opened 8 months ago

cseufert commented 8 months ago

Source of this problem: https://github.com/prettier/plugin-php/issues/2015#issuecomment-1982167227

Unable to parse snippet like this:

<?php
if (true) {
    echo <<<STR
    \na
    STR;
}