diff options
author | Rob Hoelz <rob@hoelz.ro> | 2014-01-20 18:52:05 +0100 |
---|---|---|
committer | Rob Hoelz <rob@hoelz.ro> | 2014-01-20 18:52:05 +0100 |
commit | 0c039886630bcf21a0bcf093e6e5a9ccc2f83019 (patch) | |
tree | b753e696e516f07d326a5496abac1366696407f2 | |
parent | 8135b6cbd5a69c40b28e5ad5f29313d93a7b3465 (diff) | |
download | pygments-0c039886630bcf21a0bcf093e6e5a9ccc2f83019.tar.gz |
Perl 6: Make end-of-heredoc search more exact
Technically we need to start searching after the end of the heredoc
terminator declaration, not the end of the quote word delimiter. It
probably won't cause any problems in real world code, but it will
probably reduce the number of WTFs generated while reading it.
-rw-r--r-- | pygments/lexers/agile.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pygments/lexers/agile.py b/pygments/lexers/agile.py index 65826e0a..e5ff9a26 100644 --- a/pygments/lexers/agile.py +++ b/pygments/lexers/agile.py @@ -2131,10 +2131,10 @@ class Perl6Lexer(ExtendedRegexLexer): if adverbs is not None and re.search(r':to\b', adverbs): heredoc_terminator = text[match.start('delimiter') + n_chars : end_pos] - end_heredoc = re.search(r'^\s*' + re.escape(heredoc_terminator) + r'\s*$', text[ match.end('delimiter') : ], re.MULTILINE) + end_heredoc = re.search(r'^\s*' + re.escape(heredoc_terminator) + r'\s*$', text[ end_pos : ], re.MULTILINE) if end_heredoc: - end_pos = match.end('delimiter') + end_heredoc.end() + end_pos += end_heredoc.end() else: end_pos = len(text) |