aboutsummaryrefslogtreecommitdiff
path: root/nomsu.moon
diff options
context:
space:
mode:
authorBruce Hill <bitbucket@bruce-hill.com>2017-09-21 14:11:34 -0700
committerBruce Hill <bitbucket@bruce-hill.com>2017-09-21 14:11:34 -0700
commit4fd6b61a0074ea69f0ce3e11768e867d355307ac (patch)
tree0a2f80fc106f0dbc334e1c338d0900906e34723e /nomsu.moon
parent79ad6b07c1aa5f32b7d8481f2937fa02680c2937 (diff)
Fixed bug that caused files to get reloaded if they returned nil.
Diffstat (limited to 'nomsu.moon')
-rwxr-xr-xnomsu.moon6
1 files changed, 5 insertions, 1 deletions
diff --git a/nomsu.moon b/nomsu.moon
index ca888a8..6dce00b 100755
--- a/nomsu.moon
+++ b/nomsu.moon
@@ -548,7 +548,7 @@ class NomsuCompiler
file = io.open(vars.filename)
if not file
@error "File does not exist: #{vars.filename}"
- @loaded_files[vars.filename] = @run(file\read('*a'), vars.filename)
+ @loaded_files[vars.filename] = (@run(file\read('*a'), vars.filename)) or true
return @loaded_files[vars.filename]
@def "run file %filename", (vars)=>
@@ -561,6 +561,8 @@ class NomsuCompiler
-- Run on the command line via "./nomsu.moon input_file.nom" to execute
-- and "./nomsu.moon input_file.nom output_file.lua" to compile (use "-" to compile to stdout)
if arg and arg[1]
+ --ProFi = require 'ProFi'
+ --ProFi\start()
c = NomsuCompiler()
input = io.open(arg[1])\read("*a")
-- If run via "./nomsu.moon file.nom -", then silence output and print generated
@@ -586,6 +588,8 @@ if arg and arg[1]
local c = NomsuCompiler()
return load()(c, {})
]]
+ --ProFi\stop()
+ --ProFi\writeReport( 'MyProfilingReport.txt' )
elseif arg
-- REPL: