From: Andreas Fuchs Date: Mon, 19 Jul 2004 20:24:21 +0000 (+0000) Subject: 0.8.12.39: X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;ds=sidebyside;h=4fe24806cb00efee6bbd64f6575eadb3cedcb224;p=sbcl.git 0.8.12.39: Add a FATAL-COMPILER-ERROR to indicate fatal file compiler errors. This is a change to make SLIME handle READ errors on file compilation better. * export a FATAL-COMPILER-ERROR * Make input-error-in-compile-file inherit from that. * re-signal the FATAL-COMPILER-ERROR condition from sub-compile-file so that SLIME has a remote chance of noticing what is going on --- diff --git a/package-data-list.lisp-expr b/package-data-list.lisp-expr index 7a235f7..f41aa60 100644 --- a/package-data-list.lisp-expr +++ b/package-data-list.lisp-expr @@ -213,7 +213,7 @@ of SBCL which maintained the CMU-CL-style split into two packages.)" "CODE-CONSTANT-REF" "CODE-CONSTANT-SET" "COMPILE-IN-LEXENV" "COMPILE-LAMBDA-FOR-DEFUN" - "%COMPILER-DEFUN" "COMPILER-ERROR" + "%COMPILER-DEFUN" "COMPILER-ERROR" "FATAL-COMPILER-ERROR" "COMPILER-NOTIFY" "COMPILER-STYLE-WARN" "COMPILER-WARN" "COMPONENT" "COMPONENT-HEADER-LENGTH" diff --git a/src/compiler/compiler-error.lisp b/src/compiler/compiler-error.lisp index ea8310c..a9b6ef5 100644 --- a/src/compiler/compiler-error.lisp +++ b/src/compiler/compiler-error.lisp @@ -115,13 +115,19 @@ :message ,(princ-to-string condition) :source ,(princ-to-string source))) +;;; Fatal compiler errors. We export FATAL-COMPILER-ERROR as an +;;; interface for errors that kill the compiler dead +;;; +;;; These are not a COMPILER-ERRORs, since we don't try to recover +;;; from them and keep chugging along, but instead immediately bail +;;; out of the entire COMPILE-FILE. + +(define-condition fatal-compiler-error (encapsulated-condition) + ()) + ;;; the condition of COMPILE-FILE being unable to READ from the ;;; source file ;;; -;;; This is not a COMPILER-ERROR, since we don't try to recover from -;;; it and keep chugging along, but instead immediately bail out of -;;; the entire COMPILE-FILE. -;;; ;;; (The old CMU CL code did try to recover from this condition, but ;;; the code for doing that was messy and didn't always work right. ;;; Since in Common Lisp the simple act of reading and compiling code @@ -130,11 +136,8 @@ ;;; deeply confused, so we violate what'd otherwise be good compiler ;;; practice by not trying to recover from this error and bailing out ;;; instead.) -(define-condition input-error-in-compile-file (error) - (;; the original error which was trapped to produce this condition - (error :reader input-error-in-compile-file-error - :initarg :error) - ;; the position where the bad READ began, or NIL if unavailable, +(define-condition input-error-in-compile-file (fatal-compiler-error) + (;; the position where the bad READ began, or NIL if unavailable, ;; redundant, or irrelevant (position :reader input-error-in-compile-file-position :initarg :position @@ -146,4 +149,4 @@ 'read 'compile-file (input-error-in-compile-file-position condition) - (input-error-in-compile-file-error condition))))) + (encapsulated-condition condition))))) diff --git a/src/compiler/main.lisp b/src/compiler/main.lisp index 3a96c2b..33637bf 100644 --- a/src/compiler/main.lisp +++ b/src/compiler/main.lisp @@ -727,7 +727,7 @@ (handler-case (read stream nil stream) (reader-error (condition) (error 'input-error-in-compile-file - :error condition + :condition condition ;; We don't need to supply :POSITION here because ;; READER-ERRORs already know their position in the file. )) @@ -736,7 +736,7 @@ ;; file in the middle of something it's trying to read. (end-of-file (condition) (error 'input-error-in-compile-file - :error condition + :condition condition ;; We need to supply :POSITION here because the END-OF-FILE ;; condition doesn't carry the position that the user ;; probably cares about, where the failed READ began. @@ -1438,9 +1438,10 @@ ;; Some errors are sufficiently bewildering that we just fail ;; immediately, without trying to recover and compile more of ;; the input file. - (input-error-in-compile-file (condition) + (fatal-compiler-error (condition) + (signal condition) (format *error-output* - "~@" + "~@" condition) (values nil t t))))) diff --git a/version.lisp-expr b/version.lisp-expr index ee2715d..18e3493 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"0.8.12.38" +"0.8.12.39"