     <parse-error> error-stack get push ;
 
 SYMBOL: ignore
+
+: ignore? ( obj -- ? )
+    ignore = ;
 
 : packrat ( id -- cache )
     ! The packrat cache is a mapping of parser-id->cache.

    '[ @ calc-seq-result ] [ f ] if* ; inline

M: seq-parser (compile)
    [
        [ input-slice V{ } clone <parse-result> ] %
        [
            parsers>> unclip compile-parser-quot [ parse-seq-element ] curry ,
            [ compile-parser-quot [ merge-errors ] compose [ parse-seq-element ] curry , ] each
        ] { } make , \ 1&& ,
    ] [ ] make ;

TUPLE: choice-parser parsers ;

M: choice-parser (compile)
    [
        [
            parsers>> [ compile-parser-quot ] map
            unclip , [ [ merge-errors ] compose , ] each
        ] { } make , \ 0|| ,
    ] [ ] make ;

TUPLE: repeat0-parser parser ;

: (repeat) ( quot: ( -- result ) result -- result )
    over call [
        [ remaining>> swap remaining<< ] 2keep
        ast>> swap [ ast>> push ] keep
        (repeat)
    ] [
        nip
    ] if* ; inline recursive

    ] if* ;

: compile-parser-quot ( parser -- quot )
    compile-parser '[ _ execute-parser ] ;

: compile-parsers-quots ( parsers -- quots )
    [ compile-parser-quot ] map dup rest-slice
    [ '[ @ merge-errors ] ] map! drop ;

SYMBOL: delayed

