summaryrefslogtreecommitdiff
path: root/sqlparse/keywords.py
diff options
context:
space:
mode:
authorVictor Uriarte <victor.m.uriarte@intel.com>2016-06-03 09:55:41 -0700
committerVictor Uriarte <victor.m.uriarte@intel.com>2016-06-04 11:54:13 -0700
commit348ff620fa1acb807b83b173ee62807df21510e5 (patch)
tree4fb1ea6a0ddc11aaf2889099f118f3fa1ada6de7 /sqlparse/keywords.py
parentf8f85fa4f1a8265fb78ea2e747c0476e1f04b09f (diff)
downloadsqlparse-348ff620fa1acb807b83b173ee62807df21510e5.tar.gz
Simplify multi-line comments
Diffstat (limited to 'sqlparse/keywords.py')
-rw-r--r--sqlparse/keywords.py11
1 files changed, 3 insertions, 8 deletions
diff --git a/sqlparse/keywords.py b/sqlparse/keywords.py
index c6db0a9..41edbff 100644
--- a/sqlparse/keywords.py
+++ b/sqlparse/keywords.py
@@ -19,9 +19,11 @@ SQL_REGEX = {
# $ matches *before* newline, therefore we have two patterns
# to match Comment.Single
(r'(--|# ).*?$', tokens.Comment.Single),
+ (r'/\*[\s\S]*?\*/', tokens.Comment.Multiline),
+
(r'(\r\n|\r|\n)', tokens.Newline),
(r'\s+', tokens.Whitespace),
- (r'/\*', tokens.Comment.Multiline, 'multiline-comments'),
+
(r':=', tokens.Assignment),
(r'::', tokens.Punctuation),
(r'[*]', tokens.Wildcard),
@@ -64,12 +66,6 @@ SQL_REGEX = {
(r'[;:()\[\],\.]', tokens.Punctuation),
(r'[<>=~!]+', tokens.Operator.Comparison),
(r'[+/@#%^&|`?^-]+', tokens.Operator),
- ],
- 'multiline-comments': [
- (r'/\*', tokens.Comment.Multiline, 'multiline-comments'),
- (r'\*/', tokens.Comment.Multiline, '#pop'),
- (r'[^/\*]+', tokens.Comment.Multiline),
- (r'[/*]', tokens.Comment.Multiline),
]}
KEYWORDS = {
@@ -600,7 +596,6 @@ KEYWORDS = {
'VARYING': tokens.Name.Builtin,
}
-
KEYWORDS_COMMON = {
'SELECT': tokens.Keyword.DML,
'INSERT': tokens.Keyword.DML,