 : ascii-hex-digit? ( ch/f -- ? ) { [ ascii-digit? ] [ ascii-hex-alpha? ] } 1|| ;
 
 : (return-state) ( document n/f string ch/f -- document n'/f string )
-    B reach [ f ] change-return-state drop check-return-state
+    reach [ f ] change-return-state drop check-return-state
     execute( document n/f string ch/f -- document n'/f string ) ;
 
 : return-state ( document n/f string -- document n'/f string )
-    B pick [ f ] change-return-state drop check-return-state
+    pick [ f ] change-return-state drop check-return-state
     execute( document n/f string -- document n'/f string ) ;
 
 : (data-state) ( document n/f string ch/f -- document n'/f string )



: (named-character-reference-state) ( document n/f string ch/f -- document n'/f string )
    B reach push-temporary-buffer
    pick named-character-match? [
        drop ! exact match, drop prefix match
        {
            [ pick temporary-buffer-attribute? ]
            [ pick temporary-buffer>> ?last CHAR: ; = not ]
            [ 2dup peek-from { [ CHAR: = = ] [ ascii-alphanumeric? ] } 1|| ]
        } 0&& [
            unimplemented*
            flush-temporary-buffer

M: after-after-frameset-mode tree-insert* drop unimplemented* ;

: tree-insert ( document obj -- document )
    over tree-insertion-mode>> tree-insert* ;

MEMO: load-entities ( -- assoc )
    "vocab:html5/entities.json" utf8 file-contents json> ;
