diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2019-01-10 16:33:37 -0800 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2019-01-10 16:35:08 -0800 |
| commit | 0f0fb2256a46a8808794d7d4746d112278da3730 (patch) | |
| tree | 7cfb6b255beeb49705044876913e0332376b66d9 /tools | |
| parent | db552f56dc1f2c6ea19a7d39d38ac66e52ed156e (diff) | |
Major overhaul of how modules and environments work, along with some
steamlining and tweaks to the makefile. Version bump: 6.14.13.8
Diffstat (limited to 'tools')
| -rwxr-xr-x | tools/find.nom | 4 | ||||
| -rwxr-xr-x | tools/format.nom | 2 | ||||
| -rwxr-xr-x | tools/parse.nom | 2 | ||||
| -rwxr-xr-x | tools/repl.nom | 10 | ||||
| -rwxr-xr-x | tools/replace.nom | 4 | ||||
| -rwxr-xr-x | tools/test.nom | 26 | ||||
| -rwxr-xr-x | tools/upgrade.nom | 4 |
7 files changed, 25 insertions, 27 deletions
diff --git a/tools/find.nom b/tools/find.nom index 8f2bc9f..f9a63b9 100755 --- a/tools/find.nom +++ b/tools/find.nom @@ -16,8 +16,8 @@ <filename>:<line number>: <matching lines> -use "lib/os.nom" -use "lib/consolecolor.nom" +use "lib/os" +use "lib/consolecolor" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tools/format.nom b/tools/format.nom index 4915e46..07f7980 100755 --- a/tools/format.nom +++ b/tools/format.nom @@ -7,7 +7,7 @@ If the "-q" flag is used and an error occurs, the original file will be printed. If no files are passed in, this will read from stdin. -use "lib/os.nom" +use "lib/os" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tools/parse.nom b/tools/parse.nom index ab2c583..22bfdc3 100755 --- a/tools/parse.nom +++ b/tools/parse.nom @@ -3,7 +3,7 @@ Tool to print out a parse tree of files in an easy-to-read format. Usage: nomsu tools/parse.nom file1 file2 directory1 ... -use "lib/os.nom" +use "lib/os" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tools/repl.nom b/tools/repl.nom index 58a24d3..175d068 100755 --- a/tools/repl.nom +++ b/tools/repl.nom @@ -2,8 +2,8 @@ # This file defines a Read-Evaluate-Print-Loop (REPL) for Nomsu -use "lib/consolecolor.nom" -use "lib/os.nom" +use "lib/consolecolor" +use "lib/os" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -44,7 +44,7 @@ repeat: spoof file $buff try: $tree = ($buff parsed) - ..if it fails $err: + ..if it fails with $err: say $err do next @@ -54,7 +54,7 @@ repeat: for $chunk in $tree: try: $lua = ($chunk as lua) - ..if it fails $err: say $err + ..if it fails with $err: say $err unless $lua: do next @@ -65,7 +65,7 @@ repeat: $lua, remove free vars try: $ret = (run $lua) - ..if it fails $err: say $err + ..if it fails with $err: say $err ..if it succeeds: if (type of $ret) is: "nil": diff --git a/tools/replace.nom b/tools/replace.nom index aa5d08c..f4df0e4 100755 --- a/tools/replace.nom +++ b/tools/replace.nom @@ -15,8 +15,8 @@ contents will be output. If no files are passed in, this will read from stdin. -use "lib/os.nom" -use "lib/consolecolor.nom" +use "lib/os" +use "lib/consolecolor" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tools/test.nom b/tools/test.nom index f8373d8..44d783b 100755 --- a/tools/test.nom +++ b/tools/test.nom @@ -3,15 +3,14 @@ Tool to run all tests in a file (i.e. the code block inside a call to 'test $'). Usage: nomsu tools/test.nom file1 file2 directory1 ... -use "lib/os.nom" -use "lib/consolecolor.nom" +use "lib/os" +use "lib/consolecolor" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# Make sure all the files get run -for $filename in $(COMMAND LINE ARGS).extras: use $filename -$tests = {: for $s = $t in $TESTS: add (=lua "Source:from_string(\$s)") = $t} for $filename in $(COMMAND LINE ARGS).extras: + $(test environment) = (new environment) + $(test environment), use $filename $file = (read file $filename) $version = $file, matching (" @@ -20,14 +19,13 @@ for $filename in $(COMMAND LINE ARGS).extras: ]*) ") $file_tests = [] - for $src = $test in $tests: - if ($src.filename == $filename): - if $version: - $test = (" - #!/usr/bin/env nomsu -V\$version - \$test - ") - $file_tests, add {.test = $test, .source = $src} + for $src = $test in $(test environment).TESTS: + if $version: + $test = (" + #!/usr/bin/env nomsu -V\$version + \$test + ") + $file_tests, add {.test = $test, .source = $src} unless ($file_tests is empty): sort $file_tests by $ -> $.source @@ -38,7 +36,7 @@ for $filename in $(COMMAND LINE ARGS).extras: for $ in $file_tests: if (command line args).v: say " \(yellow ($.test, with "\n" -> "\n "))" - run $.test + $(test environment), run $.test if (command line args).v: say (green "PASS") diff --git a/tools/upgrade.nom b/tools/upgrade.nom index 01040c8..b9b8255 100755 --- a/tools/upgrade.nom +++ b/tools/upgrade.nom @@ -6,8 +6,8 @@ upgraded code will be printed. use "compatibility" -use "lib/os.nom" -use "lib/consolecolor.nom" +use "lib/os" +use "lib/consolecolor" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
