File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ Enhancements:
1414Bug Fixes
1515
1616* Ignore dunder attributes when creating Tokens (issue672).
17+ * Allow operators to precede dollar-quoted strings (issue763).
1718
1819
1920Release 0.4.4 (Apr 18, 2023)
Original file line number Diff line number Diff line change 3030
3131 (r"`(``|[^`])*`" , tokens .Name ),
3232 (r"´(´´|[^´])*´" , tokens .Name ),
33- (r'((?<!\S )\$(?:[_A-ZÀ-Ü]\w*)?\$)[\s\S]*?\1' , tokens .Literal ),
33+ (r'((?<![\w\"\$] )\$(?:[_A-ZÀ-Ü]\w*)?\$)[\s\S]*?\1' , tokens .Literal ),
3434
3535 (r'\?' , tokens .Name .Placeholder ),
3636 (r'%(\(\w+\))?s' , tokens .Name .Placeholder ),
Original file line number Diff line number Diff line change @@ -180,6 +180,14 @@ def test_psql_quotation_marks():
180180 $PROC_2$ LANGUAGE plpgsql;""" )
181181 assert len (t ) == 2
182182
183+ # operators are valid infront of dollar quoted strings
184+ t = sqlparse .split ("""UPDATE SET foo =$$bar;SELECT bar$$""" )
185+ assert len (t ) == 1
186+
187+ # identifiers must be separated by whitespace
188+ t = sqlparse .split ("""UPDATE SET foo TO$$bar;SELECT bar$$""" )
189+ assert len (t ) == 2
190+
183191
184192def test_double_precision_is_builtin ():
185193 s = 'DOUBLE PRECISION'
You can’t perform that action at this time.
0 commit comments