diff options
author | Georg Brandl <georg@python.org> | 2012-02-04 09:09:58 +0100 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2012-02-04 09:09:58 +0100 |
commit | bcc5a76dd72bd7f51ccddad8cb5a7df02153e792 (patch) | |
tree | 9d4319d667d1efad5c0155671555b1f415ab29b0 | |
parent | 9f29478b7f00843495315dc1cec8f22b93fb235a (diff) | |
download | pygments-bcc5a76dd72bd7f51ccddad8cb5a7df02153e792.tar.gz |
Closes #722: fix CoffeeScript glitch with regexes.
-rw-r--r-- | pygments/lexers/web.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/pygments/lexers/web.py b/pygments/lexers/web.py index 85c374d6..f76e3420 100644 --- a/pygments/lexers/web.py +++ b/pygments/lexers/web.py @@ -1796,7 +1796,7 @@ class CoffeeScriptLexer(RegexLexer): 'slashstartsregex': [ include('commentsandwhitespace'), (r'///', String.Regex, ('#pop', 'multilineregex')), - (r'/(\\.|[^[/\\\n]|\[(\\.|[^\]\\\n])*])+/' + (r'/(?! )(\\.|[^[/\\\n]|\[(\\.|[^\]\\\n])*])+/' r'([gim]+\b|\B)', String.Regex, '#pop'), (r'', Text, '#pop'), ], @@ -1834,8 +1834,9 @@ class CoffeeScriptLexer(RegexLexer): ("'", String, 'sqs'), ], 'strings': [ - (r'[^#\\\'"]+', String) # note that all coffee script strings are multi-line. - # hashmarks, quotes and backslashes must be parsed one at a time + (r'[^#\\\'"]+', String), + # note that all coffee script strings are multi-line. + # hashmarks, quotes and backslashes must be parsed one at a time ], 'interpoling_string' : [ (r'}', String.Interpol, "#pop"), |