@@ -6484,14 +6484,6 @@ impl<'a> Parser<'a> {
6484
6484
}
6485
6485
}
6486
6486
6487
- pub fn parse_key_value ( & mut self ) -> Result < ( Ident , Expr ) , ParserError > {
6488
- let name = self . parse_identifier ( false ) ?;
6489
- self . expect_token ( & Token :: Eq ) ?;
6490
- let value = self . parse_expr ( ) ?;
6491
-
6492
- Ok ( ( name, value) )
6493
- }
6494
-
6495
6487
pub fn parse_sql_option ( & mut self ) -> Result < SqlOption , ParserError > {
6496
6488
let is_mssql = dialect_of ! ( self is MsSqlDialect |GenericDialect ) ;
6497
6489
@@ -6506,7 +6498,10 @@ impl<'a> Parser<'a> {
6506
6498
self . parse_option_clustered ( )
6507
6499
}
6508
6500
_ => {
6509
- let ( name, value) = self . parse_key_value ( ) ?;
6501
+ let name = self . parse_identifier ( false ) ?;
6502
+ self . expect_token ( & Token :: Eq ) ?;
6503
+ let value = self . parse_expr ( ) ?;
6504
+
6510
6505
Ok ( SqlOption :: KeyValue { key : name, value } )
6511
6506
}
6512
6507
}
@@ -6533,7 +6528,7 @@ impl<'a> Parser<'a> {
6533
6528
6534
6529
let columns = self . parse_comma_separated ( |p| {
6535
6530
let name = p. parse_identifier ( false ) ?;
6536
- let asc = p. parse_asc ( ) ;
6531
+ let asc = p. parse_asc_desc ( ) ;
6537
6532
6538
6533
Ok ( ClusteredIndex { name, asc } )
6539
6534
} ) ?;
@@ -11069,9 +11064,9 @@ impl<'a> Parser<'a> {
11069
11064
} )
11070
11065
}
11071
11066
11072
- /// Parsae ASC or DESC, returns an Option with true if ASC, false of DESC or `None` if none of
11067
+ /// Parse ASC or DESC, returns an Option with true if ASC, false of DESC or `None` if none of
11073
11068
/// them.
11074
- pub fn parse_asc ( & mut self ) -> Option < bool > {
11069
+ pub fn parse_asc_desc ( & mut self ) -> Option < bool > {
11075
11070
if self . parse_keyword ( Keyword :: ASC ) {
11076
11071
Some ( true )
11077
11072
} else if self . parse_keyword ( Keyword :: DESC ) {
@@ -11085,7 +11080,7 @@ impl<'a> Parser<'a> {
11085
11080
pub fn parse_order_by_expr ( & mut self ) -> Result < OrderByExpr , ParserError > {
11086
11081
let expr = self . parse_expr ( ) ?;
11087
11082
11088
- let asc = self . parse_asc ( ) ;
11083
+ let asc = self . parse_asc_desc ( ) ;
11089
11084
11090
11085
let nulls_first = if self . parse_keywords ( & [ Keyword :: NULLS , Keyword :: FIRST ] ) {
11091
11086
Some ( true )
0 commit comments