docs

You are reading the docs for v0.1.0. Nabi 0.1.0 is no longer supported. Latest release: v0.1.3 →

#E0120: recursive expansion

A macro or meta block expands into itself, directly or through others, without end. Break the cycle.

nabi
#[impl_macro(again)] @macro {
    ( @e: expr ) => { again!(@e) }
}
let x = again!(1);
error[E0120]: `again!` expands too deeply or cyclically
  --> main.nabi:4:9
   |
 4 | let x = again!(1);
   |         ^^^^^

Make the template expand to code that does not call the macro again:

nabi
#[impl_macro(again)] @macro {
    ( @e: expr ) => { (@e, @e) }
}
let x = again!(1);
println(f"{x.0}");
1

Related: E0117 no macro rule matches, E0118 invalid meta template

Found a mistake? Edit this page on GitHub. Last updated