mirror of
https://github.com/hsoft/collapseos.git
synced 2024-11-14 18:58:06 +11:00
12 lines
367 B
Plaintext
12 lines
367 B
Plaintext
: _ ( a len -- n f )
|
|
OVER C@ ( a len c )
|
|
'-' = IF
|
|
1- SWAP 1+ SWAP ( a+1 len-1 ) _ 0 ROT ( f 0 n )
|
|
- SWAP EXIT ( 0-n f )
|
|
THEN ( a len )
|
|
0 SWAP ( len ) 0 DO ( a r )
|
|
OVER I + C@ ( a r c ) _pdacc ( a r f )
|
|
IF DROP 0 UNLOOP EXIT THEN LOOP ( a r )
|
|
NIP 1 ;
|
|
: (parsed) ( a -- n f ) DUP 1- C@ ( a l ) _ ;
|