src/**/*.lisp: Use convenience functions to invoke restarts.
[sod] / src / parser / floc-proto.lisp
index f65ed73..3a11123 100644 (file)
 (define-condition simple-information (simple-condition information)
   ())
 
-(export '(info noted))
+(export 'info)
 (defun info (datum &rest arguments)
   "Report some useful diagnostic information.
 
       (signal (designated-condition 'simple-information datum arguments))
     (noted () :report "Noted." t)))
 
+(export 'noted)
+(defun noted (&optional condition)
+  "Invoke the `noted' restart, possibly associated with the given CONDITION."
+  (invoke-associated-restart 'noted condition))
+
 (export 'simple-information-with-location)
 (define-condition simple-information-with-location
     (information-with-location simple-information)
                          (if fatal
                              (return-from count-and-report-errors*
                                (values nil errors warnings))
-                             (invoke-restart 'continue)))))
+                             (continue error)))))
               (warning (lambda (warning)
                          (format *error-output* "~&~A: Warning: ~A~%"
                                  (file-location warning)
                                  warning)
                          (incf warnings)
-                         (invoke-restart 'muffle-warning)))
+                         (muffle-warning warning)))
               (information (lambda (info)
                              (format *error-output* "~&~A: Info: ~A~%"
                                      (file-location info)
                                      info)
-                         (invoke-restart 'noted))))
+                             (noted info))))
            (values (funcall thunk)
                    errors
                    warnings)))