diff --git a/src/core/compile.c b/src/core/compile.c index 8ab0e3a2..4f45ff1f 100644 --- a/src/core/compile.c +++ b/src/core/compile.c @@ -746,12 +746,14 @@ static int macroexpand1( int lock = janet_gclock(); Janet mf_kw = janet_ckeywordv("macro-form"); janet_table_put(c->env, mf_kw, x); + Janet ml_kw = janet_ckeywordv("macro-lints"); + if (c->lints) { + janet_table_put(c->env, ml_kw, janet_wrap_array(c->lints)); + } Janet tempOut; JanetSignal status = janet_continue(fiberp, janet_wrap_nil(), &tempOut); janet_table_put(c->env, mf_kw, janet_wrap_nil()); - if (c->lints) { - janet_table_put(c->env, janet_ckeywordv("macro-lints"), janet_wrap_array(c->lints)); - } + janet_table_put(c->env, ml_kw, janet_wrap_nil()); janet_gcunlock(lock); if (status != JANET_SIGNAL_OK) { const uint8_t *es = janet_formatc("(macro) %V", tempOut); diff --git a/test/suite-boot.janet b/test/suite-boot.janet index 49a022cb..6282a212 100644 --- a/test/suite-boot.janet +++ b/test/suite-boot.janet @@ -877,5 +877,11 @@ (assert (= (thunk) 1) "delay 3") (assert (= counter 1) "delay 4") -(end-suite) +# maclintf +(def env (table/clone (curenv))) +((compile '(defmacro foo [] (maclintf :strict "oops")) env :anonymous)) +(def lints @[]) +(compile (tuple/setmap '(foo) 1 2) env :anonymous lints) +(assert (deep= lints @[[:strict 1 2 "oops"]]) "maclintf 1") +(end-suite)