From 5ec4cc202affe221185a3631d33c064d53fd96ae Mon Sep 17 00:00:00 2001 From: crc Date: Mon, 21 Jun 2021 03:15:12 +0000 Subject: [PATCH] a small cleanup in retro-describe FossilOrigin-Name: 9db02bdfb9a4ba3a08bad22f3e5adb0eb33e95cb3926a631acf98006db7cabd7 --- tools/retro-describe.retro | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/tools/retro-describe.retro b/tools/retro-describe.retro index 48544c0..a280f25 100755 --- a/tools/retro-describe.retro +++ b/tools/retro-describe.retro @@ -26,7 +26,7 @@ script:arguments n:zero? [ #0 unix:exit ] if ~~~ ~~~ -#167 'DATA-START const +#166 'DATA-START const ~~~ # Data File @@ -144,13 +144,12 @@ the description. 'Target var 'LineNumber var :matched? (-f) field:name @Target s:eq? ; - :entry? (-f) - @LineNumber DATA-START gteq? &LineNumber v:inc ; + :entry? (-f) @LineNumber DATA-START gteq? &LineNumber v:inc ; + :process (-) &Heap [ s:keep !SourceLine matched? [ display-result ] if ] v:preserve ; ---reveal--- :find-and-display-entry - #0 !LineNumber - s:keep !Target - script:name [ &Heap [ s:keep !SourceLine entry? 0; drop matched? [ display-result ] if ] v:preserve ] file:for-each-line nl ; + #0 !LineNumber s:keep !Target + script:name [ entry? [ process ] [ drop ] choose ] file:for-each-line nl ; }} ~~~