summaryrefslogtreecommitdiff
path: root/pygments
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2014-10-17 17:40:46 +0200
committerGeorg Brandl <georg@python.org>2014-10-17 17:40:46 +0200
commit239f6074a34cd91280595d8eb2d5771a64bb579d (patch)
treefaf201ba4781b45322b7d907331107a20c6030af /pygments
parente58cec4383921b7ab6fcae37188c6fcf4c1bde80 (diff)
downloadpygments-239f6074a34cd91280595d8eb2d5771a64bb579d.tar.gz
Javascript: allow shebangs
Diffstat (limited to 'pygments')
-rw-r--r--pygments/lexers/javascript.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/pygments/lexers/javascript.py b/pygments/lexers/javascript.py
index f7e4e478..99361aaf 100644
--- a/pygments/lexers/javascript.py
+++ b/pygments/lexers/javascript.py
@@ -59,6 +59,7 @@ class JavascriptLexer(RegexLexer):
(r'\n', Text, '#pop')
],
'root': [
+ (r'^#! ?/.*?\n', Comment), # shebang lines are recognized by node.js
(r'^(?=\s|/|<!--)', Text, 'slashstartsregex'),
include('commentsandwhitespace'),
(r'\+\+|--|~|&&|\?|:|\|\||\\(?=\n)|'