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


Vocabulary
farkup

Inputs and outputs
statean object
delimiteran object
accuman object
string/fan object
state'an object


Definition


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