From c48f13eec64f066766b95751c8033e5127964560 Mon Sep 17 00:00:00 2001 From: Miikka Salminen Date: Sat, 6 Feb 2016 22:01:49 +0200 Subject: Add tokens for string affixes and heredoc delimiters. Add lexing for them in C/C++, Perl, PHP, Python and Ruby. Update my old style Lovelace accordingly. --- pygments/lexers/php.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'pygments/lexers/php.py') diff --git a/pygments/lexers/php.py b/pygments/lexers/php.py index 257dd94f..2421738f 100644 --- a/pygments/lexers/php.py +++ b/pygments/lexers/php.py @@ -138,7 +138,9 @@ class PhpLexer(RegexLexer): ], 'php': [ (r'\?>', Comment.Preproc, '#pop'), - (r'<<<([\'"]?)(' + _ident_inner + r')\1\n.*?\n\s*\2;?\n', String), + (r'(<<<)([\'"]?)(' + _ident_inner + r')(\2\n.*?\n\s*)(\3)(;?)(\n)', + bygroups(String, String, String.Delimiter, String, String.Delimiter, + Punctuation, Text)), (r'\s+', Text), (r'#.*?\n', Comment.Single), (r'//.*?\n', Comment.Single), -- cgit v1.2.1