Skip to content

Commit 1e3c3b9

Browse files
committed
Fixed regular expression for Nameplaces
1 parent 9e4feb2 commit 1e3c3b9

2 files changed

Lines changed: 2 additions & 6 deletions

File tree

sqlparse/filters.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,9 @@ def StripWhitespace(stream):
8080
ignore_group = frozenset((Comparison, Punctuation))
8181

8282
for token_type, value in stream:
83-
# We got a previous token
83+
# We got a previous token (not empty first ones)
8484
if last_type:
85-
print repr(token_type), repr(value)
86-
8785
if token_type in Whitespace:
88-
print '\t', repr(token_type), repr(value)
89-
9086
has_space = True
9187
continue
9288

sqlparse/lexer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ class Lexer(object):
177177
(r"´(´´|[^´])*´", tokens.Name),
178178
(r'\$([a-zA-Z_][a-zA-Z0-9_]*)?\$', tokens.Name.Builtin),
179179
(r'\?{1}', tokens.Name.Placeholder),
180-
(r'[$:?%][a-zA-Z0-9_]+[^$:?%]?', tokens.Name.Placeholder),
180+
(r'[$:?%][a-zA-Z0-9_]+', tokens.Name.Placeholder),
181181
(r'@[a-zA-Z_][a-zA-Z0-9_]+', tokens.Name),
182182
(r'[a-zA-Z_][a-zA-Z0-9_]*(?=[.(])', tokens.Name), # see issue39
183183
(r'[-]?0x[0-9a-fA-F]+', tokens.Number.Hexadecimal),

0 commit comments

Comments
 (0)