Skip to content

Commit 2474c36

Browse files
---
yaml --- r: 175582 b: refs/heads/auto c: 3c37a95 h: refs/heads/master v: v3
1 parent 579fe98 commit 2474c36

File tree

2 files changed

+44
-44
lines changed

2 files changed

+44
-44
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1010
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1111
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1212
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
13-
refs/heads/auto: c821e5c915f886f496d877e267f5a83a7096501f
13+
refs/heads/auto: 3c37a952e738e4fe608a7870a751bbe96d9250e0
1414
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1515
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1616
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/libsyntax/ext/tt/macro_rules.rs

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -413,48 +413,48 @@ fn check_matcher<'a, I>(cx: &mut ExtCtxt, matcher: I, follow: &Token)
413413

414414
fn is_in_follow(_: &ExtCtxt, tok: &Token, frag: &str) -> Result<bool, String> {
415415
if let &CloseDelim(_) = tok {
416-
return Ok(true);
416+
Ok(true)
417+
} else {
418+
match frag {
419+
"item" => {
420+
// since items *must* be followed by either a `;` or a `}`, we can
421+
// accept anything after them
422+
Ok(true)
423+
},
424+
"block" => {
425+
// anything can follow block, the braces provide a easy boundary to
426+
// maintain
427+
Ok(true)
428+
},
429+
"stmt" | "expr" => {
430+
match *tok {
431+
FatArrow | Comma | Semi => Ok(true),
432+
_ => Ok(false)
433+
}
434+
},
435+
"pat" => {
436+
match *tok {
437+
FatArrow | Comma | Eq => Ok(true),
438+
_ => Ok(false)
439+
}
440+
},
441+
"path" | "ty" => {
442+
match *tok {
443+
Comma | FatArrow | Colon | Eq | Gt => Ok(true),
444+
Ident(i, _) if i.as_str() == "as" => Ok(true),
445+
_ => Ok(false)
446+
}
447+
},
448+
"ident" => {
449+
// being a single token, idents are harmless
450+
Ok(true)
451+
},
452+
"meta" | "tt" => {
453+
// being either a single token or a delimited sequence, tt is
454+
// harmless
455+
Ok(true)
456+
},
457+
_ => Err(format!("unrecognized builtin nonterminal `{}`", frag))
458+
}
417459
}
418-
419-
Ok(match frag {
420-
"item" => {
421-
// since items *must* be followed by either a `;` or a `}`, we can
422-
// accept anything after them
423-
true
424-
},
425-
"block" => {
426-
// anything can follow block, the braces provide a easy boundary to
427-
// maintain
428-
true
429-
},
430-
"stmt" | "expr" => {
431-
match *tok {
432-
FatArrow | Comma | Semi => true,
433-
_ => false
434-
}
435-
},
436-
"pat" => {
437-
match *tok {
438-
FatArrow | Comma | Eq => true,
439-
_ => false
440-
}
441-
},
442-
"path" | "ty" => {
443-
match *tok {
444-
Comma | FatArrow | Colon | Eq | Gt => true,
445-
Ident(i, _) if i.as_str() == "as" => true,
446-
_ => false
447-
}
448-
},
449-
"ident" => {
450-
// being a single token, idents are harmless
451-
true
452-
},
453-
"meta" | "tt" => {
454-
// being either a single token or a delimited sequence, tt is
455-
// harmless
456-
true
457-
},
458-
_ => return Err(format!("unrecognized builtin nonterminal `{}`", frag)),
459-
})
460460
}

0 commit comments

Comments
 (0)