summaryrefslogtreecommitdiff
path: root/pygments/lexer.py
diff options
context:
space:
mode:
Diffstat (limited to 'pygments/lexer.py')
-rw-r--r--pygments/lexer.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/pygments/lexer.py b/pygments/lexer.py
index ffaeeb55..5b5d18ba 100644
--- a/pygments/lexer.py
+++ b/pygments/lexer.py
@@ -241,7 +241,9 @@ def bygroups(*args):
"""
def callback(lexer, match, ctx=None):
for i, action in enumerate(args):
- if type(action) is _TokenType:
+ if action is None:
+ continue
+ elif type(action) is _TokenType:
data = match.group(i + 1)
if data:
yield match.start(i + 1), action, data