We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The compiler can't generate code with statement replacement macros inside a loop unrolling scope
## local function macrox(x) print(#[x]#) ## end ## for i = 1, 20 do #[macrox]#(10) ## end
output:
$ nelua test.nelua test.nelua:7:3: error: cannot convert preprocess value of type "function" to an AST node #[macrox]#(10) ^~~~~~~~~~
The same behaviour as repeating the code manually.
Wrap the statement replacement macro with a runtime function:
## local function macrox(x) print(#[x]#) ## end local function macro_x(x: auto) #[macrox]#(x) end ## for i = 1, 20 do macro_x(10) ## end
Provide relevant information about your environment:
0.2.0-dev.1365+e6a91c19
The text was updated successfully, but these errors were encountered:
Fix replacement macro evaluation in loops, fixes issue #131
7096f16
You have discovered a flaw in the replacement macro system, thanks for reporting this. I've fixed in commit 7096f16
Sorry, something went wrong.
No branches or pull requests
Bug description
The compiler can't generate code with statement replacement macros inside a loop unrolling scope
Code example
output:
Expected behavior
The same behaviour as repeating the code manually.
Workaround
Wrap the statement replacement macro with a runtime function:
Environment
Provide relevant information about your environment:
0.2.0-dev.1365+e6a91c19
The text was updated successfully, but these errors were encountered: