Rob Hoelz  committed aea6d85

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.

  • Participants
  • Parent commits c0932e8

Comments (0)

Files changed (1)

File pygments/lexers/

             if adverbs is not None and':to\b', adverbs):
                 heredoc_terminator = text[match.start('delimiter') + n_chars : end_pos]
-                end_heredoc ='^\s*' + re.escape(heredoc_terminator) + r'\s*$', text[ match.end('delimiter') : ], re.MULTILINE)
+                end_heredoc ='^\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()
                     end_pos = len(text)