Change syntax of rc macro

This commit is contained in:
greg 2017-09-13 22:47:25 -07:00
parent 1d9e5edfba
commit 1a3076a949

View File

@ -648,7 +648,7 @@ mod parse_tests {
use super::ParseError; use super::ParseError;
macro_rules! rc { macro_rules! rc {
($string:expr) => { Rc::new($string.to_string()) } ($string:tt) => { Rc::new(stringify!($string).to_string()) }
} }
macro_rules! parse_test { macro_rules! parse_test {
@ -707,6 +707,6 @@ mod parse_tests {
#[test] #[test]
fn parsing_types() { fn parsing_types() {
parse_test!("type Yolo = Yolo", AST(vec![Declaration(TypeDecl(rc!("Yolo"), TypeBody(vec![Variant::Singleton(rc!("Yolo"))])))])); parse_test!("type Yolo = Yolo", AST(vec![Declaration(TypeDecl(rc!(Yolo), TypeBody(vec![Variant::Singleton(rc!(Yolo))])))]));
} }
} }