1
0
Fork 0
mirror of https://github.com/Reuh/candran.git synced 2025-10-27 17:59:30 +00:00

Add support for macro replacement using Lua functions

This commit is contained in:
Étienne Fildadut 2021-06-11 13:46:31 +02:00
parent a0eda5bc72
commit 496a4ddafd
4 changed files with 4684 additions and 4590 deletions

View file

@ -199,6 +199,17 @@ x = f(x)
return x
]], 42)
test("preprocessor macro replace variable with function", [[
#define("a", function() return "42" end)
return a
]], 42)
test("preprocessor macro replace function with function", [[
#define("test(x)", function(x) return ("%s = 42"):format(x) end)
test(hello)
return hello
]], 42)
----------------------
-- SYNTAX ADDITIONS --
----------------------