summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2012-02-04 09:09:58 +0100
committerGeorg Brandl <georg@python.org>2012-02-04 09:09:58 +0100
commitbcc5a76dd72bd7f51ccddad8cb5a7df02153e792 (patch)
tree9d4319d667d1efad5c0155671555b1f415ab29b0
parent9f29478b7f00843495315dc1cec8f22b93fb235a (diff)
downloadpygments-bcc5a76dd72bd7f51ccddad8cb5a7df02153e792.tar.gz
Closes #722: fix CoffeeScript glitch with regexes.
-rw-r--r--pygments/lexers/web.py7
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"),