diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2018-11-19 17:21:08 -0800 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2018-11-19 17:21:17 -0800 |
| commit | acd1191fb06a51f70f553c1dc8b47cf245a1c913 (patch) | |
| tree | 993bb69cc050426644b98d10fb1a3133b3623be6 /tools/parse.nom | |
| parent | 7f47d4204039258cec78c767f489b7809b4257ff (diff) | |
Tweaks and API cleanup.
Diffstat (limited to 'tools/parse.nom')
| -rwxr-xr-x | tools/parse.nom | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/tools/parse.nom b/tools/parse.nom index 6f88179..10d4dde 100755 --- a/tools/parse.nom +++ b/tools/parse.nom @@ -35,7 +35,12 @@ externally (print tree %t at indent %indent) means: else: say "\%indent \(quote %arg)" -for %path in (=lua "arg"): - for file %filename in %path: - unless (%filename::matches "%.nom$"): do next %filename - print tree (parse (read file %filename) from %filename) at indent "" +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 "" |
