diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2018-11-20 14:52:59 -0800 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2018-11-20 14:54:40 -0800 |
| commit | 2bbc035f5dcc3ecd62724b9d1de0e7e3ea902379 (patch) | |
| tree | 34a83497f7570946b6252183b3e8fe0ce2010595 /tools/parse.nom | |
| parent | f30413853063483147d941ffccc4b663b71bc943 (diff) | |
Simplifying the filesystem code (no longer entangled with nomsupath) and
using that to simplify the tools. Now the tools directly take lists of
file paths rather than things that might go through nomsupath or
directories or get processed by filetype. Use your shell for globbing stuff like
`nomsu tools/test.nom core/*.nom`
Diffstat (limited to 'tools/parse.nom')
| -rwxr-xr-x | tools/parse.nom | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/tools/parse.nom b/tools/parse.nom index 9e43c88..cb367ab 100755 --- a/tools/parse.nom +++ b/tools/parse.nom @@ -35,15 +35,10 @@ externally (print tree %t at indent %indent) means: else: say "\%indent \(quote %arg)" -for %path in (command line args): - for %filename in (files for %path): - if (%filename == "-"): - %filename = "stdin" - - unless ((%filename == "stdin") or (%filename::matches "%.nom$")): - do next %filename - - %text = (read file %filename) - %nomsu = (NomsuCode from (Source %filename 1 (size of %text)) %text) - %tree = (%nomsu parsed) - print tree %tree at indent "" +for %filename in (command line args).extra_args: + %file = (read file %filename) + unless %file: + barf "File does not exist: \%filename" + %nomsu = (NomsuCode from (Source %filename 1 (size of %file)) %file) + %tree = (%nomsu parsed) + print tree %tree at indent "" |
