@@ -327,55 +327,55 @@ pub fn expand_quote_expr<'cx>(cx: &'cx mut ExtCtxt,
327
327
sp : Span ,
328
328
tts : & [ ast:: TokenTree ] )
329
329
-> Box < base:: MacResult +' cx > {
330
- let expanded = expand_parse_call ( cx, sp, "parse_expr " , vec ! ( ) , tts) ;
330
+ let expanded = expand_parse_call ( cx, sp, "parse_expr_panic " , vec ! ( ) , tts) ;
331
331
base:: MacEager :: expr ( expanded)
332
332
}
333
333
334
334
pub fn expand_quote_item < ' cx > ( cx : & mut ExtCtxt ,
335
335
sp : Span ,
336
336
tts : & [ ast:: TokenTree ] )
337
337
-> Box < base:: MacResult +' cx > {
338
- let expanded = expand_parse_call ( cx, sp, "parse_item " , vec ! ( ) , tts) ;
338
+ let expanded = expand_parse_call ( cx, sp, "parse_item_panic " , vec ! ( ) , tts) ;
339
339
base:: MacEager :: expr ( expanded)
340
340
}
341
341
342
342
pub fn expand_quote_pat < ' cx > ( cx : & ' cx mut ExtCtxt ,
343
343
sp : Span ,
344
344
tts : & [ ast:: TokenTree ] )
345
345
-> Box < base:: MacResult +' cx > {
346
- let expanded = expand_parse_call ( cx, sp, "parse_pat " , vec ! ( ) , tts) ;
346
+ let expanded = expand_parse_call ( cx, sp, "parse_pat_panic " , vec ! ( ) , tts) ;
347
347
base:: MacEager :: expr ( expanded)
348
348
}
349
349
350
350
pub fn expand_quote_arm ( cx : & mut ExtCtxt ,
351
351
sp : Span ,
352
352
tts : & [ ast:: TokenTree ] )
353
353
-> Box < base:: MacResult +' static > {
354
- let expanded = expand_parse_call ( cx, sp, "parse_arm " , vec ! ( ) , tts) ;
354
+ let expanded = expand_parse_call ( cx, sp, "parse_arm_panic " , vec ! ( ) , tts) ;
355
355
base:: MacEager :: expr ( expanded)
356
356
}
357
357
358
358
pub fn expand_quote_ty ( cx : & mut ExtCtxt ,
359
359
sp : Span ,
360
360
tts : & [ ast:: TokenTree ] )
361
361
-> Box < base:: MacResult +' static > {
362
- let expanded = expand_parse_call ( cx, sp, "parse_ty " , vec ! ( ) , tts) ;
362
+ let expanded = expand_parse_call ( cx, sp, "parse_ty_panic " , vec ! ( ) , tts) ;
363
363
base:: MacEager :: expr ( expanded)
364
364
}
365
365
366
366
pub fn expand_quote_stmt ( cx : & mut ExtCtxt ,
367
367
sp : Span ,
368
368
tts : & [ ast:: TokenTree ] )
369
369
-> Box < base:: MacResult +' static > {
370
- let expanded = expand_parse_call ( cx, sp, "parse_stmt " , vec ! ( ) , tts) ;
370
+ let expanded = expand_parse_call ( cx, sp, "parse_stmt_panic " , vec ! ( ) , tts) ;
371
371
base:: MacEager :: expr ( expanded)
372
372
}
373
373
374
374
pub fn expand_quote_attr ( cx : & mut ExtCtxt ,
375
375
sp : Span ,
376
376
tts : & [ ast:: TokenTree ] )
377
377
-> Box < base:: MacResult +' static > {
378
- let expanded = expand_parse_call ( cx, sp, "parse_attribute " ,
378
+ let expanded = expand_parse_call ( cx, sp, "parse_attribute_panic " ,
379
379
vec ! ( cx. expr_bool( sp, true ) ) , tts) ;
380
380
381
381
base:: MacEager :: expr ( expanded)
@@ -694,7 +694,7 @@ fn parse_arguments_to_quote(cx: &ExtCtxt, tts: &[ast::TokenTree])
694
694
let mut p = cx. new_parser_from_tts ( tts) ;
695
695
p. quote_depth += 1 ;
696
696
697
- let cx_expr = p . parse_expr ( ) ;
697
+ let cx_expr = panictry ! ( p . parse_expr_nopanic ( ) ) ;
698
698
if !panictry ! ( p. eat( & token:: Comma ) ) {
699
699
panic ! ( p. fatal( "expected token `,`" ) ) ;
700
700
}
0 commit comments