diff options
| author | Georg Brandl <georg@python.org> | 2015-03-08 07:13:16 +0100 |
|---|---|---|
| committer | Georg Brandl <georg@python.org> | 2015-03-08 07:13:16 +0100 |
| commit | a03ce2e200bf2e279a748ced591a380684088d3f (patch) | |
| tree | fbdebd0b33cdb6526638319d2af63eea33df2eee /pygments/lexers/python.py | |
| parent | 7009e7a5ad29ff5d911533c83081eb76a887e9ed (diff) | |
| parent | b55a3a9f79dc14c146a11aa32230624469ff874b (diff) | |
| download | pygments-a03ce2e200bf2e279a748ced591a380684088d3f.tar.gz | |
Merged in miikkas/pygments-hashbangtokens (pull request #457)
A new token type Comment.Hashbang
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 006ffd02..eab4f9f4 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), |
