(take-until) ( state delimiter accum -- string/f state' )


Vocabulary
farkup

Inputs
statean object
delimiteran object
accuman object


Outputs
string/fan object
state'an object


Definition


:: (take-until) ( state delimiter accum -- string/f state' )
state empty?
[ accum join-lines f ] [
state unclip-slice :> ( rest first ) first delimiter
split1 :> ( before after ) before accum push after
[ accum join-lines rest after prefix ]
[ rest delimiter accum (take-until) ] if
] if ;