diff options
Diffstat (limited to 'pygments/lexers/php.py')
-rw-r--r-- | pygments/lexers/php.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/pygments/lexers/php.py b/pygments/lexers/php.py index 702bdd8d..4ee9bdd1 100644 --- a/pygments/lexers/php.py +++ b/pygments/lexers/php.py @@ -192,7 +192,7 @@ class PhpLexer(RegexLexer): bygroups(String, String, String.Delimiter, String, String.Delimiter, Punctuation, Text)), (r'\s+', Text), - (r'#\[', Punctuation), + (r'#\[', Punctuation, 'attribute'), (r'#.*?\n', Comment.Single), (r'//.*?\n', Comment.Single), # put the empty comment here, it is otherwise seen as @@ -282,6 +282,16 @@ class PhpLexer(RegexLexer): bygroups(String.Interpol, Name.Variable, String.Interpol)), (r'[${\\]', String.Double) ], + 'attribute': [ + (r'\]', Punctuation, '#pop'), + (r'\(', Punctuation, 'attributeparams'), + (_ident_inner, Name.Decorator), + include('php') + ], + 'attributeparams': [ + (r'\)', Punctuation, '#pop'), + include('php') + ], } def __init__(self, **options): |