diff options
author | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2011-04-13 09:49:02 +0100 |
---|---|---|
committer | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2011-04-13 09:49:02 +0100 |
commit | 98c745ccf4f94a129dae7f53a7db59277e0a06df (patch) | |
tree | 43802232e3e74e15c64cb7d2a9c7bc745437b39d /pygments/lexers/postgres.py | |
parent | 4f8f83415ac1a0e6c932e26a460fd83fa04e9811 (diff) | |
download | pygments-98c745ccf4f94a129dae7f53a7db59277e0a06df.tar.gz |
Detect multiline strings and error output in psql session
Diffstat (limited to 'pygments/lexers/postgres.py')
-rw-r--r-- | pygments/lexers/postgres.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/pygments/lexers/postgres.py b/pygments/lexers/postgres.py index 21185b30..501cc166 100644 --- a/pygments/lexers/postgres.py +++ b/pygments/lexers/postgres.py @@ -166,7 +166,7 @@ class PsqlRegexLexer(PostgresLexer): (r"[^\s]+", String.Symbol), ] -re_prompt = re.compile(r'^(\S.*?)??[=\-\(][#>]') +re_prompt = re.compile(r'^(\S.*?)??[=\-\(\$\'\"][#>]') re_psql_command = re.compile(r'\s*\\') re_end_command = re.compile(r';\s*(--.*?)?$') re_psql_command = re.compile(r'(\s*)(\\.+?)(\s+)$') @@ -260,9 +260,7 @@ class PostgresConsoleLexer(Lexer): out_token = Generic.Error yield (mmsg.start(1), Generic.Strong, mmsg.group(1)) yield (mmsg.start(2), out_token, mmsg.group(2)) - elif re_charhint.match(line): - yield (0, out_token, line) else: - yield (0, Generic.Output, line) + yield (0, out_token, line) |