diff options
-rw-r--r-- | pygments/lexers/postgres.py | 6 | ||||
-rw-r--r-- | tests/examplefiles/psql_session.txt | 11 |
2 files changed, 13 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) diff --git a/tests/examplefiles/psql_session.txt b/tests/examplefiles/psql_session.txt index 565f7c33..fd87a133 100644 --- a/tests/examplefiles/psql_session.txt +++ b/tests/examplefiles/psql_session.txt @@ -42,6 +42,17 @@ regression(# 1); 1 (1 row) +piro=> select ( +piro(> ' +piro'> ' || $$ +piro$> $$) +piro-> from " +piro"> foo"; +ERROR: relation " +foo" does not exist +LINE 5: from " + ^ + testdb=> CREATE TABLE my_table ( first integer not null default 0, second text) ; -- end of command |