diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2019-01-01 17:15:51 -0800 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2019-01-01 17:17:23 -0800 |
| commit | 3e89092833a6d407e711fe4ae5f44474ff34cf64 (patch) | |
| tree | 5ffe2df86f648b604347b59999992d74f71a796c /lib/os.nom | |
| parent | e68eb04d690454428216a0f0f1b11399feeb7dc1 (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.nom | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -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) |
