diff options
author | Georg Brandl <georg@python.org> | 2013-05-19 10:21:15 +0200 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2013-05-19 10:21:15 +0200 |
commit | 150f5e545333c4bbe93e4e4437f732bb2ea38154 (patch) | |
tree | cfdf7cfd9cf7977cc8dbea545bd231c9f2f26471 | |
parent | 938dae70613eebfc98823b0c4369e4deb13f104e (diff) | |
download | pygments-150f5e545333c4bbe93e4e4437f732bb2ea38154.tar.gz |
Closes #790: The NameHighlightFilter now works with any Name.* token type.
-rw-r--r-- | CHANGES | 2 | ||||
-rw-r--r-- | pygments/filters/__init__.py | 4 |
2 files changed, 4 insertions, 2 deletions
@@ -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 |