Handbook
Glossary
read-matched ( ch -- quot: ( n string tag -- n' string slice' ) )
Vocabulary
modern
Inputs
ch
an
object
Outputs
quot
a
quotation
with stack effect
( n string tag -- n' string slice' )
Definition
USING:
arrays
combinators
kernel
modern.slices
sequences
sequences.extras
sets
strings
unicode
;
IN:
modern
MACRO::
read-matched
( ch -- quot: ( n string tag -- n' string slice' ) )
ch
dup
matching-delimiter
{
[
drop
"="
swap
prefix
]
[
nip
1string
]
}
2cleave
:>
( openstreq closestr1 )
[|
n string tag |
n string tag
2over
nth-check-eof
{
{
[
dup
openstreq
member?
]
[
ch
read-double-matched
]
}
{
[
dup
blank?
]
[
drop
dup
[
matching-delimiter-string
closestr1
2array
members
lex-until
]
curry
dip
swap
unclip-last
3array
]
}
[
drop
[
slice-til-whitespace
drop
]
dip
span-slices
]
}
cond
]
;