diff options
author | Georg Brandl <georg@python.org> | 2014-11-06 12:45:29 +0100 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2014-11-06 12:45:29 +0100 |
commit | 82f5d9d9ca267212ffd78e3319eebe29aef845a6 (patch) | |
tree | c4fa5b49b8a5d4be00ad7aad68286064b8171877 /pygments | |
parent | 6fe296e816745123f1d3dbb3a55d8033ddb943d9 (diff) | |
download | pygments-82f5d9d9ca267212ffd78e3319eebe29aef845a6.tar.gz |
Fix flags for JS.
Diffstat (limited to 'pygments')
-rw-r--r-- | pygments/lexers/javascript.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/pygments/lexers/javascript.py b/pygments/lexers/javascript.py index 0c22aa6e..2957d86c 100644 --- a/pygments/lexers/javascript.py +++ b/pygments/lexers/javascript.py @@ -40,7 +40,8 @@ class JavascriptLexer(RegexLexer): mimetypes = ['application/javascript', 'application/x-javascript', 'text/x-javascript', 'text/javascript', ] - flags = re.DOTALL | re.UNICODE + flags = re.DOTALL | re.UNICODE | re.MULTILINE + tokens = { 'commentsandwhitespace': [ (r'\s+', Text), @@ -59,11 +60,11 @@ class JavascriptLexer(RegexLexer): (r'\n', Text, '#pop') ], 'root': [ - (r'^#! ?/.*?\n', Comment), # shebang lines are recognized by node.js + (r'\A#! ?/.*?\n', Comment), # shebang lines are recognized by node.js (r'^(?=\s|/|<!--)', Text, 'slashstartsregex'), include('commentsandwhitespace'), (r'\+\+|--|~|&&|\?|:|\|\||\\(?=\n)|' - r'(<<|>>>?|==?|!=?|[-<>+*%&\|\^/])=?', Operator, 'slashstartsregex'), + r'(<<|>>>?|==?|!=?|[-<>+*%&|^/])=?', Operator, 'slashstartsregex'), (r'[{(\[;,]', Punctuation, 'slashstartsregex'), (r'[})\].]', Punctuation), (r'(for|in|while|do|break|return|continue|switch|case|default|if|else|' |