From b3443eb049d6ebcadb388f90496132cb065baed2 Mon Sep 17 00:00:00 2001 From: Paul Stansifer Date: Mon, 27 Jun 2011 10:58:05 -0700 Subject: [PATCH] '#simplext' -> '#macro' --- src/comp/front/ext.rs | 2 +- src/test/compile-fail/{simplext-2.rs => macro-2.rs} | 2 +- src/test/compile-fail/{simplext.rs => macro.rs} | 2 +- src/test/run-pass/macro-2.rs | 5 +++++ src/test/run-pass/{simplext-3.rs => macro-3.rs} | 2 +- src/test/run-pass/{simplext.rs => macro.rs} | 2 +- src/test/run-pass/simplext-2.rs | 5 ----- 7 files changed, 10 insertions(+), 10 deletions(-) rename src/test/compile-fail/{simplext-2.rs => macro-2.rs} (58%) rename src/test/compile-fail/{simplext.rs => macro.rs} (78%) create mode 100644 src/test/run-pass/macro-2.rs rename src/test/run-pass/{simplext-3.rs => macro-3.rs} (56%) rename src/test/run-pass/{simplext.rs => macro.rs} (59%) delete mode 100644 src/test/run-pass/simplext-2.rs diff --git a/src/comp/front/ext.rs b/src/comp/front/ext.rs index 34b60d4668f..e4562f2f640 100644 --- a/src/comp/front/ext.rs +++ b/src/comp/front/ext.rs @@ -22,7 +22,7 @@ fn syntax_expander_table() -> hashmap[str, syntax_extension] { auto syntax_expanders = new_str_hash[syntax_extension](); syntax_expanders.insert("fmt", normal(extfmt::expand_syntax_ext)); syntax_expanders.insert("env", normal(extenv::expand_syntax_ext)); - syntax_expanders.insert("simplext", + syntax_expanders.insert("macro", macro_defining(extsimplext::add_new_extension)); ret syntax_expanders; } diff --git a/src/test/compile-fail/simplext-2.rs b/src/test/compile-fail/macro-2.rs similarity index 58% rename from src/test/compile-fail/simplext-2.rs rename to src/test/compile-fail/macro-2.rs index f833d87c8a0..c2a706228c9 100644 --- a/src/test/compile-fail/simplext-2.rs +++ b/src/test/compile-fail/macro-2.rs @@ -1,6 +1,6 @@ //error-pattern:expanded as an identifier fn main() { - #simplext("mylambda", x, body, {fn f(int x) -> int {ret body}; f}); + #macro("mylambda", x, body, {fn f(int x) -> int {ret body}; f}); assert(#mylambda(y*1, y*2)(8) == 16); } \ No newline at end of file diff --git a/src/test/compile-fail/simplext.rs b/src/test/compile-fail/macro.rs similarity index 78% rename from src/test/compile-fail/simplext.rs rename to src/test/compile-fail/macro.rs index 953f97d0581..b69ad18cda0 100644 --- a/src/test/compile-fail/simplext.rs +++ b/src/test/compile-fail/macro.rs @@ -1,7 +1,7 @@ //error-pattern:expects 0 arguments, got 16 fn main() { - #simplext("trivial", 1*2*4*2*1); + #macro("trivial", 1*2*4*2*1); assert(#trivial(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16) == 16); } diff --git a/src/test/run-pass/macro-2.rs b/src/test/run-pass/macro-2.rs new file mode 100644 index 00000000000..a75d6707455 --- /dev/null +++ b/src/test/run-pass/macro-2.rs @@ -0,0 +1,5 @@ +fn main() { + #macro("mylambda", x, body, {fn f(int x) -> int {ret body}; f}); + + assert(#mylambda(y,y*2)(8) == 16); +} \ No newline at end of file diff --git a/src/test/run-pass/simplext-3.rs b/src/test/run-pass/macro-3.rs similarity index 56% rename from src/test/run-pass/simplext-3.rs rename to src/test/run-pass/macro-3.rs index ad1b10a0052..aa9169ed126 100644 --- a/src/test/run-pass/simplext-3.rs +++ b/src/test/run-pass/macro-3.rs @@ -1,5 +1,5 @@ fn main() { - #simplext("trivial", 1*2*4*2*1); + #macro("trivial", 1*2*4*2*1); assert(#trivial() == 16); } diff --git a/src/test/run-pass/simplext.rs b/src/test/run-pass/macro.rs similarity index 59% rename from src/test/run-pass/simplext.rs rename to src/test/run-pass/macro.rs index 9ca42e8c8fe..77ff122e7c6 100644 --- a/src/test/run-pass/simplext.rs +++ b/src/test/run-pass/macro.rs @@ -1,4 +1,4 @@ fn main() { - #simplext("m1", a, a*4); + #macro("m1", a, a*4); assert (#m1(2) == 8); } \ No newline at end of file diff --git a/src/test/run-pass/simplext-2.rs b/src/test/run-pass/simplext-2.rs deleted file mode 100644 index c15d63e2e88..00000000000 --- a/src/test/run-pass/simplext-2.rs +++ /dev/null @@ -1,5 +0,0 @@ -fn main() { - #simplext("mylambda", x, body, {fn f(int x) -> int {ret body}; f}); - - assert(#mylambda(y,y*2)(8) == 16); -} \ No newline at end of file