 M: choice-parser (compile) ( parser -- quot )
   [ 
     f ,
-    parsers>> [ compiled-parser 1quotation , \ unless* , ] each
+    parsers>> [ compiled-parser ] map 
+    unclip 1quotation , \ unless* , [ 1quotation [ merge-errors ] compose , \ unless* , ] each
   ] [ ] make ;
 
 TUPLE: repeat0-parser p1 ;

M: seq-parser (compile) ( parser -- quot )
  [
    [ input-slice V{ } clone <parse-result> ] %
    parsers>> [ compiled-parser 1quotation , \ parse-seq-element , ] each 
  ] [ ] make ;

TUPLE: choice-parser parsers ;

: parse-token ( input string -- result )
  #! Parse the string, returning a parse result
  dup >r ?head-slice [
    r> <parse-result> f f add-error
  ] [
    drop input-slice input-from "Expected token '" r> append "'" append 1vector add-error f
  ] if ;

M: token-parser (compile) ( parser -- quot )
