@@ -552,7 +552,7 @@ impl<'a> Parser<'a> {
552552 } else {
553553 Ok ( Expr :: Cast {
554554 expr: Box :: new( Expr :: Value ( Value :: String ( parser. parse_literal_string( ) ?) ) ) ,
555- data_type,
555+ data_type: Box :: new ( data_type ) ,
556556 } )
557557 }
558558 } ) ) ;
@@ -564,7 +564,7 @@ impl<'a> Parser<'a> {
564564 ( Token :: LBracket , _) => {
565565 self . prev_token ( ) ;
566566 let function = self . parse_named_function ( ) ?;
567- Ok ( Expr :: Function ( function) )
567+ Ok ( Expr :: Function ( Box :: new ( function) ) )
568568 }
569569 ( Token :: Keyword ( TRUE ) | Token :: Keyword ( FALSE ) | Token :: Keyword ( NULL ) , _) => {
570570 self . prev_token ( ) ;
@@ -920,12 +920,12 @@ impl<'a> Parser<'a> {
920920 ) {
921921 Ok ( Expr :: Cast {
922922 expr : Box :: new ( Expr :: Nested ( Box :: new ( expr) ) ) ,
923- data_type,
923+ data_type : Box :: new ( data_type ) ,
924924 } )
925925 } else {
926926 Ok ( Expr :: Cast {
927927 expr : Box :: new ( expr) ,
928- data_type,
928+ data_type : Box :: new ( data_type ) ,
929929 } )
930930 }
931931 }
@@ -970,13 +970,13 @@ impl<'a> Parser<'a> {
970970 self . expect_keyword ( FROM ) ?;
971971 let expr = self . parse_expr ( ) ?;
972972 self . expect_token ( & Token :: RParen ) ?;
973- Ok ( Expr :: Function ( Function {
973+ Ok ( Expr :: Function ( Box :: new ( Function {
974974 name : RawItemName :: Name ( UnresolvedItemName :: unqualified ( ident ! ( "extract" ) ) ) ,
975975 args : FunctionArgs :: args ( vec ! [ Expr :: Value ( Value :: String ( field) ) , expr] ) ,
976976 filter : None ,
977977 over : None ,
978978 distinct : false ,
979- } ) )
979+ } ) ) )
980980 }
981981
982982 fn parse_row_expr ( & mut self ) -> Result < Expr < Raw > , ParserError > {
@@ -1033,13 +1033,13 @@ impl<'a> Parser<'a> {
10331033 }
10341034 }
10351035 self . expect_token ( & Token :: RParen ) ?;
1036- Ok ( Expr :: Function ( Function {
1036+ Ok ( Expr :: Function ( Box :: new ( Function {
10371037 name : RawItemName :: Name ( UnresolvedItemName :: unqualified ( name) ) ,
10381038 args : FunctionArgs :: args ( exprs) ,
10391039 filter : None ,
10401040 over : None ,
10411041 distinct : false ,
1042- } ) )
1042+ } ) ) )
10431043 }
10441044
10451045 // Parse calls to position(), which has the special form position('string' in 'string').
@@ -1051,13 +1051,13 @@ impl<'a> Parser<'a> {
10511051 self . expect_token ( & Token :: Keyword ( IN ) ) ?;
10521052 let haystack = self . parse_expr ( ) ?;
10531053 self . expect_token ( & Token :: RParen ) ?;
1054- Ok ( Expr :: Function ( Function {
1054+ Ok ( Expr :: Function ( Box :: new ( Function {
10551055 name : RawItemName :: Name ( UnresolvedItemName :: unqualified ( ident ! ( "position" ) ) ) ,
10561056 args : FunctionArgs :: args ( vec ! [ needle, haystack] ) ,
10571057 filter : None ,
10581058 over : None ,
10591059 distinct : false ,
1060- } ) )
1060+ } ) ) )
10611061 }
10621062
10631063 /// Parse calls to normalize(), which can take the form:
@@ -1080,13 +1080,13 @@ impl<'a> Parser<'a> {
10801080 } ;
10811081
10821082 self . expect_token ( & Token :: RParen ) ?;
1083- Ok ( Expr :: Function ( Function {
1083+ Ok ( Expr :: Function ( Box :: new ( Function {
10841084 name : RawItemName :: Name ( UnresolvedItemName :: unqualified ( ident ! ( "normalize" ) ) ) ,
10851085 args : FunctionArgs :: args ( args) ,
10861086 filter : None ,
10871087 over : None ,
10881088 distinct : false ,
1089- } ) )
1089+ } ) ) )
10901090 }
10911091
10921092 /// Parse an INTERVAL literal.
@@ -1273,15 +1273,15 @@ impl<'a> Parser<'a> {
12731273 } ) ,
12741274 AT => {
12751275 self . expect_keywords ( & [ TIME , ZONE ] ) ?;
1276- Ok ( Expr :: Function ( Function {
1276+ Ok ( Expr :: Function ( Box :: new ( Function {
12771277 name : RawItemName :: Name ( UnresolvedItemName :: unqualified ( ident ! (
12781278 "timezone"
12791279 ) ) ) ,
12801280 args : FunctionArgs :: args ( vec ! [ self . parse_subexpr( precedence) ?, expr] ) ,
12811281 filter : None ,
12821282 over : None ,
12831283 distinct : false ,
1284- } ) )
1284+ } ) ) )
12851285 }
12861286 COLLATE => Ok ( Expr :: Collate {
12871287 expr : Box :: new ( expr) ,
@@ -1410,13 +1410,13 @@ impl<'a> Parser<'a> {
14101410 }
14111411
14121412 self . expect_token ( & Token :: RParen ) ?;
1413- Ok ( Expr :: Function ( Function {
1413+ Ok ( Expr :: Function ( Box :: new ( Function {
14141414 name : RawItemName :: Name ( UnresolvedItemName :: unqualified ( ident ! ( "substring" ) ) ) ,
14151415 args : FunctionArgs :: args ( exprs) ,
14161416 filter : None ,
14171417 over : None ,
14181418 distinct : false ,
1419- } ) )
1419+ } ) ) )
14201420 }
14211421
14221422 /// Parse an operator reference.
@@ -1568,7 +1568,7 @@ impl<'a> Parser<'a> {
15681568 fn parse_pg_cast ( & mut self , expr : Expr < Raw > ) -> Result < Expr < Raw > , ParserError > {
15691569 Ok ( Expr :: Cast {
15701570 expr : Box :: new ( expr) ,
1571- data_type : self . parse_data_type ( ) ?,
1571+ data_type : Box :: new ( self . parse_data_type ( ) ?) ,
15721572 } )
15731573 }
15741574
@@ -7407,7 +7407,7 @@ impl<'a> Parser<'a> {
74077407 } else if self . peek_token ( ) == Some ( Token :: LParen ) {
74087408 let function =
74097409 self . parse_function ( RawItemName :: Name ( UnresolvedItemName ( id_parts) ) ) ?;
7410- Ok ( Expr :: Function ( function) )
7410+ Ok ( Expr :: Function ( Box :: new ( function) ) )
74117411 } else {
74127412 Ok ( Expr :: Identifier ( id_parts) )
74137413 }
0 commit comments