0
0
mirror of https://github.com/rust-lang/rust.git synced 2024-12-01 13:18:54 +01:00

'#simplext' -> '#macro'

This commit is contained in:
Paul Stansifer 2011-06-27 10:58:05 -07:00 committed by Graydon Hoare
parent c3901cdf8e
commit b3443eb049
7 changed files with 10 additions and 10 deletions

View File

@ -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;
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -1,5 +1,5 @@
fn main() {
#simplext("trivial", 1*2*4*2*1);
#macro("trivial", 1*2*4*2*1);
assert(#trivial() == 16);
}

View File

@ -1,4 +1,4 @@
fn main() {
#simplext("m1", a, a*4);
#macro("m1", a, a*4);
assert (#m1(2) == 8);
}

View File

@ -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);
}