From 3e89092833a6d407e711fe4ae5f44474ff34cf64 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Tue, 1 Jan 2019 17:15:51 -0800 Subject: Some changes to the error API, a fix for statement block parsing, and replacing ((foo 1 baz)'s meaning) with $(foo 1 baz). --- lib/os.nom | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'lib/os.nom') 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) -- cgit v1.2.3