Skip to content

Commit

Permalink
Minor fallout/update FOLLOW sets
Browse files Browse the repository at this point in the history
  • Loading branch information
emberian committed Jan 6, 2015
1 parent ac8e105 commit bd4119f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
8 changes: 4 additions & 4 deletions src/libcore/macros.rs
Expand Up @@ -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.
Expand Down
16 changes: 12 additions & 4 deletions src/libstd/rt/macros.rs
Expand Up @@ -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)*)
}
})
}
Expand Down
4 changes: 2 additions & 2 deletions src/libsyntax/ext/tt/macro_rules.rs
Expand Up @@ -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
}
},
Expand All @@ -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
}
Expand Down

0 comments on commit bd4119f

Please sign in to comment.