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:
parent
a0eda5bc72
commit
496a4ddafd
4 changed files with 4684 additions and 4590 deletions
|
|
@ -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 --
|
||||
----------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue