1. Steve Spigarelli
  2. pygments-main


Georg Brandl  committed 6d86405

Be more lax about "from" due to new syntax "raise x from y".

  • Participants
  • Parent commits 972a251
  • Branches default

Comments (0)

Files changed (1)

File pygments/lexers/agile.py

View file
  • Ignore whitespace
         'fromimport': [
             (r'(?:[ \t]|\\\n)+', Text),
             (r'import\b', Keyword.Namespace, '#pop'),
+            # if None occurs here, it's "raise x from None", since None can
+            # never be a module name
+            (r'None\b', Name.Builtin.Pseudo, '#pop'),
+            # sadly, in "raise x from y" y will be highlighted as namespace too
             (r'[a-zA-Z_.][a-zA-Z0-9_.]*', Name.Namespace),
+            # anything else here also means "raise x from y" and is therefore
+            # not an error
+            (r'', Text, '#pop'),
         'stringescape': [