From 3e89092833a6d407e711fe4ae5f44474ff34cf64 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Tue, 1 Jan 2019 17:15:51 -0800 Subject: Some changes to the error API, a fix for statement block parsing, and replacing ((foo 1 baz)'s meaning) with $(foo 1 baz). --- tools/find.nom | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tools/find.nom') diff --git a/tools/find.nom b/tools/find.nom index 781ca3f..8f2bc9f 100755 --- a/tools/find.nom +++ b/tools/find.nom @@ -1,4 +1,4 @@ -#!/usr/bin/env nomsu -V6.13.12.8 +#!/usr/bin/env nomsu -V6.14 # This is a tool to find syntax trees matching a pattern. "*" is a wildcard that will match any subtree, and "**" is a wildcard that will match any @@ -24,7 +24,7 @@ use "lib/consolecolor.nom" $wildcard = ($(COMMAND LINE ARGS).wildcard or "%*") $pattern = $(COMMAND LINE ARGS).extras.1 if (any of [not $pattern, $pattern == "*", $pattern == "**"]): - barf (" + fail (" Usage: nomsu -t find [-l] [--wildcard=] , where is valid Nomsu code ") $pattern = ($pattern, with "\$wildcard\$wildcard" -> "$multi_wildcard") @@ -57,11 +57,11 @@ if ((#$filenames) == 0): for $filename in $filenames: $file = (read file $filename) unless $file: - barf "File does not exist: \$filename" + fail "File does not exist: \$filename" $code = (NomsuCode from ($Source $filename 1 (size of $file)) $file) try: $tree = ($code parsed) - ..and if it barfs $msg: + ..if it fails $msg: say red (" \$filename failed to parse: -- cgit v1.2.3