[slime-cvs] CVS update: slime/swank-source-path-parser.lisp

Helmut Eller heller at common-lisp.net
Tue Oct 26 00:33:13 UTC 2004


Update of /project/slime/cvsroot/slime
In directory common-lisp.net:/tmp/cvs-serv9814

Modified Files:
	swank-source-path-parser.lisp 
Log Message:
Remove workarounds for SBCL bugs.  The bugs are fixed in the versions
we support.
Date: Tue Oct 26 02:33:13 2004
Author: heller

Index: slime/swank-source-path-parser.lisp
diff -u slime/swank-source-path-parser.lisp:1.7 slime/swank-source-path-parser.lisp:1.8
--- slime/swank-source-path-parser.lisp:1.7	Fri Aug 13 22:32:33 2004
+++ slime/swank-source-path-parser.lisp	Tue Oct 26 02:33:13 2004
@@ -22,6 +22,12 @@
 
 (in-package :swank-backend)
 
+;; Some test to ensure the required conformance
+(let ((rt (copy-readtable nil)))
+  (assert (or (not (get-macro-character #\space rt))
+	      (nth-value 1 (get-macro-character #\space rt))))
+  (assert (not (get-macro-character #\\ rt))))
+
 (defun make-source-recorder (fn source-map)
   "Return a macro character function that does the same as FN, but
 additionally stores the result together with the stream positions
@@ -36,70 +42,6 @@
 	(push (cons start end) (gethash (car values) source-map)))
       (values-list values))))
 
-#+sbcl
-;; not sure why this should be the case, but SBCL 0.8.6 returns
-;; #<FUNCTION "top level local call SB!IMPL::UNDEFINED-MACRO-CHAR">
-;; for (get-macro-character) on characters that aren't macros.
-;; As there's no way to detect the syntax of a character (only
-;; to set it from another character) we have to compare against
-;; this undefined-macro function to avoid turning everything into
-;; a macro  -- Dan Barlow
-(if (not (get-macro-character #\space nil))
-    (defun cmucl-style-get-macro-character (char table)
-      (get-macro-character char table))
-    (defun cmucl-style-get-macro-character (char table)
-      (let ((rt (or table sb-impl::*standard-readtable*)))
-	(cond ((sb-impl::constituentp char)
-	       (values (sb-impl::get-coerced-cmt-entry char rt) t))
-	      ((sb-impl::terminating-macrop char)
-	       (values (sb-impl::get-coerced-cmt-entry char rt) nil))
-	      (t 
-	       (values nil nil))))))
-
-#+cmu
-(defun cmucl-style-get-macro-character (char table)
-  (get-macro-character char table))
-
-;; Unlike CMUCL, SBCL stores NIL values into the character-macro-table
-;; for constituent (in the CL sense) chars, and uses
-;; get-coerced-cmt-entry to convert those NILs to #'read-token.  In
-;; CMUCL all constituents are also macro-chars.
-;;
-;; CMUCL and SBCL use a somewhat strange encoding for CL's Character
-;; Syntax Types:
-;;
-;;  CL                    Implementation
-;;  ----------------	  --------------
-;;  Constituent           (constituentp x) i.e. (<= +char-attr-constituent+ x)
-;;  Macro Char            (constituentp x) or +char-attr-terminating-macro+ 
-;;  Single Escape         +char-attr-escape+
-;;  Invalid               (constituentp x) with undefined-macro-char as fun
-;;  Multiple Escape       +char-attr-multiple-escape+
-;;  Whitespace            +char-attr-whitespace+
-;;
-;; One effect of this encoding is that invalid chars are not detected
-;; inside tokens and it seems that there's no good way to distinguish
-;; constituents from macro-chars.
-
-(defun dump-readtable (rt)
-  (dotimes (code char-code-limit)
-    (let ((char (code-char code)))
-      (multiple-value-bind (fn terminatingp) (get-macro-character char rt)
-      (format t "~S[~D]: ~12,1T~A ~A~%" 
-	      char code fn terminatingp)))))
-			 
-;; (dump-readtable *readtable*)
-
-(let ((rt (copy-readtable nil)))
-  ;; If #\space is a macro-char, it shouldn't terminate tokens.
-  (assert (or (not (cmucl-style-get-macro-character #\space rt))
-	      (nth-value 1 (cmucl-style-get-macro-character #\space rt))))
-  ;; In SBCL (get-macro-character #\\) returns #'read-token, t.  And
-  ;; (set-macro-character #\\ #'read-token t) confuses #'read-string,
-  ;; because it uses the attributes in the readtable for parsing
-  ;; decisions.
-  (assert (not (cmucl-style-get-macro-character #\\ rt))))
-
 (defun make-source-recording-readtable (readtable source-map) 
   "Return a source position recording copy of READTABLE.
 The source locations are stored in SOURCE-MAP."
@@ -107,8 +49,7 @@
 	 (*readtable* tab))
     (dotimes (code char-code-limit)
       (let ((char (code-char code)))
-	(multiple-value-bind (fn term) 
-	    (cmucl-style-get-macro-character char tab)
+	(multiple-value-bind (fn term) (get-macro-character char tab)
 	  (when fn
 	    (set-macro-character char (make-source-recorder fn source-map) 
 				 term tab)))))





More information about the slime-cvs mailing list