summaryrefslogtreecommitdiff
path: root/pygments/lexers
diff options
context:
space:
mode:
authorRob Hoelz <rob@hoelz.ro>2014-01-21 21:52:43 +0100
committerRob Hoelz <rob@hoelz.ro>2014-01-21 21:52:43 +0100
commitb7723abc6112f2cac3f00f43a5523afaadbd1b1c (patch)
treefee9542118dd183ede02cb2ef205873b750d2581 /pygments/lexers
parentf3e047db2aa7718072edf6fdd07e0e6396832a98 (diff)
downloadpygments-b7723abc6112f2cac3f00f43a5523afaadbd1b1c.tar.gz
Perl 6: Pick up on Perl 6-style class declarations
We recognize them as Perl 6 style if we've seen a Perl-style variable declaration or if it's preceded with a Perl-style scope modifier
Diffstat (limited to 'pygments/lexers')
-rw-r--r--pygments/lexers/agile.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/pygments/lexers/agile.py b/pygments/lexers/agile.py
index 91792d52..c3924933 100644
--- a/pygments/lexers/agile.py
+++ b/pygments/lexers/agile.py
@@ -2286,7 +2286,8 @@ class Perl6Lexer(ExtendedRegexLexer):
if re.match('^\s*(?:use\s+)?v6(?:\.\d(?:\.\d)?)?;', line):
return True
# match class, module, role, enum, grammar declarations
- if saw_perl_decl and re.match('^\s*(?:(?:my|our)\s+)?(?:module|class|role|enum|grammar)', line):
+ class_decl = re.match('^\s*(?:(?P<scope>my|our)\s+)?(?:module|class|role|enum|grammar)', line)
+ if class_decl and (saw_perl_decl or class_decl.group('scope') is not None):
return True
break