From acd1191fb06a51f70f553c1dc8b47cf245a1c913 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Mon, 19 Nov 2018 17:21:08 -0800 Subject: Tweaks and API cleanup. --- tools/parse.nom | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'tools/parse.nom') 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 "" -- cgit v1.2.3