From a4bb5eec3fe05adbb18dde516b906b7407803387 Mon Sep 17 00:00:00 2001 From: crc Date: Thu, 1 Oct 2020 13:37:36 +0000 Subject: [PATCH] toolchain: add a tool to locate deprecated words (based on the shell snippit used by john_cephalopoda) FossilOrigin-Name: 0f15a232ef1685f5cda43681de1eed41c5d76b43326c6c285964935b85021789 --- tools/find-deprecated.retro | 56 +++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100755 tools/find-deprecated.retro diff --git a/tools/find-deprecated.retro b/tools/find-deprecated.retro new file mode 100755 index 0000000..5fb3dc6 --- /dev/null +++ b/tools/find-deprecated.retro @@ -0,0 +1,56 @@ +#!/usr/bin/env retro + +This is a small tool to find use of deprecated words in the +Retro source tree. + +It's pretty much just a wrapper over a Unix shell pipeline, +but pulls the word names from an array of strings defined in +Retro, so it's easy for me to add new entries as the language +evolves. + +First, files/patterns to exclude. + +~~~ +{ 'Glossary-Concise.txt + 'Glossary-Names-and-Stack.txt + 'Glossary.html + 'Glossary.txt + 'words.tsv + 'glossary/glossary + 'bin/retro-describe + 'compat.retro + 'compat.forth + 'README + 'RELEASE-NOTES +} s:empty swap [ swap '%s_|_grep_-v_%s s:format ] a:for-each +'EXCLUSIONS s:const +~~~ + +Then the deprecated words. + +~~~ +{ (2020.7) + 'd:last + 'd:last + 'd:last + 'file:open + 'file:open + 'file:open + 'times + 'var + + (2020.10) + 'sys:name + 'sys:argc + 'sys:argv +} s:empty swap [ swap '%s_"%s" s:format ] a:for-each +'DEPRECATED s:const +~~~ + +Construct the actual shell pipeline and run it. + +~~~ +EXCLUSIONS DEPRECATED 'for_name_in_%s;_do_find_._|_xargs_grep_-s_$name_|_grep_-v_find-deprecated.retro_%s_;_done +s:format unix:system +~~~ +