diff options
author | Tim Hatch <tim@timhatch.com> | 2014-04-24 15:40:36 -0400 |
---|---|---|
committer | Tim Hatch <tim@timhatch.com> | 2014-04-24 15:40:36 -0400 |
commit | 0c7f160e848d472bbe8f0e277b4f11dece859cc0 (patch) | |
tree | ca96e59dc63eccbbce1bdb0ae87577d9e9d78957 /pygments | |
parent | 9ca27c93bd28d0f76f9cd30f7a9a6b2c822bf473 (diff) | |
download | pygments-0c7f160e848d472bbe8f0e277b4f11dece859cc0.tar.gz |
Fix PanLexer and TcshLexer to allow inline comments without whitespace
Diffstat (limited to 'pygments')
-rw-r--r-- | pygments/lexers/other.py | 7 | ||||
-rw-r--r-- | pygments/lexers/shell.py | 5 |
2 files changed, 8 insertions, 4 deletions
diff --git a/pygments/lexers/other.py b/pygments/lexers/other.py index 91b3dd5d..47a4b865 100644 --- a/pygments/lexers/other.py +++ b/pygments/lexers/other.py @@ -4183,6 +4183,8 @@ class PanLexer(RegexLexer): Lexer for `pan <http://github.com/quattor/pan/>`_ source files. Based on tcsh lexer. + + .. versionadded:: 2.0 """ name = 'Pan' @@ -4210,17 +4212,18 @@ class PanLexer(RegexLexer): r'to_boolean|to_double|to_long|to_string|clone|delete|exists|' r'path_exists|if_exists|return|value)\s*\b', Name.Builtin), - (r'#.*\n', Comment), + (r'#.*', Comment), (r'\\[\w\W]', String.Escape), (r'(\b\w+)(\s*)(=)', bygroups(Name.Variable, Text, Operator)), (r'[\[\]{}()=]+', Operator), (r'<<\s*(\'?)\\?(\w+)[\w\W]+?\2', String), + (r';', Punctuation), ], 'data': [ (r'(?s)"(\\\\|\\[0-7]+|\\.|[^"\\])*"', String.Double), (r"(?s)'(\\\\|\\[0-7]+|\\.|[^'\\])*'", String.Single), (r'\s+', Text), - (r'[^=\s\[\]{}()$"\'`\\]+', Text), + (r'[^=\s\[\]{}()$"\'`\\;#]+', Text), (r'\d+(?= |\Z)', Number), ], 'curly': [ diff --git a/pygments/lexers/shell.py b/pygments/lexers/shell.py index c07ff6ee..f809dae9 100644 --- a/pygments/lexers/shell.py +++ b/pygments/lexers/shell.py @@ -296,17 +296,18 @@ class TcshLexer(RegexLexer): r'umask|unalias|uncomplete|unhash|universe|unlimit|unset|unsetenv|' r'ver|wait|warp|watchlog|where|which)\s*\b', Name.Builtin), - (r'#.*\n', Comment), + (r'#.*', Comment), (r'\\[\w\W]', String.Escape), (r'(\b\w+)(\s*)(=)', bygroups(Name.Variable, Text, Operator)), (r'[\[\]{}()=]+', Operator), (r'<<\s*(\'?)\\?(\w+)[\w\W]+?\2', String), + (r';', Punctuation), ], 'data': [ (r'(?s)"(\\\\|\\[0-7]+|\\.|[^"\\])*"', String.Double), (r"(?s)'(\\\\|\\[0-7]+|\\.|[^'\\])*'", String.Single), (r'\s+', Text), - (r'[^=\s\[\]{}()$"\'`\\]+', Text), + (r'[^=\s\[\]{}()$"\'`\\;#]+', Text), (r'\d+(?= |\Z)', Number), (r'\$#?(\w+|.)', Name.Variable), ], |