summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2010-10-17 08:49:16 +0200
committerGeorg Brandl <georg@python.org>2010-10-17 08:49:16 +0200
commitb1020ac9d1dd036f02c5879a621959c5fd5fe2ec (patch)
tree19260d7e225912f5be38eb12e737390df17f4301
parent6c868bdff325d80a22c64bc55e0be5fd355dfc55 (diff)
downloadpygments-b1020ac9d1dd036f02c5879a621959c5fd5fe2ec.tar.gz
#602: update CoffeeScript lexer.
-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 b50f059d..622719ab 100644
--- a/pygments/lexers/web.py
+++ b/pygments/lexers/web.py
@@ -1642,9 +1642,10 @@ class CoffeeScriptLexer(RegexLexer):
'root': [
(r'^(?=\s|/|<!--)', Text, 'slashstartsregex'),
include('commentsandwhitespace'),
- (r'\+\+|--|~|&&|\band\b|\bor\b|\bis\b|\bisnt\b|\bnot\b|\?|:|'
+ (r'\+\+|--|~|&&|\band\b|\bor\b|\bis\b|\bisnt\b|\bnot\b|\?|:|=|'
r'\|\||\\(?=\n)|(<<|>>>?|==?|!=?|[-<>+*`%&\|\^/])=?',
Operator, 'slashstartsregex'),
+ (r'\([^()]*\)\s*->', Name.Function),
(r'[{(\[;,]', Punctuation, 'slashstartsregex'),
(r'[})\].]', Punctuation),
(r'(for|in|of|while|break|return|continue|switch|when|then|if|else|'
@@ -1657,9 +1658,9 @@ class CoffeeScriptLexer(RegexLexer):
r'decodeURIComponent|encodeURI|encodeURIComponent|'
r'eval|isFinite|isNaN|parseFloat|parseInt|document|window)\b',
Name.Builtin),
- (r'[$a-zA-Z_][a-zA-Z0-9_\.:]*\s*:\s', Name.Variable,
+ (r'[$a-zA-Z_][a-zA-Z0-9_\.:]*\s*[:=]\s', Name.Variable,
'slashstartsregex'),
- (r'@[$a-zA-Z_][a-zA-Z0-9_\.:]*\s*:\s', Name.Variable.Instance,
+ (r'@[$a-zA-Z_][a-zA-Z0-9_\.:]*\s*[:=]\s', Name.Variable.Instance,
'slashstartsregex'),
(r'@?[$a-zA-Z_][a-zA-Z0-9_]*', Name.Other, 'slashstartsregex'),
(r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float),