mirror of
https://github.com/leafo/moonscript.git
synced 2024-11-22 02:44:23 +00:00
dump tree doesn't print by default
This commit is contained in:
parent
57e4f984cb
commit
61b825fa5a
@ -74,7 +74,7 @@ compile_file_text = function(text, opts)
|
||||
end
|
||||
if opts.show_parse_tree then
|
||||
local dump = require("moonscript.dump")
|
||||
dump.tree(tree)
|
||||
print(dump.tree(tree))
|
||||
return true
|
||||
end
|
||||
local compile_time
|
||||
@ -84,7 +84,9 @@ compile_file_text = function(text, opts)
|
||||
do
|
||||
local mod = opts.transform_module
|
||||
if mod then
|
||||
tree = assert(require(mod)(tree))
|
||||
local file = assert(loadfile(mod))
|
||||
local fn = assert(file())
|
||||
tree = assert(fn(tree))
|
||||
end
|
||||
end
|
||||
local code, posmap_or_err, err_pos = compile.tree(tree)
|
||||
|
@ -78,14 +78,16 @@ compile_file_text = (text, opts={}) ->
|
||||
|
||||
if opts.show_parse_tree
|
||||
dump = require "moonscript.dump"
|
||||
dump.tree tree
|
||||
print dump.tree tree
|
||||
return true
|
||||
|
||||
compile_time = if opts.benchmark
|
||||
gettime!
|
||||
|
||||
if mod = opts.transform_module
|
||||
tree = assert require(mod) tree
|
||||
file = assert loadfile mod
|
||||
fn = assert file!
|
||||
tree = assert fn tree
|
||||
|
||||
code, posmap_or_err, err_pos = compile.tree tree
|
||||
|
||||
|
@ -32,7 +32,7 @@ tree = function(block)
|
||||
local _list_0 = block
|
||||
for _index_0 = 1, #_list_0 do
|
||||
local value = _list_0[_index_0]
|
||||
print(flat_value(value))
|
||||
flat_value(value)
|
||||
end
|
||||
end
|
||||
return {
|
||||
|
@ -12,7 +12,7 @@ value = (op) ->
|
||||
flat_value op
|
||||
|
||||
tree = (block) ->
|
||||
print flat_value value for value in *block
|
||||
flat_value value for value in *block
|
||||
|
||||
{ :value, :tree }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user