chiark / gitweb /
src/**/*.lisp: Use convenience functions to invoke restarts.
[sod] / src / parser / floc-proto.lisp
index f65ed738671afeb12ec830f69514fcfe15346f84..3a111237cd8a76ba585011157c30e65b77b6a8a3 100644 (file)
@@ -134,7 +134,7 @@ (export 'simple-information)
 (define-condition simple-information (simple-condition information)
   ())
 
-(export '(info noted))
+(export 'info)
 (defun info (datum &rest arguments)
   "Report some useful diagnostic information.
 
@@ -145,6 +145,11 @@ (defun info (datum &rest arguments)
       (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)
@@ -342,18 +347,18 @@ (defun count-and-report-errors* (thunk)
                          (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)))