Handbook
Glossary
(processing-instruction-target-state) ( document n/f string ch/f -- document n'/f string )
Vocabulary
html5
Inputs
document
an
object
n/f
an
object
string
an
object
ch/f
an
object
Outputs
document
an
object
n'/f
an
object
string
an
object
Definition
USING:
accessors
combinators
combinators.short-circuit
kernel
sequences
strings
unicode
;
IN:
html5
:
(processing-instruction-target-state)
( document n/f string ch/f -- document n'/f string )
{
{
[
dup
"\t\n\f ?>"
member?
]
[
reach
temporary-buffer>>
>string
>lower
{
"xml"
"xml-stylesheet"
}
member?
[
"disallowed-processing-instruction-target"
report-parse-error
[
pick
temporary-buffer>comment
]
dip
(bogus-comment-state)
]
[
[
pick
new-processing-instruction
]
dip
(after-processing-instruction-target-state)
]
if
]
}
{
[
dup
{
[
ascii-alphanumeric?
]
[
"-_"
member?
]
}
1||
]
[
reach
push-temporary-buffer
processing-instruction-target-state
]
}
{
[
dup
f
=
]
[
drop
"eof-in-processing-instruction"
report-parse-error
pick
emit-eof
]
}
[
"invalid-processing-instruction-target"
report-parse-error
[
pick
temporary-buffer>comment
]
dip
(bogus-comment-state)
]
}
cond
;