 debugger io vectors arrays math.parser math.order
 vectors combinators classes sets unicode.categories
 compiler.units parser words quotations effects memoize accessors
-locals effects splitting combinators.short-circuit
-combinators.short-circuit.smart generalizations ;
+locals effects splitting combinators.short-circuit generalizations ;
 IN: peg
 
 USE: prettyprint

: parser-body ( parser -- quot )
  #! Return the body of the word that is the compiled version
  #! of the parser.
  gensym 2dup swap peg>> (compile) 0 1 <effect> define-declared swap dupd id>> "peg-id" set-word-prop
  [ execute-parser ] curry ;

: preset-parser-word ( parser -- parser word )

    [
      parsers>> unclip compile-parser 1quotation [ parse-seq-element ] curry ,
      [ compile-parser 1quotation [ merge-errors ] compose [ parse-seq-element ] curry , ] each 
    ] { } make , \ 1&& , 
  ] [ ] make ;

TUPLE: choice-parser parsers ;
