summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2013-05-19 10:21:15 +0200
committerGeorg Brandl <georg@python.org>2013-05-19 10:21:15 +0200
commit150f5e545333c4bbe93e4e4437f732bb2ea38154 (patch)
treecfdf7cfd9cf7977cc8dbea545bd231c9f2f26471
parent938dae70613eebfc98823b0c4369e4deb13f104e (diff)
downloadpygments-150f5e545333c4bbe93e4e4437f732bb2ea38154.tar.gz
Closes #790: The NameHighlightFilter now works with any Name.* token type.
-rw-r--r--CHANGES2
-rw-r--r--pygments/filters/__init__.py4
2 files changed, 4 insertions, 2 deletions
diff --git a/CHANGES b/CHANGES
index f8794be7..244a5559 100644
--- a/CHANGES
+++ b/CHANGES
@@ -48,6 +48,8 @@ Version 1.7
- Haxe lexer: rewrite and support for Haxe 3 (PR#174).
+- The NameHighlightFilter now works with any Name.* token type (#790).
+
Version 1.6
-----------
diff --git a/pygments/filters/__init__.py b/pygments/filters/__init__.py
index f12d025c..84c0193d 100644
--- a/pygments/filters/__init__.py
+++ b/pygments/filters/__init__.py
@@ -129,7 +129,7 @@ class KeywordCaseFilter(Filter):
class NameHighlightFilter(Filter):
"""
- Highlight a normal Name token with a different token type.
+ Highlight a normal Name (and Name.*) token with a different token type.
Example::
@@ -163,7 +163,7 @@ class NameHighlightFilter(Filter):
def filter(self, lexer, stream):
for ttype, value in stream:
- if ttype is Name and value in self.names:
+ if ttype in Name and value in self.names:
yield self.tokentype, value
else:
yield ttype, value