Advertisement
Guest User

Untitled

a guest
Nov 10th, 2019
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. (define-condition parsing-error (error)
  2. ((error :initarg :error :reader parsing-error.error)
  3. (when :initarg :when :reader parsing-error.when))
  4. (:report (lambda (condition stream)
  5. (format stream "~A~%~{~A~%~}"
  6. (parsing-error.error condition)
  7. (parsing-error.when condition)))))
  8.  
  9. (defvar *when* '())
  10.  
  11. (defmacro with-parsing-error-wrapper (&body body)
  12. `(handler-bind ((error (lambda (err)
  13. (error 'parsing-error :error err
  14. :when (copy-seq *when*)))))
  15. ,@body))
  16.  
  17.  
  18. (let ((*when* (cons (format nil "Parsing slot clause ~S" clause) *when*)))
  19. ...)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement