diff options
author | David Robillard <d@drobilla.net> | 2011-11-21 08:06:03 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-11-21 08:06:03 +0000 |
commit | 17006fbd97023822c3dacaaea8148326ad366cad (patch) | |
tree | 0f34b5d9932a9a428660e9a47dcca9c090e2fed8 | |
parent | 66aac3964aa4fbdd927e15d20da55a06d1489079 (diff) | |
download | lv2-17006fbd97023822c3dacaaea8148326ad366cad.tar.xz |
Handle Turtle comma correctly in Pygments parser.
-rwxr-xr-x | lv2specgen/lv2specgen.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lv2specgen/lv2specgen.py b/lv2specgen/lv2specgen.py index 1a7455d..b8494a1 100755 --- a/lv2specgen/lv2specgen.py +++ b/lv2specgen/lv2specgen.py @@ -57,7 +57,7 @@ try: import pygments.lexers import pygments.formatters from pygments.lexer import RegexLexer, include, bygroups - from pygments.token import Text, Comment, Operator, Keyword, Name, String, Literal + from pygments.token import Text, Comment, Operator, Keyword, Name, String, Literal, Punctuation have_pygments = True except ImportError: print("Error importing pygments, syntax highlighting disabled") @@ -212,10 +212,12 @@ if have_pygments: (r'\s*<[^> ]*>', Name.Attribute), (r'\s*("""(?:.|\n)*?""")(\@[a-z]{2-4}|\^\^<?[a-zA-Z0-9\-\:_#/\.]*>?)?\s*', bygroups(Literal.String,Text)), (r'\s*".*?[^\\]"(?:\@[a-z]{2-4}|\^\^<?[a-zA-Z0-9\-\:_#/\.]*>?)?\s*', Literal.String), + (r'\s*[0-9]+\.[0-9]*\s*\n?', Literal.Number), + (r'\s*[0-9]+\s*\n?', Literal.Number), (r'\s*[a-zA-Z0-9\-_\:]\s*', Name.Attribute), (r'\s*\(', Text, 'objList'), - (r'\s*;\s*\n?', Text, '#pop'), - (r'\s*,\s*\n?', Text, '#pop'), # Added by drobilla so "," is not an error + (r'\s*;\s*\n?', Punctuation, '#pop'), + (r'\s*,\s*\n?', Punctuation), # Added by drobilla so "," is not an error (r'(?=\s*\])', Text, '#pop'), (r'(?=\s*\.)', Text, '#pop'), ], |