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] #[macro_export]
#[stable] #[stable]
macro_rules! writeln { macro_rules! writeln {
($dst:expr, $fmt:expr, $($arg:tt)*) => (
write!($dst, concat!($fmt, "\n") $($arg)*)
);
($dst:expr, $fmt:expr) => ( ($dst:expr, $fmt:expr) => (
write!($dst, concat!($fmt, "\n")) write!($dst, concat!($fmt, "\n"))
) );
($dst:expr, $fmt:expr, $($arg:expr),*) => (
write!($dst, concat!($fmt, "\n"), $($arg,)*)
);
} }
/// A utility macro for indicating unreachable code. /// A utility macro for indicating unreachable code.

View File

@ -14,16 +14,24 @@
//! they aren't defined anywhere outside of the `rt` module. //! they aren't defined anywhere outside of the `rt` module.
macro_rules! rterrln { macro_rules! rterrln {
($fmt:expr $($arg:tt)*) => ( { ($fmt:expr) => ( {
::rt::util::dumb_print(format_args!(concat!($fmt, "\n") $($arg)*)) ::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. // Some basic logging. Enabled by passing `--cfg rtdebug` to the libstd build.
macro_rules! rtdebug { macro_rules! rtdebug {
($($arg:tt)*) => ( { ($arg:expr) => ( {
if cfg!(rtdebug) { 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" => { "stmt" | "expr" => {
match *tok { match *tok {
Comma | Semi => true, FatArrow | Comma | Semi => true,
_ => false _ => false
} }
}, },
@ -434,7 +434,7 @@ fn is_in_follow(cx: &ExtCtxt, tok: &Token, frag: &str) -> bool {
}, },
"path" | "ty" => { "path" | "ty" => {
match *tok { match *tok {
Comma | RArrow | Colon | Eq | Gt => true, Comma | FatArrow | Colon | Eq | Gt => true,
Ident(i, _) if i.as_str() == "as" => true, Ident(i, _) if i.as_str() == "as" => true,
_ => false _ => false
} }