2018-08-17 22:03:47 -05:00
|
|
|
let simplemacro = macro(arg1, arg2, arg3) => {
|
|
|
|
field1 = arg1,
|
|
|
|
field2 = arg2,
|
|
|
|
field3 = arg3,
|
|
|
|
};
|
|
|
|
|
|
|
|
let cplxmacro = macro(argint, argstr, argfloat) => {
|
|
|
|
field1 = argint + 1,
|
|
|
|
field2 = argstr + " are here",
|
|
|
|
field3 = argfloat - 1.0,
|
|
|
|
};
|
|
|
|
|
|
|
|
let simpleresult = simplemacro(1, 2, 3);
|
|
|
|
let cplxresult = cplxmacro(1, "We", 3.0);
|
|
|
|
|
2018-08-20 22:51:55 -05:00
|
|
|
assert |simpleresult.field1 == 1|;
|
|
|
|
assert |simpleresult.field2 == 2|;
|
|
|
|
assert |simpleresult.field3 == 3|;
|
2018-08-17 22:03:47 -05:00
|
|
|
|
2018-08-20 22:51:55 -05:00
|
|
|
assert |cplxresult.field1 == 2|;
|
|
|
|
assert |cplxresult.field2 == "We are here"|;
|
|
|
|
assert |cplxresult.field3 == 2.0|;
|