1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-14 14:58:05 +11:00
collapseos/blk/357
Virgil Dupras 2d9a07d215 blkunpack: don't include trailing empty lines
This was becoming heavy to manage.
2020-06-23 06:52:34 -04:00

9 lines
325 B
Plaintext

: (parsed) ( a -- n f )
C@+ OVER C@ 0 ( a len firstchar startat )
SWAP '-' = IF 1+ THEN ( a len startat )
0 ROT ROT ( len ) ( startat ) DO ( a r )
OVER I + C@ ( a r c ) _pdacc ( a r f )
IF DROP 1- 0 UNLOOP EXIT THEN LOOP ( a r )
( negate if needed )
SWAP C@ '-' = IF 0 -^ THEN 1 ( r 1 ) ;