Skip to content

Commit 5df3f52

Browse files
authored
fix: Remove number matching from COLON placeholder parser (#3761)
1 parent a2a6efb commit 5df3f52

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

sqlglot/parser.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,7 @@ class Parser(metaclass=_Parser):
777777
TokenType.PARAMETER: lambda self: self._parse_parameter(),
778778
TokenType.COLON: lambda self: (
779779
self.expression(exp.Placeholder, this=self._prev.text)
780-
if self._match(TokenType.NUMBER) or self._match_set(self.ID_VAR_TOKENS)
780+
if self._match_set(self.ID_VAR_TOKENS)
781781
else None
782782
),
783783
}

tests/fixtures/identity.sql

+1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ x >> 1 | 1 & 1 ^ 1
5353
x || y
5454
x[ : ]
5555
x[1 : ]
56+
x[ : 2]
5657
x[1 : 2]
5758
x[-4 : -1]
5859
1 - -1

0 commit comments

Comments
 (0)