diff options
author | Rob Hoelz <rob@hoelz.ro> | 2013-04-10 18:37:03 +0200 |
---|---|---|
committer | Rob Hoelz <rob@hoelz.ro> | 2013-04-10 18:37:03 +0200 |
commit | 43ccfa9ef21e78c8a9a6b86d66b102ea27a8d638 (patch) | |
tree | b2de70acf07c86c7cd962d10201f8ebb28bbc230 /pygments/lexers/agile.py | |
parent | 208d3abcc2a82fdab3ccfd5a084215d767b08593 (diff) | |
download | pygments-43ccfa9ef21e78c8a9a6b86d66b102ea27a8d638.tar.gz |
Separate 'constants' and helper methods into separate sections for Perl 6 lexer
Diffstat (limited to 'pygments/lexers/agile.py')
-rw-r--r-- | pygments/lexers/agile.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/pygments/lexers/agile.py b/pygments/lexers/agile.py index 6c205771..17d8d97c 100644 --- a/pygments/lexers/agile.py +++ b/pygments/lexers/agile.py @@ -1930,13 +1930,6 @@ class Perl6Lexer(ExtendedRegexLexer): PERL6_IDENTIFIER_RANGE = "['a-zA-Z0-9_:-]" - def _build_word_match(words, boundary_regex_fragment = None, prefix = '', suffix = ''): - if boundary_regex_fragment is None: - return r'\b(' + prefix + r'|'.join(words) + suffix + r')\b' - else: - return r'(?<!' + boundary_regex_fragment + ')' + prefix + '(' + \ - r'|'.join(words) + r')' + suffix + '(?!' + boundary_regex_fragment + ')' - PERL6_KEYWORDS = ( 'BEGIN', 'CATCH', 'CHECK', 'CONTROL', 'END', 'ENTER', 'FIRST', 'INIT', 'KEEP', 'LAST', 'LEAVE', 'NEXT', 'POST', 'PRE', 'START', 'TEMP', @@ -2076,6 +2069,13 @@ class Perl6Lexer(ExtendedRegexLexer): u'\uff3b' : u'\uff3d', u'\uff5b' : u'\uff5d', u'\uff5f' : u'\uff60', u'\uff62' : u'\uff63', } + def _build_word_match(words, boundary_regex_fragment = None, prefix = '', suffix = ''): + if boundary_regex_fragment is None: + return r'\b(' + prefix + r'|'.join(words) + suffix + r')\b' + else: + return r'(?<!' + boundary_regex_fragment + ')' + prefix + '(' + \ + r'|'.join(words) + r')' + suffix + '(?!' + boundary_regex_fragment + ')' + def brackets_callback(token_class): def callback(lexer, match, context): groups = match.groupdict() |