diff options
author | Miikka Salminen <miikka.salminen@gmail.com> | 2015-03-07 22:30:17 +0200 |
---|---|---|
committer | Miikka Salminen <miikka.salminen@gmail.com> | 2015-03-07 22:30:17 +0200 |
commit | b55a3a9f79dc14c146a11aa32230624469ff874b (patch) | |
tree | 280cc94008825cf08ee03f6455682a27025d974a /pygments/lexers/python.py | |
parent | 50c6950c7fa48cce73af6072b35f40608a158306 (diff) | |
download | pygments-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.py | 3 |
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), |