File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -1325,6 +1325,14 @@ mod test {
13251325 "macro_rules! m((a)=>(13)) fn main(){m!(a);}" . to_string ( ) ) ;
13261326 }
13271327
1328+ // should be able to use a bound identifier as a literal in a macro definition:
1329+ #[ test] fn self_macro_parsing ( ) {
1330+ expand_crate_str (
1331+ "macro_rules! foo ((zz) => (287u;))
1332+ fn f(zz : int) {foo!(zz);}" . to_string ( )
1333+ ) ;
1334+ }
1335+
13281336 // renaming tests expand a crate and then check that the bindings match
13291337 // the right varrefs. The specification of the test case includes the
13301338 // text of the crate, and also an array of arrays. Each element in the
Original file line number Diff line number Diff line change @@ -354,8 +354,7 @@ pub fn parse(sess: &ParseSess,
354354 MatchNonterminal ( _, _, _) => { bb_eis. push ( ei) }
355355 MatchTok ( ref t) => {
356356 let mut ei_t = ei. clone ( ) ;
357- //if (token_name_eq(t,&tok)) {
358- if token:: mtwt_token_eq ( t, & tok) {
357+ if token_name_eq ( t, & tok) {
359358 ei_t. idx += 1 ;
360359 next_eis. push ( ei_t) ;
361360 }
You can’t perform that action at this time.
0 commit comments