diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2018-10-30 23:42:04 -0700 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2018-10-30 23:42:36 -0700 |
| commit | ea3197aaffba00318920ed5e1e33ca5f2a5e6c5c (patch) | |
| tree | 2ec4aff13c7a54a3730994525b591ac60528b5ad /nomsu_compiler.moon | |
| parent | e7e84c9eda38c930f5475301de4a449dcf59e8b6 (diff) | |
Fully working version of (action [foo]: baz) -> ((foo) means: baz)
refactor and misc other changes.
Diffstat (limited to 'nomsu_compiler.moon')
| -rw-r--r-- | nomsu_compiler.moon | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/nomsu_compiler.moon b/nomsu_compiler.moon index 1106382..4746e10 100644 --- a/nomsu_compiler.moon +++ b/nomsu_compiler.moon @@ -264,11 +264,14 @@ with NomsuCompiler return add_lua_bits(@, "value", code) ["use 1"]: (tree, path)=> + lua = LuaCode(tree.source) if path.type == 'Text' and #path == 1 and type(path[1]) == 'string' for _,f in Files.walk(path[1]) - @import(@run_file(f)) - - return LuaCode(tree.source, "for i,f in Files.walk(", @compile(path), ") do nomsu:import(nomsu:run_file(f)) end") + if match(f, "%.lua$") or match(f, "%.nom$") or match(f, "^/dev/fd/[012]$") + @import(@run_file(f)) + if #lua.bits > 0 then lua\append "\n" + lua\append "nomsu:import(nomsu:run_file(#{f\as_lua!}))" + return lua ["tests"]: (tree)=> LuaCode.Value(tree.source, "TESTS") ["test 1"]: (tree, body)=> |
