Handbook
Glossary
read-acute-html ( n string slice -- n' string acute )
Vocabulary
modern
Inputs
n
an
object
string
an
object
slice
an
object
Outputs
n'
an
object
string
an
object
acute
an
object
Definition
USING:
arrays
combinators
combinators.extras
kernel
modern.slices
sequences
sequences.extras
;
IN:
modern
:
read-acute-html
( n string slice -- n' string acute )
{
{
[
dup
section-open?
]
[
[
matching-section-delimiter
1array
lex-until
]
keep-1up
unclip-last
3array
]
}
{
[
dup
html-self-close?
]
[
]
}
{
[
dup
html-full-open?
]
[
dup
[
rest-slice
dup
">"
tail?
[
but-last-slice
]
when
"</"
">"
surround
1array
lex-until
unclip-last
]
dip
-rot
3array
]
}
{
[
dup
html-half-open?
]
[
[
{
">"
"/>"
}
lex-until
]
dip
over
">"
sequence=
[
"</"
">"
surround
array
[
lex-until
]
curry
dip
unclip-last
-rot
roll
unclip-last
[
3array
]
2dip
3array
]
[
swap
unclip-last
3array
]
if
]
}
{
[
dup
html-close?
]
[
]
}
[
[
slice-til-whitespace
drop
]
dip
span-slices
]
}
cond
;