summaryrefslogtreecommitdiff
path: root/pygments
diff options
context:
space:
mode:
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>2011-04-04 11:41:52 +0100
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>2011-04-04 11:41:52 +0100
commit7b4dcdde6cc2f5afff7da8bc26645b5f302ffec9 (patch)
tree8fbb7a36e6096cc48c6db7290635c73a9815c13a /pygments
parent35e7c08140ad6fbbcf6c77351ce2850217dbbc79 (diff)
downloadpygments-7b4dcdde6cc2f5afff7da8bc26645b5f302ffec9.tar.gz
Added support for psql variables
Diffstat (limited to 'pygments')
-rw-r--r--pygments/lexers/postgres.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/pygments/lexers/postgres.py b/pygments/lexers/postgres.py
index 696b3baf..b0cceab3 100644
--- a/pygments/lexers/postgres.py
+++ b/pygments/lexers/postgres.py
@@ -50,11 +50,14 @@ class PostgresLexer(RegexLexer):
(r"'(''|[^'])*'", String.Single),
(r'"(""|[^"])*"', String.Name), # quoted identifier
(r'[a-zA-Z_][a-zA-Z0-9_]*', Name),
- (r'[;:()\[\],\.]', Punctuation),
- # psql backslash command.
- # This actually belongs to the console lexer,
+
+ # psql backslash command and variable
+ # These actually belongs to the console lexer,
# but putting it here makes things easier.
(r'\\.*?\n', Name), # TODO: what is a good token?
+ (r':[a-z][a-z0-9_]*\b', Name.Variable),
+
+ (r'[;:()\[\],\.]', Punctuation),
],
'multiline-comments': [
(r'/\*', Comment.Multiline, 'multiline-comments'),