aboutsummaryrefslogtreecommitdiff
path: root/lib/os.nom
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2019-01-01 17:15:51 -0800
committerBruce Hill <bruce@bruce-hill.com>2019-01-01 17:17:23 -0800
commit3e89092833a6d407e711fe4ae5f44474ff34cf64 (patch)
tree5ffe2df86f648b604347b59999992d74f71a796c /lib/os.nom
parente68eb04d690454428216a0f0f1b11399feeb7dc1 (diff)
Some changes to the error API, a fix for statement block parsing, and
replacing ((foo 1 baz)'s meaning) with $(foo 1 baz).
Diffstat (limited to 'lib/os.nom')
-rw-r--r--lib/os.nom13
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/os.nom b/lib/os.nom
index 8c05836..2e4cd86 100644
--- a/lib/os.nom
+++ b/lib/os.nom
@@ -1,4 +1,4 @@
-#!/usr/bin/env nomsu -V6.13.12.8
+#!/usr/bin/env nomsu -V6.14
#
This file defines some actions that interact with the operating system and filesystem.
@@ -33,7 +33,9 @@ externally [
write to file $filename $text, to file $filename write $text
write $text to file $filename
] all mean:
- assume ($filename != "stdin") or barf "Cannot write to stdin"
+ unless ($filename != "stdin"):
+ fail "Cannot write to stdin"
+
lua> ("
local file = io.open(\$filename, 'w')
file:write(\$text)
@@ -45,10 +47,9 @@ externally (source lines of $tree) means:
$file = (read file $source.filename)
return
[
- :
- for $ in ($file, line number at $source.start) to
- $file, line number at $source.stop
- ..: add ($file, line $)
+ : 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)