aboutsummaryrefslogtreecommitdiff
path: root/lib/os.nom
diff options
context:
space:
mode:
Diffstat (limited to 'lib/os.nom')
-rw-r--r--lib/os.nom30
1 files changed, 9 insertions, 21 deletions
diff --git a/lib/os.nom b/lib/os.nom
index 5fb2a1f..9f9f637 100644
--- a/lib/os.nom
+++ b/lib/os.nom
@@ -1,4 +1,4 @@
-#!/usr/bin/env nomsu -V4.10.12.7
+#!/usr/bin/env nomsu -V4.11.12.8
#
This file defines some actions that interact with the operating system and filesystem.
@@ -7,13 +7,15 @@ test:
externally (files for %path) means:
%files = (=lua "Files.list(\%path)")
- if %files: %files = (List %files)
+ if %files:
+ %files = (List %files)
return %files
externally (nomsu files for %path) means:
for %nomsupath in (%package.nomsupath::all matches of "[^;]+"):
- %files = (files for "\%nomsupath/\%path")
- if %files: return %files
+ %files = (files for "\(%nomsupath)/\%path")
+ if %files:
+ return %files
externally (sh> %cmd) means:
lua> "\
@@ -26,20 +28,6 @@ test:
read file "lib/os.nom"
externally (read file %filename) means (=lua "Files.read(\%filename)")
-test:
- for file %f in "core": do nothing
-
-(for file %f in %path %body) parses as (for %f in (nomsu files for %path) %body)
-
-# TODO: deprecate
-#(%expr for file %f in %path) compiles to "\
- ..(function()
- local ret = List{}
- for i,\(%f as lua expr) in Files.walk(\(%path as lua expr)) do
- ret[#ret+1] = \(%expr as lua)
- end
- return ret
- end)()"
externally [..]
write to file %filename %text, to file %filename write %text
@@ -57,9 +45,9 @@ externally (source lines of %tree) means:
return (..)
[..]
:
- for % in (line number of %source.start in %file) to (..)
- line number of %source.stop in %file
- ..: add (line % in %file)
+ for % in (%file::line number at %source.start) to (..)
+ %file::line number at %source.stop
+ ..: add (%file::line %)
..::joined with "\n"
externally (spoof file %text) means (%Files.spoof %text)