         (mpd-skip-whitespace)
         (if (= (point) (point-max))
             sexp
-          (error "parse error"))))))
+          (error (format "parse error at line %d, col %d"
+                         (car mpd-best) (cdr mpd-best))))))))
 
 (defun psl-eval-buffer ()
   "Evaluate the ParselTongue program in the buffer."

  (save-excursion
    (goto-char (point-min))
    (while (re-search-forward "#[^\n]*\n" nil t)
      (replace-match "" nil nil))))

;;; ParselTongue grammar


                  (symbol (mpd-match-token pattern tokens funcs))
                  (vector (mpd-match-or    pattern tokens funcs)))))
    (unless result
      (mpd-set-best)
      (goto-char start))
    result))

