X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?p=forth.jl.git;a=blobdiff_plain;f=src%2Flib_7_decompiler.4th;h=a27442bdeb2537ae3ce3cc28593d441da84aeb48;hp=505f7da200fabab9f4feb6923ed3628147097ee8;hb=56f581c25775f4244cd60d5943a5beb46a9ccafb;hpb=4437e4ba8255ef676faf94682a8ecc2579d0f12d diff --git a/src/lib_7_decompiler.4th b/src/lib_7_decompiler.4th index 505f7da..a27442b 100644 --- a/src/lib_7_decompiler.4th +++ b/src/lib_7_decompiler.4th @@ -33,6 +33,10 @@ F_IMMED AND ( mask the F_IMMED flag and return it (as a truth value) ) ; +: BODYLEN + \ **TODO** +; + : SEE BL WORD FIND ( find the dictionary entry to decompile ) @@ -43,23 +47,7 @@ EXIT THEN - >LINK - - ( Now we search again, looking for the next word in the dictionary. This gives us - the length of the word that we will be decompiling. (Well, mostly it does). ) - HERE ( address of the end of the last compiled word ) - LATEST @ ( word last curr ) - BEGIN - 2 PICK ( word last curr word ) - OVER ( word last curr word curr ) - <> ( word last curr word<>curr? ) - WHILE ( word last curr ) - NIP ( word curr ) - DUP @ ( word curr prev (which becomes: word last curr) ) - REPEAT - - DROP ( at this point, the stack is: start-of-word end-of-word ) - SWAP ( end-of-word start-of-word ) + DUP DUP BODYLEN + SWAP >LINK DUP LINK> @ CASE DOCOL OF