@@ -1002,6 +1002,26 @@ impl<'a> Parser<'a> {
1002
1002
Ok ( ( result, trailing) )
1003
1003
}
1004
1004
1005
+ fn parse_delim_comma_seq < T > (
1006
+ & mut self ,
1007
+ delim : DelimToken ,
1008
+ f : impl FnMut ( & mut Parser < ' a > ) -> PResult < ' a , T > ,
1009
+ ) -> PResult < ' a , ( Vec < T > , bool ) > {
1010
+ self . parse_unspanned_seq (
1011
+ & token:: OpenDelim ( delim) ,
1012
+ & token:: CloseDelim ( delim) ,
1013
+ SeqSep :: trailing_allowed ( token:: Comma ) ,
1014
+ f,
1015
+ )
1016
+ }
1017
+
1018
+ fn parse_paren_comma_seq < T > (
1019
+ & mut self ,
1020
+ f : impl FnMut ( & mut Parser < ' a > ) -> PResult < ' a , T > ,
1021
+ ) -> PResult < ' a , ( Vec < T > , bool ) > {
1022
+ self . parse_delim_comma_seq ( token:: Paren , f)
1023
+ }
1024
+
1005
1025
/// Advance the parser by one token
1006
1026
pub fn bump ( & mut self ) {
1007
1027
if self . prev_token_kind == PrevTokenKind :: Eof {
@@ -2628,6 +2648,10 @@ impl<'a> Parser<'a> {
2628
2648
return Ok ( e) ;
2629
2649
}
2630
2650
2651
+ fn parse_paren_expr_seq ( & mut self ) -> PResult < ' a , Vec < P < Expr > > > {
2652
+ self . parse_paren_comma_seq ( |p| p. parse_expr ( ) ) . map ( |( r, _) | r)
2653
+ }
2654
+
2631
2655
crate fn process_potential_macro_variable ( & mut self ) {
2632
2656
self . token = match self . token . kind {
2633
2657
token:: Dollar if self . token . span . ctxt ( ) != SyntaxContext :: empty ( ) &&
0 commit comments