summaryrefslogtreecommitdiff
path: root/pygments
diff options
context:
space:
mode:
authorMatth?us G. Chajdas <dev@anteru.net>2019-02-12 16:28:16 +0100
committerMatth?us G. Chajdas <dev@anteru.net>2019-02-12 16:28:16 +0100
commit53a39c2b6dc9d2e7b73943c842f698ce8f60258d (patch)
tree9173aaea7291b6052c11b6b55bdded1515f03571 /pygments
parent4c3606b87d8af193003e30a2b6ad699ef9434469 (diff)
downloadpygments-53a39c2b6dc9d2e7b73943c842f698ce8f60258d.tar.gz
Improve CSound name handling.
This should fix the last of the spurious errors we're seeing in CI.
Diffstat (limited to 'pygments')
-rw-r--r--pygments/lexers/csound.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/pygments/lexers/csound.py b/pygments/lexers/csound.py
index c30b87cc..161e1576 100644
--- a/pygments/lexers/csound.py
+++ b/pygments/lexers/csound.py
@@ -227,9 +227,13 @@ class CsoundOrchestraLexer(CsoundLexer):
yield nameMatch.start(2), Name, nameMatch.group(2)
else:
yield match.start(), Name, name
- if match.group(2):
- yield match.start(2), Punctuation, match.group(2)
- yield match.start(3), Name, match.group(3)
+
+ # If there's a trailing :V, for example, we want to keep this around
+ # and emit it as well, otherwise this lexer will not pass round-trip
+ # testing
+ if match.group(2):
+ yield match.start(2), Punctuation, match.group(2)
+ yield match.start(3), Name, match.group(3)
tokens = {
'root': [