1
0
mirror of https://github.com/danog/PHP-Parser.git synced 2024-11-29 20:09:08 +01:00

Sync flexible heredoc emulation with label fix

This was recently fixed in PHP via
310708845f
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.
This commit is contained in:
Nikita Popov 2019-08-30 20:21:28 +02:00
parent e612609022
commit 5644a916bc

View File

@ -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)*?
(?<indentation>\h*)\2(?![a-zA-Z_\x80-\xff])(?<separator>(?:;?[\r\n])?)/x
(?<indentation>\h*)\2(?![a-zA-Z0-9_\x80-\xff])(?<separator>(?:;?[\r\n])?)/x
REGEX;
/** @var mixed[] Patches used to reverse changes introduced in the code */