anchor.diff:    (if (zerop n)
         (good nil position)
         (multiple-value-bind (ok r pos) (funcall p text position)
  -        (if ok
  -            (multiple-value-bind (ok2 r2 pos2) (counted (1- n) p text pos)
  -              (if ok2
  -                  (good (cons r r2) pos2)
  -                  (bad position)))
  -            (bad position)))))
  +        (when ok
  +          (multiple-value-bind (ok2 r2 pos2) (counted (1- n) p text pos)
  +            (when ok2
  +              (good (cons r r2) pos2)))))))
  +
   
   (defparserfun text (p text position)
     "Capture the text matched by P."
     (multiple-value-bind (ok r pos) (funcall p text position)
       (declare (ignore r))
  -    (if ok
  -        (good (subseq text position pos) pos)
  -        (bad position))))
  +    (when ok (good (subseq text position pos) pos))))
  +
   
   ;;;; Tracing helpers ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   
  
positive.code:   "Attempt to parse using P, moving forward if it succeeds. If P fails,
  the try consumes no input."
    (multiple-value-bind (ok r np) (funcall p text position)
      (if ok (good r np) (bad position))))
  
  (defparserfun many (p text position)
    "Match P as many times as possible. Always succeeds as zero is an
  
negative.code:   "Return values indicating a parser succeeded."
    (values t result position))
  
  (defun matching-string (s len text position)
    (let* ((end (+ len position))
           (ok (if (<= end (length text)) (string= s text :start2 position :end2 end))))
      (when ok (good s end))))
  
  (defun matching-char (c text position)
    (when (< position (length text))
      (when (char= c (char text position))
        (good c (1+ position)))))
  
  
  ;;; Parser primitives ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  
  (defparserfun any-char (text position)
    "Match a single character. Succeeds everywhere except at the EOF."
    (when (< position (length text))
      (good (char text position) (1+ position))))
  
  (defparserfun eof (text position)
    "Succeed when we are at the end of the text."
    (when (<= (length text) position)
      (good t position)))
  
  
  ;;; Parser combinators ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  