syntax: Allow semi tokens after macro ty/path
This commit expands the follow set of the `ty` and `path` macro fragments to
include the semicolon token as well. A semicolon is already allowed after these
tokens, so it's currently a little too restrictive to not have a semicolon
allowed. For example:
extern {
fn foo() -> i32; // semicolon after type
}
fn main() {
struct Foo;
Foo; // semicolon after path
}
This commit is contained in:
parent
adcae006d2
commit
af556238eb
2 changed files with 18 additions and 1 deletions
|
|
@ -501,7 +501,7 @@ fn is_in_follow(_: &ExtCtxt, tok: &Token, frag: &str) -> Result<bool, String> {
|
|||
},
|
||||
"path" | "ty" => {
|
||||
match *tok {
|
||||
Comma | FatArrow | Colon | Eq | Gt => Ok(true),
|
||||
Comma | FatArrow | Colon | Eq | Gt | Semi => Ok(true),
|
||||
Ident(i, _) if i.as_str() == "as" => Ok(true),
|
||||
_ => Ok(false)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue