aboutsummaryrefslogtreecommitdiff
path: root/tools/autoformat.nom
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2018-11-19 17:37:37 -0800
committerBruce Hill <bruce@bruce-hill.com>2018-11-19 17:37:37 -0800
commita89d69e843ba83df928051005d02a932a9981f46 (patch)
tree17f99cda2d4e5f0a7983ed14f4ac559b64944207 /tools/autoformat.nom
parent43ff3892f39188163446f1a00ee8d2aad59e0392 (diff)
Autoformatted/auto-upgraded.
Diffstat (limited to 'tools/autoformat.nom')
-rwxr-xr-xtools/autoformat.nom13
1 files changed, 8 insertions, 5 deletions
diff --git a/tools/autoformat.nom b/tools/autoformat.nom
index 8626c91..96b732b 100755
--- a/tools/autoformat.nom
+++ b/tools/autoformat.nom
@@ -1,7 +1,7 @@
-#!/usr/bin/env nomsu -V4.10.12.7
+#!/usr/bin/env nomsu -V4.11.12.8
#
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.
@@ -16,9 +16,12 @@ if (%args.1 is "-i"):
%args::remove index 1
for %path in %args:
- if (%path == "-"): %path = "stdin"
- for file %filename in %path:
- unless ((%filename::matches "%.nom$") or (%filename == "stdin")): do next %filename
+ if (%path == "-"):
+ %path = "stdin"
+
+ for %filename in (files for %path):
+ unless ((%filename::matches "%.nom$") or (%filename == "stdin")):
+ do next %filename
%contents = (read file %filename)
%code = (NomsuCode from (Source %filename 1 (size of %contents)) %contents)
%tree = (%code parsed)