@@ -285,7 +285,7 @@ impl Parser {
285
285
self . expect_token ( & Token :: LParen ) ?;
286
286
let partition_by = if self . parse_keywords ( vec ! [ "PARTITION" , "BY" ] ) {
287
287
// a list of possibly-qualified column names
288
- self . parse_expr_list ( ) ?
288
+ self . parse_comma_separated ( Parser :: parse_expr ) ?
289
289
} else {
290
290
vec ! [ ]
291
291
} ;
@@ -597,7 +597,7 @@ impl Parser {
597
597
} else {
598
598
Expr :: InList {
599
599
expr : Box :: new ( expr) ,
600
- list : self . parse_expr_list ( ) ?,
600
+ list : self . parse_comma_separated ( Parser :: parse_expr ) ?,
601
601
negated,
602
602
}
603
603
} ;
@@ -1568,7 +1568,7 @@ impl Parser {
1568
1568
} ;
1569
1569
1570
1570
let group_by = if self . parse_keywords ( vec ! [ "GROUP" , "BY" ] ) {
1571
- self . parse_expr_list ( ) ?
1571
+ self . parse_comma_separated ( Parser :: parse_expr ) ?
1572
1572
} else {
1573
1573
vec ! [ ]
1574
1574
} ;
@@ -1734,7 +1734,7 @@ impl Parser {
1734
1734
let mut with_hints = vec ! [ ] ;
1735
1735
if self . parse_keyword ( "WITH" ) {
1736
1736
if self . consume_token ( & Token :: LParen ) {
1737
- with_hints = self . parse_expr_list ( ) ?;
1737
+ with_hints = self . parse_comma_separated ( Parser :: parse_expr ) ?;
1738
1738
self . expect_token ( & Token :: RParen ) ?;
1739
1739
} else {
1740
1740
// rewind, as WITH may belong to the next statement's CTE
@@ -1818,16 +1818,11 @@ impl Parser {
1818
1818
Ok ( Assignment { id, value } )
1819
1819
}
1820
1820
1821
- /// Parse a comma-delimited list of SQL expressions
1822
- pub fn parse_expr_list ( & mut self ) -> Result < Vec < Expr > , ParserError > {
1823
- Ok ( self . parse_comma_separated ( Parser :: parse_expr) ?)
1824
- }
1825
-
1826
1821
pub fn parse_optional_args ( & mut self ) -> Result < Vec < Expr > , ParserError > {
1827
1822
if self . consume_token ( & Token :: RParen ) {
1828
1823
Ok ( vec ! [ ] )
1829
1824
} else {
1830
- let args = self . parse_expr_list ( ) ?;
1825
+ let args = self . parse_comma_separated ( Parser :: parse_expr ) ?;
1831
1826
self . expect_token ( & Token :: RParen ) ?;
1832
1827
Ok ( args)
1833
1828
}
@@ -1911,9 +1906,9 @@ impl Parser {
1911
1906
pub fn parse_values ( & mut self ) -> Result < Values , ParserError > {
1912
1907
let values = self . parse_comma_separated ( |parser| {
1913
1908
parser. expect_token ( & Token :: LParen ) ?;
1914
- let e = parser. parse_expr_list ( ) ?;
1909
+ let exprs = parser. parse_comma_separated ( Parser :: parse_expr ) ?;
1915
1910
parser. expect_token ( & Token :: RParen ) ?;
1916
- Ok ( e )
1911
+ Ok ( exprs )
1917
1912
} ) ?;
1918
1913
Ok ( Values ( values) )
1919
1914
}
0 commit comments