Handbook
Glossary
read-doctype-or-cdata ( n string opening -- n string doctype/comment )
Vocabulary
modern
.
html
Inputs
n
an
object
string
an
object
opening
an
object
Outputs
n
an
object
string
an
object
doctype/comment
an
object
Definition
USING:
combinators.extras
kernel
modern.slices
sequences
strings
;
IN:
modern.html
:
read-doctype-or-cdata
( n string opening -- n string doctype/comment )
"!"
expect-and-span
2over
2
peek-from
"--"
sequence=
[
"--"
expect-and-span
>string
[
"-->"
slice-til-string
[
>string
]
bi@
]
dip-2up
<comment>
]
[
2over
1
peek-from
"["
sequence=
[
"[CDATA["
expect-and-span-insensitive
[
"]]>"
slice-til-string
[
>string
]
bi@
]
dip-2up
<cdata>
]
[
"DOCTYPE"
expect-and-span-insensitive
[
read-props
]
dip-2up
<doctype>
]
if
]
if
;