mirror of
https://github.com/hsoft/collapseos.git
synced 2024-12-28 09:48:05 +11:00
d8a6456206
The address returned in the error condition would be off by one.
9 lines
325 B
Plaintext
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 ) ;
|