File tree Expand file tree Collapse file tree 2 files changed +5
-10
lines changed
Expand file tree Collapse file tree 2 files changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -401,6 +401,8 @@ class Parser(parser.Parser):
401401 TABLE_ALIAS_TOKENS = parser .Parser .TABLE_ALIAS_TOKENS | {TokenType .WINDOW }
402402 TABLE_ALIAS_TOKENS .discard (TokenType .MATCH_CONDITION )
403403
404+ COLON_PLACEHOLDER_TOKENS = ID_VAR_TOKENS | {TokenType .NUMBER }
405+
404406 FUNCTIONS = {
405407 ** parser .Parser .FUNCTIONS ,
406408 "APPROX_PERCENTILE" : exp .ApproxQuantile .from_arg_list ,
@@ -514,15 +516,6 @@ class Parser(parser.Parser):
514516 TokenType .SHOW : lambda self : self ._parse_show (),
515517 }
516518
517- PLACEHOLDER_PARSERS = {
518- ** parser .Parser .PLACEHOLDER_PARSERS ,
519- TokenType .COLON : lambda self : (
520- self .expression (exp .Placeholder , this = self ._prev .text )
521- if self ._match_set (self .ID_VAR_TOKENS ) or self ._match (TokenType .NUMBER )
522- else None
523- ),
524- }
525-
526519 PROPERTY_PARSERS = {
527520 ** parser .Parser .PROPERTY_PARSERS ,
528521 "CREDENTIALS" : lambda self : self ._parse_credentials_property (),
Original file line number Diff line number Diff line change @@ -580,6 +580,8 @@ class Parser(metaclass=_Parser):
580580
581581 ALIAS_TOKENS = ID_VAR_TOKENS
582582
583+ COLON_PLACEHOLDER_TOKENS = ID_VAR_TOKENS
584+
583585 ARRAY_CONSTRUCTORS = {
584586 "ARRAY" : exp .Array ,
585587 "LIST" : exp .List ,
@@ -902,7 +904,7 @@ class Parser(metaclass=_Parser):
902904 TokenType .PARAMETER : lambda self : self ._parse_parameter (),
903905 TokenType .COLON : lambda self : (
904906 self .expression (exp .Placeholder , this = self ._prev .text )
905- if self ._match_set (self .ID_VAR_TOKENS )
907+ if self ._match_set (self .COLON_PLACEHOLDER_TOKENS )
906908 else None
907909 ),
908910 }
You can’t perform that action at this time.
0 commit comments