Skip to content
New issue

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

Typo: macro example code doesn't use its parameter #214

Closed
RaycatWhoDat opened this issue May 8, 2023 · 1 comment
Closed

Typo: macro example code doesn't use its parameter #214

RaycatWhoDat opened this issue May 8, 2023 · 1 comment
Labels

Comments

@RaycatWhoDat
Copy link

Screenshot

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.

##[[
-- 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)')

Output:

print('hello (again)')
edubart added a commit that referenced this issue Jul 1, 2023
@edubart
Copy link
Owner

edubart commented Jul 1, 2023

Fixed.

@edubart edubart closed this as completed Jul 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants