Handbook
Glossary
foreign-end-tag ( document token -- document )
Vocabulary
html5
Inputs
document
an
object
token
an
object
Outputs
document
an
object
Definition
USING:
accessors
kernel
math
sequences
;
IN:
html5
::
foreign-end-tag
( document token -- document )
document
open-elements>>
:>
stack stack
length
1
-
:>
i!
f
:>
done!
[
i 0
>
done
not
and
]
[
i stack
nth
:>
node node
name>>
ascii-downcase
token
name>>
=
[
node token
>>end-tag
drop
i stack
shorten
t
done!
]
[
i 1
-
i! i stack
nth
html-element?
[
document token
html-tree-insert
drop
t
done!
]
when
]
if
]
while
document
;