         [ next-event type>> ] dip =
         [ "wrong event" throw ] unless
     ] with-destructors ;
+
+:: parse-yaml-doc ( parser event -- obj )
+    H{ } clone anchors [
+        parser event next-value
+    ] with-variable ;
 
 :: ?parse-yaml-doc ( parser event -- obj/f ? )
     [

        } case
    ] with-destructors
    [
        parser event next-value t
        parser event YAML_DOCUMENT_END_EVENT expect-event
    ] [ f f ] if ;


            [
                parser event next-event type>>
                YAML_SEQUENCE_END_EVENT = [
                    t done! f f
                ] [
                    event ?scalar-value
                ] if
            ] with-destructors
            done [ 2drop ] [
              [ [ parser event ] dip next-complex-value ] unless ,
            ] if
        ] until
    ] { } make ;

