   dup >r ?head-slice [
     r> <parse-result> 
   ] [
-    r> 2drop f
+    drop input-slice "Expected token '" r> append "'" append add-error f
   ] if ;
 
 M: token-parser (compile) ( parser -- quot )

  ] with-compilation-unit ;

: compiled-parse ( state word -- result )
  swap [ execute ] with-packrat ; inline 

: parse ( input parser -- result )
  dup word? [ compile ] unless compiled-parse ;

    input set
    0 pos set
    f lrstack set
    <parse-error> errors set
    H{ } clone heads set
    H{ } clone packrat set
  ] H{ } make-assoc swap bind ; inline
