Handbook
Glossary
(parse-until-pred) ( acc end-pred -- ... seq )
Vocabulary
combinators
.
syntax
.
private
Inputs
acc
an
object
end-pred
an
object
Outputs
seq
an
object
Definition
USING:
combinators
kernel
lexer
parser
sequences
words
;
IN:
combinators.syntax.private
:
(parse-until-pred)
( acc end-pred -- ... seq )
[
?scan-datum
{
{
[
[
swap
call
]
2keep
rot
]
[
pick
push
drop
f
]
}
{
[
dup
not
]
[
drop
throw-unexpected-eof
]
}
{
[
dup
delimiter?
]
[
unexpected
]
}
{
[
dup
parsing-word?
]
[
nip
execute-parsing
t
]
}
[
pick
push
drop
t
]
}
cond
]
curry
loop
;
inline