Skip to content

Commit b405ab4

Browse files
---
yaml --- r: 182518 b: refs/heads/beta c: 3c37a95 h: refs/heads/master v: v3
1 parent 55a6634 commit b405ab4

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
@@ -31,7 +31,7 @@ refs/heads/automation-fail: 1bf06495443584539b958873e04cc2f864ab10e4
3131
refs/heads/issue-18208-method-dispatch-3-quick-reject: 2009f85b9f99dedcec4404418eda9ddba90258a2
3232
refs/heads/batch: b7fd822592a4fb577552d93010c4a4e14f314346
3333
refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
34-
refs/heads/beta: c821e5c915f886f496d877e267f5a83a7096501f
34+
refs/heads/beta: 3c37a952e738e4fe608a7870a751bbe96d9250e0
3535
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3636
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
3737
refs/heads/tmp: eb836bf767aa1d8d4cba488a9091cde3c0ab4b2f

branches/beta/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)