Handbook
Glossary
tag-classifier ( string -- quot )
Vocabulary
html
.
parser
.
analyzer
Inputs
string
a
string
Outputs
quot
a
quotation
with stack effect
( elt -- 1/0/-1 )
Word description
Builds a function that classifies tag tuples. Returns 1 if the tag is an opening tag with the given name, -1 if it is a closing tag and 0 otherwise.
Definition
USING:
accessors
kernel
unicode
;
IN:
html.parser.analyzer
:
tag-classifier
( string -- quot )
>lower
[
[
dup
name>>
]
]
dip
[
=
[
closing?>>
-1 1
?
]
[
drop
0
]
if
]
curry
compose
;
inline