| 20150220.2037 | One long standing bug which has prevented 4th.CoSy from be ready for any meaningful distribution was an occasional bomb searching for certain short strings . Most irritatingly this caused occasional bombs when seeking help using CShelp . I finally tracked the bug down the fundamental Reva search function . That's as far as I zeroed in on it because the definition of search in C:/4thCoSy/src/reva.f is : search inline{ 89 C2 8B 06 8D 76 04 89 C7 8B 06 8D 76 04 89 C1 8B 06 8D 76 04 50 51 E3 17 09 C0 74 13 09 D2 74 0F 09 FF 74 0B 8A 3F 8A 18 38 FB 74 08 40 E2 F7 31 C0 59 59 C3 39 D1 72 F7 89 D5 4D 8A 3C 2F 3A 3C 28 75 19 4D 79 F5 8D 76 FC 89 06 58 2B 06 5B 01 D8 8D 76 FC 89 06 B8 FF FF FF FF C3 40 49 EB C4 } ; see prior search | sF6 to see the disassembled listing . This is way beyond my ability in X86 assembly and my time . ( Want a challenge ? ) The bug which caused the fundamental CoSy string search function , ss , to bomb is that on some particular strings , search returns a false found and a negative length string . So I implemented : | Kludge fix of bug in Reva ' search on some strings : search ( a1 n1 a2 n2 -- a3 n3 true | false ) prior search 00; over 0 <if cr ." search error " $.s cr 3drop 0 then ; Which gets us to the 4th.CoSy help system . It's minimal but powerful . Mainly just the verb ' CShelp defined in C:\4thCoSy\CoSy\Derived.f : s" : CShelp " CShelp ... (
s" CoSy/Derived.f" s" : (CShelp) ( str file -- occurrences ) slurp^ emptyLn toksplt swap con { "nl cL } eachm ; : CShelp ( str -- refs ) | searches source files listed in `( sys CoSySource )` for str and returns list of files | searched and source between preceding and succeeding blank lines containing str . [ R ` sys v@ ` CoSySource v@ ] literal { >r> (CShelp) r> swap cL } eachright ; " ) ... This mechanism takes advangage of Jedit's display of end of lines so you can see if a line is truly empty or if it contains at least one blank or tab . The line between : (CShelp) and : CShelp contains a blank so the (CShelp) definition is also included . This
makes it very easy to clump together related word definitions which may
be of use when any one of them is inquired about . The fact the
search returns all occurrences of the phrase being sought means that if
you just give the name of function , it will return all uses of it .Native Reva Help At the top of the provided ` text log is a list of the essential Reva help words . These output directly rather than return a result so must be executed in raw Forth using shiftF6 . See also the material at http://dev.ronware.org/p/reva/home .
|