Move rc! macro to util
So it can be used anywhere
This commit is contained in:
parent
98db60498a
commit
956353cd80
@ -30,8 +30,10 @@ macro_rules! bx {
|
||||
}
|
||||
|
||||
#[macro_use]
|
||||
mod typechecking;
|
||||
mod util;
|
||||
#[macro_use]
|
||||
mod typechecking;
|
||||
|
||||
mod tokenizing;
|
||||
mod ast;
|
||||
mod parsing;
|
||||
|
@ -1138,9 +1138,6 @@ mod parse_tests {
|
||||
parser.parse()
|
||||
}
|
||||
|
||||
macro_rules! rc {
|
||||
($string:tt) => { Rc::new(stringify!($string).to_string()) }
|
||||
}
|
||||
macro_rules! parse_test {
|
||||
($string:expr, $correct:expr) => { assert_eq!(parse($string).unwrap(), $correct) };
|
||||
}
|
||||
|
@ -202,7 +202,7 @@ mod symbol_table_tests {
|
||||
|
||||
#[test]
|
||||
fn basic_symbol_table() {
|
||||
values_in_table! { "let a = 10; fn b() { 20 }", &Rc::new("b".to_string()) };
|
||||
values_in_table! { "let a = 10; fn b() { 20 }", &rc!(b) };
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -47,3 +47,7 @@ pub fn quick_ast(input: &str) -> crate::ast::AST {
|
||||
let mut parser = crate::parsing::Parser::new(tokens);
|
||||
parser.parse().unwrap()
|
||||
}
|
||||
|
||||
macro_rules! rc {
|
||||
($string:tt) => { Rc::new(stringify!($string).to_string()) }
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user