-
Notifications
You must be signed in to change notification settings - Fork 61
Open
Description
If I follow the document http://metalua.luaforge.net/manual004.html#toc9 to write an ast walker, such as
local cfg = { expr = { },
stat = { },
block = { } }
cfg.expr.down = function(x) ... end
walk.guess(cfg, term)The walker doesn't work. The function returned by walker_builder() in walk.mlua cannot get the correct cfg up/down functions from the input cfg.
The below changes can fix it.
208c208,209
< local down, up = cfg.down, cfg.up
---
> local cfgt = cfg[traverse]
> local down, up = cfgt and cfgt.down, cfgt and cfgt.up
However, I found the current treequery.mlua will use cfg's first level methods. It seems the issue is still caused by some refactoring inconsistence.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels