anchor.diff:              (return (good (nreverse r) position)))))))
   
   (defparserfun many1 (parser text position)
  -  "Match P as many times as possible but at least once."
  +  "Match P as many times as possible but at least once. Returns a list
  +of the values returned by P."
     (multiple-value-bind (ok r p) (funcall parser text position)
       (if ok
           (multiple-value-bind (ok r2 p) (many parser text p)
  
positive.code:       (bad position)))
  
  (defparserfun try (p text position)
    "Attempt to parse using p, moving forward if it succeeds. However if
  it fails, it does not consume any input."
    (multiple-value-bind (ok r np) (funcall p text position)
      (if ok
          (good r np)
  
negative.code:         (t exp)))))
  
  (defun compile-string (str text position)
    `(matching-string ,str ,(length str) ,text ,position))
  
  (defun compile-character (char text position)
    `(matching-char ,char ,text ,position))
  
  (defun compile-match (parser txt p)
    `(funcall ,parser ,txt ,p))
  
  (defun compile-parser-call (exp names txt p state)
    (destructuring-bind (name &rest args) (rewrite-form exp names)
      (flet ((comp (x) (compile-parser-argument x names state)))
        `(,name ,@(mapcar #'comp args) ,txt ,p))))
  
  (defun rewrite-form (form names)
    "Rewrite bare symbols naming parser productions or parser functions
  into cannonical list from."
    (cond
      ((and (symbolp form) (grammar-p form names)) (list form))
      (t form)))
  
  (defun parser-function-invocation-p (form names)
    (or
     (and (symbolp form) (grammar-p form names))
     (and (consp form) (symbolp (car form)) (grammar-p (car form) names))))
  
  (defun form-p (what form)
    (and (consp form) (eql (car form) what)))
  
  
  ;;; Runtime functions used by compiled parsers ;;;;;;;;;;;;;;;;;;;;;;;
  
  (defun good (result position)
    "Return values indicating a parser succeeded."
    (values t result position))
  
  (defun bad (position)
    "Return values indicating a parser failed."
    (values nil nil position))
  
  (defun matching-string (s len text position)
    (let* ((end (+ len position))
           (ok (if (<= end (length text)) (string= s text :start2 position :end2 end))))
      (if ok
  