Rob Hoelz  committed 3011650

Perl 6: Continue to search for 'use v6' after class declarations

If we haven't seen enough to convince us that a class/role/whatever
declaration is a Perl 6 one, a 'use v6' could still be found below

  • Participants
  • Parent commits a68efa8

Comments (0)

Files changed (1)

File pygments/lexers/

                 return True
             # match class, module, role, enum, grammar declarations
             class_decl = re.match('^\s*(?:(?P<scope>my|our)\s+)?(?:module|class|role|enum|grammar)', line)
-            if class_decl and (saw_perl_decl or'scope') is not None):
-                return True
+            if class_decl:
+                if saw_perl_decl or'scope') is not None:
+                    return True
+                continue
         return 0.8 if saw_perl_decl else False