aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rwxr-xr-xtools/autoformat.nom10
-rw-r--r--tools/repl.nom4
2 files changed, 6 insertions, 8 deletions
diff --git a/tools/autoformat.nom b/tools/autoformat.nom
index f236ca4..b15f4ce 100755
--- a/tools/autoformat.nom
+++ b/tools/autoformat.nom
@@ -1,7 +1,7 @@
#!/usr/bin/env nomsu -V4.10.12.7
#
Auto-format Nomsu code. Usage:
- nomsu tools/autoformat.nom [-i] file1 file2 directory1 ...
+ nomsu tools/autoformat.nom [-i] file1 file2 directory1 ...
If the first argument is "-i", modifications will be performed in-place. Otherwise,
the formatted code will be printed.
@@ -18,10 +18,10 @@ if (%args.1 is "-i"):
for %path in %args:
for file %filename in %path:
unless (%filename::matches "%.nom$"): do next %filename
- %formatted = "\
- ..#!/usr/bin/env nomsu -V\(Nomsu version)
- \((parse (read file %filename) from %filename) as nomsu)"
-
+ %contents = (read file %filename)
+ %code = (%NomsuCode::from (Source %filename 1 (size of %contents)) %contents)
+ %tree = (%code parsed)
+ %formatted = ((%tree as nomsu)::text)
if %inplace:
write %formatted to file %filename
..else:
diff --git a/tools/repl.nom b/tools/repl.nom
index 9d9e88d..6857df2 100644
--- a/tools/repl.nom
+++ b/tools/repl.nom
@@ -4,9 +4,7 @@ use "lib/os.nom"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-externally [quit, exit] all mean:
- lua> "os.exit(0)"
-
+externally [quit, exit] all mean: lua> "os.exit(0)"
externally (help) means:
say "\
..This is the Nomsu v\(Nomsu version) interactive console.