diff options
author | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2011-04-12 01:02:39 +0100 |
---|---|---|
committer | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2011-04-12 01:02:39 +0100 |
commit | d4302474b65cd18f865a981ccd9483fed311ab5c (patch) | |
tree | 3f6e047c83907115f6f6d0ca32d46c9b70bd017f /pygments/lexers/postgres.py | |
parent | 7ed4229732bab59b4a290a54376acdda561acc7c (diff) | |
download | pygments-d4302474b65cd18f865a981ccd9483fed311ab5c.tar.gz |
psql can receive many backslash commands on the same line
Diffstat (limited to 'pygments/lexers/postgres.py')
-rw-r--r-- | pygments/lexers/postgres.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/pygments/lexers/postgres.py b/pygments/lexers/postgres.py index e99630fd..8aeab3b8 100644 --- a/pygments/lexers/postgres.py +++ b/pygments/lexers/postgres.py @@ -99,7 +99,7 @@ class PostgresLexer(RegexLexer): (r'(?ms)(\$[^\$]*\$)(.*?)(\1)', language_callback), (r'[a-zA-Z_][a-zA-Z0-9_]*', Name), - # TODO: consider splitting the regex parser + # TODO: consider splitting the psql parser (r'\\[^\s]+', Keyword.Pseudo, 'psql-command'), # psql variable in SQL (r""":(['"]?)[a-z][a-z0-9_]*\b\1""", Name.Variable), @@ -115,6 +115,7 @@ class PostgresLexer(RegexLexer): 'psql-command': [ (r'\n', Text, 'root'), (r'\s+', Text), + (r'\\[^\s]+', Keyword.Pseudo), (r""":(['"]?)[a-z][a-z0-9_]*\b\1""", Name.Variable), (r"'(''|[^'])*'", String.Single), (r"`([^`])*`", String.Backtick), |