about | join |
login
5%
“require 'walk'

function weave_ast (src, ast, name)
local ast_children, weaveable, node_cfg = { }, { }, { }

function node_cfg.down(ast, parent)
if not ast.lineinfo
then weaveable [parent] = nil
else weaveable [ast] = true end
ast_children [ast] = { }
if parent then table.insert (ast_children [parent], ast) end
end

local cfg = { expr=node_cfg; stat=node_cfg; block=node_cfg }
walk.block (cfg, ast)
end

local src = ???
local ast = mlc.luastring_to_ast (src, name)
weave_ast (src, ast)” source...
posted 1 month ago in programming, code1 view | 1 jaa | reply )

about | blog | faq | privacy

© 2008 jaanix, inc.