summaryrefslogtreecommitdiff
path: root/sqlparse
diff options
context:
space:
mode:
Diffstat (limited to 'sqlparse')
-rw-r--r--sqlparse/lexer.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/sqlparse/lexer.py b/sqlparse/lexer.py
index a60c789..3e9a1a6 100644
--- a/sqlparse/lexer.py
+++ b/sqlparse/lexer.py
@@ -315,7 +315,13 @@ class Lexer(object):
statestack.pop()
elif state == '#push':
statestack.append(statestack[-1])
- else:
+ elif (
+ # Ugly hack - multiline-comments
+ # are not stackable
+ state != 'multiline-comments'
+ or not statestack
+ or statestack[-1] != 'multiline-comments'
+ ):
statestack.append(state)
elif isinstance(new_state, int):
# pop