LYR-PAR0063
'quote' without a block
The word quote is not followed by {.
Explanation
A quote is code written as a value, in braces: quote { a + b }, quote { fn f(): void { } }. Without the braces it holds nothing.
Write the quoted code in braces.
Wrong
//- src/main.lyr
import app.macros { one };
fn main(): void {
let _ = one!();
}
//- src/macros.lyr
import std.syntax { Expr };
pub macro one(): Expr {
return quote;
}
Right
//- src/main.lyr
import app.macros { one };
fn main(): void {
let _ = one!();
}
//- src/macros.lyr
import std.syntax { Expr };
pub macro one(): Expr {
return quote { 1 };
}