From 635cb165ee96e8c93480ad41b7698179394a4412 Mon Sep 17 00:00:00 2001 From: crc <> Date: Fri, 3 Nov 2023 14:33:14 +0000 Subject: [PATCH] retro-describe: use `s:left` rather than fully tokenizing the source data when doing basic searches FossilOrigin-Name: dafa60449e827e32eb344d44215b2e3b3f6a8328db90073131ba29496eae6c6c --- tools/retro-describe.retro | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/retro-describe.retro b/tools/retro-describe.retro index a1535d1..61ca9df 100755 --- a/tools/retro-describe.retro +++ b/tools/retro-describe.retro @@ -141,14 +141,15 @@ the description. ~~~ {{ - 'Target var + 'Target var + 'Len var 'LineNumber var - :matched? (-f) field:name s:hash @Target eq? ; + :matched? (-f) @SourceLine @Len s:left s:hash @Target eq? ; :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:hash !Target + #0 !LineNumber dup s:length !Len s:hash !Target script:name [ entry? &process &drop choose ] file:for-each-line nl ; }} ~~~