aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorBruce Hill <bitbucket@bruce-hill.com>2018-07-22 15:01:05 -0700
committerBruce Hill <bitbucket@bruce-hill.com>2018-07-22 15:01:05 -0700
commitaddac10a47693a976808bf75fe63aed19f8dbb63 (patch)
treeb072998c987f86eb1ecd381fd36eee0d1e3a6091 /tools
parent4fa9757fa27d79a0cda399dcf3b711f4d0d60457 (diff)
Re-autoformatted everything. The main changes are: no longer adding a
newline after 1-line indented code inside blocks, and forcing files to have a trailing newline. The trailing newline thing created a lot of spurious changes.
Diffstat (limited to 'tools')
-rwxr-xr-xtools/parse.nom8
-rwxr-xr-xtools/test.nom5
2 files changed, 8 insertions, 5 deletions
diff --git a/tools/parse.nom b/tools/parse.nom
index 68be3a8..35613d2 100755
--- a/tools/parse.nom
+++ b/tools/parse.nom
@@ -1,6 +1,7 @@
-#!/usr/bin/env nomsu -V2.4.4.3
+#!/usr/bin/env nomsu -V2.5.4.3
use "core"
use "lib/os.nom"
+
action [print tree %t at indent %indent]:
if %t.type is:
"Action":
@@ -8,12 +9,13 @@ action [print tree %t at indent %indent]:
for %arg in %t:
if (%arg is syntax tree):
print tree %arg at indent "\%indent "
+
"Number":
- say "\(%indent)\(%t.1)"
+ say "\%indent\(%t.1)"
"Var":
say "\(%indent)%\(%t.1)"
else:
- say "\(%indent)\(%t.type):"
+ say "\%indent\(%t.type):"
for %arg in %t:
if:
(%arg is syntax tree):
diff --git a/tools/test.nom b/tools/test.nom
index 3d3329f..a80ea55 100755
--- a/tools/test.nom
+++ b/tools/test.nom
@@ -17,6 +17,7 @@ for %path in (command line args):
for %src = %test in %tests:
if (%src.filename == %filename):
add {test:%test, source:%src} to %file_tests
+
unless (%file_tests is empty):
sort %file_tests by % -> %.source
lua> "io.write('[ .. ] ', \%filename); io.flush()"
@@ -25,7 +26,7 @@ for %path in (command line args):
if %verbose:
say " \(yellow (%.test with "\n" replaced by "\n "))"
run %.test
- if %verbose:
- say (green "PASS")
+
+ if %verbose: say (green "PASS")
..else:
say "\r[\(green "PASS")"