From ae4670bd8e0e45985e43402f246e4219cd29fcaa Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sat, 21 Jul 2018 14:43:49 -0700 Subject: Improvements working towards better inline tests. Improved handling of file spoofing and adding -e command line flag for executing a string. --- lib/os.nom | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'lib') diff --git a/lib/os.nom b/lib/os.nom index a797d2b..1f8d6a7 100644 --- a/lib/os.nom +++ b/lib/os.nom @@ -5,7 +5,7 @@ use "core" action [path of Nomsu file %filename]: - lua> "for i,f in files.walk(\%filename) do return f end" + lua> "for i,f in Files.walk(\%filename) do return f end" barf "Could not find file: \%filename" action [sh> %cmd]: @@ -15,10 +15,10 @@ action [sh> %cmd]: result:close() return contents -action [read file %filename] (=lua "files.read(\%filename)") +action [read file %filename] (=lua "Files.read(\%filename)") compile [for file %f in %path %body] to (..) Lua ".." - for i,\(%f as lua expr) in files.walk(\(%path as lua expr)) do + for i,\(%f as lua expr) in Files.walk(\(%path as lua expr)) do \(%body as lua statements) \(compile as (===next %f ===)) end @@ -28,7 +28,7 @@ compile [%expr for file %f in %path] to (..) Lua value ".." (function() local ret = list{} - for i,\(%f as lua expr) in files.walk(\(%path as lua expr)) do + for i,\(%f as lua expr) in Files.walk(\(%path as lua expr)) do ret[#ret+1] = \(%expr as lua statements) end return ret @@ -43,5 +43,5 @@ action [..] file:write(\%text) file:close() -action [line number of %pos in %str] (=lua "files.get_line_number(\%str, \%pos)") -action [line %line_num in %str] (=lua "files.get_line(\%str, \%line_num)") \ No newline at end of file +action [line number of %pos in %str] (=lua "Files.get_line_number(\%str, \%pos)") +action [line %line_num in %str] (=lua "Files.get_line(\%str, \%line_num)") -- cgit v1.2.3