summaryrefslogtreecommitdiff
path: root/pygments/lexers/python.py
diff options
context:
space:
mode:
authorMiikka Salminen <miikka.salminen@gmail.com>2015-03-07 22:30:17 +0200
committerMiikka Salminen <miikka.salminen@gmail.com>2015-03-07 22:30:17 +0200
commitb55a3a9f79dc14c146a11aa32230624469ff874b (patch)
tree280cc94008825cf08ee03f6455682a27025d974a /pygments/lexers/python.py
parent50c6950c7fa48cce73af6072b35f40608a158306 (diff)
downloadpygments-b55a3a9f79dc14c146a11aa32230624469ff874b.tar.gz
Added a new token type Comment.Hashbang with its documentation, and a support for it in Javascript, Perl, Python, Ruby and Bash lexers.
Diffstat (limited to 'pygments/lexers/python.py')
-rw-r--r--pygments/lexers/python.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/pygments/lexers/python.py b/pygments/lexers/python.py
index 3c1aff56..e0da29f6 100644
--- a/pygments/lexers/python.py
+++ b/pygments/lexers/python.py
@@ -41,7 +41,8 @@ class PythonLexer(RegexLexer):
(r'^(\s*)([rRuU]{,2}"""(?:.|\n)*?""")', bygroups(Text, String.Doc)),
(r"^(\s*)([rRuU]{,2}'''(?:.|\n)*?''')", bygroups(Text, String.Doc)),
(r'[^\S\n]+', Text),
- (r'#.*$', Comment),
+ (r'\A#!.+$', Comment.Hashbang),
+ (r'#.*$', Comment.Single),
(r'[]{}:(),;[]', Punctuation),
(r'\\\n', Text),
(r'\\', Text),