From 5644a916bc92486eb21cdc89f80033f1fbc716d2 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Fri, 30 Aug 2019 20:21:28 +0200 Subject: [PATCH] Sync flexible heredoc emulation with label fix This was recently fixed in PHP via https://github.com/php/php-src/commit/310708845ff02b9e252b7a02616290384dd846ba so we should fix it here as well. I'm not adding a dedicated test as it will fail until new PHP versions are released. This is indirectly tested through the php-src tester. --- lib/PhpParser/Lexer/Emulative.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/PhpParser/Lexer/Emulative.php b/lib/PhpParser/Lexer/Emulative.php index 864bffa..0e14541 100644 --- a/lib/PhpParser/Lexer/Emulative.php +++ b/lib/PhpParser/Lexer/Emulative.php @@ -22,7 +22,7 @@ class Emulative extends Lexer const FLEXIBLE_DOC_STRING_REGEX = <<<'REGEX' /<<<[ \t]*(['"]?)([a-zA-Z_\x80-\xff][a-zA-Z0-9_\x80-\xff]*)\1\r?\n (?:.*\r?\n)*? -(?\h*)\2(?![a-zA-Z_\x80-\xff])(?(?:;?[\r\n])?)/x +(?\h*)\2(?![a-zA-Z0-9_\x80-\xff])(?(?:;?[\r\n])?)/x REGEX; /** @var mixed[] Patches used to reverse changes introduced in the code */