emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/sly 7a3ec7db64 2/5: Improve source position info handling


From: ELPA Syncer
Subject: [nongnu] elpa/sly 7a3ec7db64 2/5: Improve source position info handling in clasp
Date: Wed, 13 Jul 2022 10:59:18 -0400 (EDT)

branch: elpa/sly
commit 7a3ec7db64932128d4189dbe4c81297ce719438d
Author: Christian Schafmeister <meister@temple.edu>
Commit: João Távora <joaotavora@gmail.com>

    Improve source position info handling in clasp
    
    Source position info in clasp comes in two flavors. A single object that
    stores a source position and a cons cell that stores a start and end
    source position range.  This commit allows slime to recognize them and
    work with both forms.
    
    Cherry-picked-from: SLIME commit 68f5623f13c9a0d3d47ce70cf56928e00483d9d6
---
 slynk/backend/clasp.lisp | 24 ++++++++++++++----------
 1 file changed, 14 insertions(+), 10 deletions(-)

diff --git a/slynk/backend/clasp.lisp b/slynk/backend/clasp.lisp
index 1cb7807f8c..733e67730b 100644
--- a/slynk/backend/clasp.lisp
+++ b/slynk/backend/clasp.lisp
@@ -229,17 +229,21 @@
     (reader-error                   :read-error)
     (error                          :error)))
 
+(defun %condition-location (origin)
+  ;; NOTE: If we're compiling in a buffer, the origin
+  ;; will already be set up with the offset correctly
+  ;; due to the :source-debug parameters from
+  ;; swank-compile-string (below).
+  (make-file-location
+   (core:file-scope-pathname
+    (core:file-scope origin))
+   (core:source-pos-info-filepos origin)))
+
 (defun condition-location (origin)
-  (if (null origin)
-      (make-error-location "No error location available")
-      ;; NOTE: If we're compiling in a buffer, the origin
-      ;; will already be set up with the offset correctly
-      ;; due to the :source-debug parameters from
-      ;; slynk-compile-string (below).
-      (make-file-location
-       (core:file-scope-pathname
-        (core:file-scope origin))
-       (core:source-pos-info-filepos origin))))
+  (typecase origin
+    (null (make-error-location "No error location available"))
+    (cons (%condition-location (car origin)))
+    (t (%condition-location origin))))
 
 (defun signal-compiler-condition (condition origin)
   (signal 'compiler-condition



reply via email to

[Prev in Thread] Current Thread [Next in Thread]