Commits

Rob Hoelz committed 9a2e033

Add Perl 6 heuristic: check for special method names

Ex. sub postcircumfix:<[ ]>

  • Participants
  • Parent commits 04ebd2f

Comments (0)

Files changed (1)

pygments/lexers/agile.py

             # in Perl 6, and also (more importantly) they are a glob deference in
             # Perl 5.
             return 0.91
+        if re.search(r'sub\s+\w+:(?![(:])', text): # Special sub/method syntax (ex. sub postcircumfix:<[ ]>)
+            return 0.91
 
         for line in text.splitlines():
             if re.match(r'\s*(?:my|our)?\s*(?:module|role|class)\b', line): # module, role, class declarations