From f19d0b70994eced1338bc9f2667d9e95e74400d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustav=20S=C3=B6rn=C3=A4s?= Date: Fri, 19 Feb 2021 18:39:28 +0100 Subject: better link! --- src/main.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index bc68d40..f7d1fbf 100644 --- a/src/main.rs +++ b/src/main.rs @@ -7,10 +7,18 @@ struct Args { print: bool, } +macro_rules! link { + ([ $( $ident:tt ),* ]) => { + vec![ + $( (stringify!($ident).to_string(), $ident), )* + ] + } +} + fn main() { let args = parse_args(); let file = args.file.unwrap_or_else(|| Path::new("progs/tests/simple.sy").to_owned()); - let errs = match run_file(&file, args.print, vec![(String::from("extern_test"), extern_test)]) { + let errs = match run_file(&file, args.print, link!([extern_test])) { Err(it) => it, _ => return, }; -- cgit v1.2.1