summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pygments/lexer.py14
-rw-r--r--pygments/lexers/compiled.py5
2 files changed, 11 insertions, 8 deletions
diff --git a/pygments/lexer.py b/pygments/lexer.py
index 33427ae3..ecd11a5a 100644
--- a/pygments/lexer.py
+++ b/pygments/lexer.py
@@ -274,12 +274,14 @@ def bygroups(*args):
if data:
yield match.start(i + 1), action, data
else:
- if ctx:
- ctx.pos = match.start(i + 1)
- for item in action(lexer, _PseudoMatch(match.start(i + 1),
- match.group(i + 1)), ctx):
- if item:
- yield item
+ data = match.group(i + 1)
+ if data is not None:
+ if ctx:
+ ctx.pos = match.start(i + 1)
+ for item in action(lexer, _PseudoMatch(match.start(i + 1),
+ data), ctx):
+ if item:
+ yield item
if ctx:
ctx.pos = match.end()
return callback
diff --git a/pygments/lexers/compiled.py b/pygments/lexers/compiled.py
index 023c02ef..321ee45e 100644
--- a/pygments/lexers/compiled.py
+++ b/pygments/lexers/compiled.py
@@ -1403,12 +1403,13 @@ class ObjectiveCLexer(RegexLexer):
return True
return False
+
class FortranLexer(RegexLexer):
- '''
+ """
Lexer for FORTRAN 90 code.
*New in Pygments 0.10.*
- '''
+ """
name = 'Fortran'
aliases = ['fortran']
filenames = ['*.f', '*.f90', '*.F', '*.F90']