Commits

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

Comments (0)

Files changed (1)

pygments/lexers/agile.py

                 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 class_decl.group('scope') is not None):
-                return True
+            if class_decl:
+                if saw_perl_decl or class_decl.group('scope') is not None:
+                    return True
+                continue
             break
 
         return 0.8 if saw_perl_decl else False