Minor fallout/update FOLLOW sets

This commit is contained in:
Corey Richardson 2015-01-06 18:46:37 -05:00
parent ac8e10519a
commit bd4119f965
3 changed files with 18 additions and 10 deletions

View File

@ -186,12 +186,12 @@ macro_rules! write {
#[macro_export]
#[stable]
macro_rules! writeln {
($dst:expr, $fmt:expr, $($arg:tt)*) => (
write!($dst, concat!($fmt, "\n") $($arg)*)
);
($dst:expr, $fmt:expr) => (
write!($dst, concat!($fmt, "\n"))
)
);
($dst:expr, $fmt:expr, $($arg:expr),*) => (
write!($dst, concat!($fmt, "\n"), $($arg,)*)
);
}
/// A utility macro for indicating unreachable code.

View File

@ -14,16 +14,24 @@
//! they aren't defined anywhere outside of the `rt` module.
macro_rules! rterrln {
($fmt:expr $($arg:tt)*) => ( {
::rt::util::dumb_print(format_args!(concat!($fmt, "\n") $($arg)*))
($fmt:expr) => ( {
::rt::util::dumb_print(format_args!(concat!($fmt, "\n")))
} );
($fmt:expr, $($arg:expr),*) => ( {
::rt::util::dumb_print(format_args!(concat!($fmt, "\n"), $($arg)*))
} )
}
// Some basic logging. Enabled by passing `--cfg rtdebug` to the libstd build.
macro_rules! rtdebug {
($($arg:tt)*) => ( {
($arg:expr) => ( {
if cfg!(rtdebug) {
rterrln!($($arg)*)
rterrln!($arg)
}
} );
($str:expr, $($arg:expr),*) => ( {
if cfg!(rtdebug) {
rterrln!($str, $($arg)*)
}
})
}

View File

@ -422,7 +422,7 @@ fn is_in_follow(cx: &ExtCtxt, tok: &Token, frag: &str) -> bool {
},
"stmt" | "expr" => {
match *tok {
Comma | Semi => true,
FatArrow | Comma | Semi => true,
_ => false
}
},
@ -434,7 +434,7 @@ fn is_in_follow(cx: &ExtCtxt, tok: &Token, frag: &str) -> bool {
},
"path" | "ty" => {
match *tok {
Comma | RArrow | Colon | Eq | Gt => true,
Comma | FatArrow | Colon | Eq | Gt => true,
Ident(i, _) if i.as_str() == "as" => true,
_ => false
}