aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2018-11-17 14:38:05 -0800
committerBruce Hill <bruce@bruce-hill.com>2018-11-17 14:39:08 -0800
commit7f47d4204039258cec78c767f489b7809b4257ff (patch)
treec8533068b75ab453accfe1f688705e9e94c9e279 /tools
parent34a3dd22a4e132bd4e0fe3ce89831c3fe761d3d9 (diff)
In-progress (but working) overhaul of some elements including: function
calls, lib/thing.nom API, multi-assignments, varargs, etc.
Diffstat (limited to 'tools')
-rwxr-xr-xtools/autoformat.nom5
-rwxr-xr-xtools/find_action.nom2
2 files changed, 4 insertions, 3 deletions
diff --git a/tools/autoformat.nom b/tools/autoformat.nom
index 3082a9e..8626c91 100755
--- a/tools/autoformat.nom
+++ b/tools/autoformat.nom
@@ -16,8 +16,9 @@ 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$"): do next %filename
+ 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)
@@ -25,4 +26,4 @@ for %path in %args:
if %inplace:
write %formatted to file %filename
..else:
- say %formatted
+ say %formatted inline
diff --git a/tools/find_action.nom b/tools/find_action.nom
index 21482d3..c51a144 100755
--- a/tools/find_action.nom
+++ b/tools/find_action.nom
@@ -11,7 +11,7 @@ use "lib/consolecolor.nom"
%stub = (command line args).1
say "Looking for stub: \%stub..."
-%files = ((command line args).% for % in 2 to (size of (command line args)))
+%files = [: for % in 2 to (size of (command line args)): add (command line args).%]
for %path in %files:
for file %filename in %path:
unless (%filename::matches "%.nom$"): do next %filename