[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] externals/sly 7bad394 09/47: Improve compiler messages for Clas
From: |
ELPA Syncer |
Subject: |
[nongnu] externals/sly 7bad394 09/47: Improve compiler messages for Clasp |
Date: |
Thu, 17 Dec 2020 18:57:14 -0500 (EST) |
branch: externals/sly
commit 7bad394c743902b5162c0810c8d865b2644b63ea
Author: Chris Schafmeister <meister@temple.edu>
Commit: João Távora <joaotavora@gmail.com>
Improve compiler messages for Clasp
* slynk/backend/clasp.lisp: Rework.
Cherry-picked-from: SLIME commit 01531b09debe1199d9726ed91c4672cd9587fb58
Co-authored-by: Manfred Bergmann <manfred@nnamgreb.de>
Co-authored-by: João Távora <joaotavora@gmail.com>
---
slynk/backend/clasp.lisp | 82 +++++++++++++++++++++---------------------------
1 file changed, 35 insertions(+), 47 deletions(-)
diff --git a/slynk/backend/clasp.lisp b/slynk/backend/clasp.lisp
index b893ab3..27f72f9 100644
--- a/slynk/backend/clasp.lisp
+++ b/slynk/backend/clasp.lisp
@@ -39,15 +39,7 @@
;;; Slynk-mop
(eval-when (:compile-toplevel :load-toplevel :execute)
- (import-slynk-mop-symbols
- :clos
- nil
- #+(or)`(:eql-specializer
- :eql-specializer-object
- :generic-function-declarations
- :specializer-direct-methods
- ,@(unless (fboundp 'clos:compute-applicable-methods-using-classes)
- '(:compute-applicable-methods-using-classes)))))
+ (import-slynk-mop-symbols :clos nil))
(defimplementation gray-package-name ()
"GRAY")
@@ -56,12 +48,6 @@
;;;; TCP Server
(defimplementation preferred-communication-style ()
- ;; As of March 2017 CLASP provides threads.
- ;; But it's experimental.
- ;; ECLs slynk implementation says that CLOS is not thread safe and
- ;; I use ECLs CLOS implementation - this is a worry for the future.
- ;; nil or :spawn
- ;; nil
:spawn
#| #+threads :spawn
#-threads nil
@@ -230,44 +216,46 @@
(defvar *buffer-name* nil)
(defvar *buffer-start-position*)
-(defun signal-compiler-condition (&rest args)
- (apply #'signal 'compiler-condition args))
-
-#-clasp-bytecmp
-(defun handle-compiler-message (condition)
- ;; CLASP emits lots of noise in compiler-notes, like "Invoking
- ;; external command".
- (unless (typep condition 'c::compiler-note)
- (signal-compiler-condition
- :original-condition condition
- :message (princ-to-string condition)
- :severity (etypecase condition
- (cmp:compiler-fatal-error :error)
- (cmp:compiler-error :error)
- (error :error)
- (style-warning :style-warning)
- (warning :warning))
- :location (condition-location condition))))
-
-#-clasp-bytecmp
-(defun condition-location (condition)
- (let ((file (cmp:compiler-message-file condition))
- (position (cmp:compiler-message-file-position condition)))
- (if (and position (not (minusp position)))
+(defun condition-severity (condition)
+ (etypecase condition
+ (cmp:redefined-function-warning :redefinition)
+ (style-warning :style-warning)
+ (warning :warning)
+ (reader-error :read-error)
+ (error :error)))
+
+(defun condition-location (origin)
+ (if (null origin)
+ (make-error-location "No error location available")
+ (let ((location (core:source-pos-info-filepos origin)))
(if *buffer-name*
(make-buffer-location *buffer-name*
*buffer-start-position*
- position)
- (make-file-location file position))
- (make-error-location "No location found."))))
+ location)
+ (make-file-location
+ (core:source-file-info-pathname
+ (core:source-file-info origin))
+ location)))))
+
+(defun signal-compiler-condition (condition origin)
+ (signal 'compiler-condition
+ :original-condition condition
+ :severity (condition-severity condition)
+ :message (princ-to-string condition)
+ :location (condition-location origin)))
+
+(defun handle-compiler-condition (condition)
+ ;; First resignal warnings, so that outer handlers - which may choose to
+ ;; muffle this - get a chance to run.
+ (when (typep condition 'warning)
+ (signal condition))
+ (signal-compiler-condition (cmp:deencapsulate-compiler-condition condition)
+ (cmp:compiler-condition-origin condition)))
(defimplementation call-with-compilation-hooks (function)
- (funcall function))
-#|| #-clasp-bytecmp
- (handler-bind ((c:compiler-message #'handle-compiler-message))
+ (handler-bind
+ (((or error warning) #'handle-compiler-condition))
(funcall function)))
-||#
-
(defimplementation slynk-compile-file (input-file output-file
load-p external-format
- [nongnu] externals/sly updated (0207e2d -> e927cda), ELPA Syncer, 2020/12/17
- [nongnu] externals/sly 7ea4480 16/47: Clasp changes to use the new line keyword arg, ELPA Syncer, 2020/12/17
- [nongnu] externals/sly 6662cf2 29/47: sbcl: Ignore DEFGENERICs without location, ELPA Syncer, 2020/12/17
- [nongnu] externals/sly c41b298 36/47: clasp.lisp changes to use new clasp-debug pkg, ELPA Syncer, 2020/12/17
- [nongnu] externals/sly d8c926f 42/47: sbcl: account for SB-DI::DEBUG-FUN-DEBUG-VARS returning NIL, ELPA Syncer, 2020/12/17
- [nongnu] externals/sly 7c7f23b 46/47: Default *STRING-ELISION-LEGNTH* to 200 in *SLYNK-PPRINT-BINDINGS*, ELPA Syncer, 2020/12/17
- [nongnu] externals/sly 7bad394 09/47: Improve compiler messages for Clasp,
ELPA Syncer <=
- [nongnu] externals/sly c4c7ae5 13/47: slynk-abcl: fix typo, ELPA Syncer, 2020/12/17
- [nongnu] externals/sly c794fe6 30/47: Remove recursive locks for clasp, ELPA Syncer, 2020/12/17
- [nongnu] externals/sly 57ffb2a 33/47: sbcl: fix access to &more vars in the debugger, ELPA Syncer, 2020/12/17
- [nongnu] externals/sly dcfe556 02/47: Fixed sldb and backtraces in clasp, ELPA Syncer, 2020/12/17
- [nongnu] externals/sly 1dbf876 04/47: ecl: frame-source-location: return error if frame source not found, ELPA Syncer, 2020/12/17
- [nongnu] externals/sly cd85cf6 35/47: Improve xref definitions for M-. in clasp, ELPA Syncer, 2020/12/17
- [nongnu] externals/sly 6785833 37/47: clasp: implement profiling via metering, ELPA Syncer, 2020/12/17
- [nongnu] externals/sly 1346967 38/47: Remove use of compatibility accessors, ELPA Syncer, 2020/12/17
- [nongnu] externals/sly e914200 07/47: wait-for-input: better "not implemented" error., ELPA Syncer, 2020/12/17
- [nongnu] externals/sly e883812 11/47: Fix SLYNK-SBCL:COMPILER-NOTE-LOCATION for non-file-backed streams, ELPA Syncer, 2020/12/17