str should be used instead of the string literal 'hello'.
Workaround
This works as intended if you write it with the parameter. This is just a typo.
##[[
-- create a macro that injects a custom node when called
local function print_macro(str)
local node = aster.Call{{aster.String{str}}, aster.Id{"print"}}
-- inject the node where this macro is being called from
inject_astnode(node)
end
]]
## print_macro('hello (again)')
Expected behavior
str
should be used instead of the string literal 'hello'.Workaround
This works as intended if you write it with the parameter. This is just a typo.
Output: