aboutsummaryrefslogtreecommitdiff
path: root/nomsu.lua
diff options
context:
space:
mode:
authorBruce Hill <bitbucket@bruce-hill.com>2018-07-17 16:13:35 -0700
committerBruce Hill <bitbucket@bruce-hill.com>2018-07-17 16:13:55 -0700
commitcbd143775295cca490b09eae37c1766389da5edf (patch)
tree74a89c6a15173de43fc89ae8632162a37525f716 /nomsu.lua
parent39a0121856f8230332bcef1b6a7108696f2a765d (diff)
Optimization/simplification pass.
Diffstat (limited to 'nomsu.lua')
-rw-r--r--nomsu.lua34
1 files changed, 18 insertions, 16 deletions
diff --git a/nomsu.lua b/nomsu.lua
index 0f22eff..3ca85b5 100644
--- a/nomsu.lua
+++ b/nomsu.lua
@@ -144,7 +144,7 @@ run = function()
if not (files.exists(f)) then
error("Could not find: " .. tostring(f))
end
- for filename in files.walk(f) do
+ for _, filename in files.walk(f) do
input_files[filename] = true
end
end
@@ -228,7 +228,7 @@ run = function()
local parse_errs = { }
for _index_0 = 1, #file_queue do
local f = file_queue[_index_0]
- for filename in files.walk(f) do
+ for _, filename in files.walk(f) do
local _continue_0 = false
repeat
if not (filename == "stdin" or filename:match("%.nom$")) then
@@ -323,18 +323,20 @@ say ".."
end
end
end
-local debugger
-if args.debugger == "nil" then
- debugger = { }
-else
- debugger = require(args.debugger or 'error_handling')
-end
-local guard
-if type(debugger) == 'function' then
- guard = debugger
-else
- guard = debugger.guard or debugger.call or debugger.wrap or debugger.run or (function(fn)
- return fn()
- end)
+do
+ local debugger
+ if args.debugger == "nil" then
+ debugger = { }
+ else
+ debugger = require(args.debugger or 'error_handling')
+ end
+ local guard
+ if type(debugger) == 'function' then
+ guard = debugger
+ else
+ guard = debugger.guard or debugger.call or debugger.wrap or debugger.run or (function(fn)
+ return fn()
+ end)
+ end
+ return guard(run)
end
-return guard(run)