From 0e43dbcc9599e1806d062703b69ebeb131a0f706 Mon Sep 17 00:00:00 2001 From: Christophe Rhodes Date: Sat, 26 Jun 2004 14:43:50 +0000 Subject: [PATCH] 0.8.12.3: Fix (get-macro-character #\Space) ... now returns NIL, not undefined-macro-char ... tests for the standard characters --- NEWS | 3 +++ src/code/reader.lisp | 7 ++++--- tests/reader.pure.lisp | 34 ++++++++++++++++++++++++++++++++++ version.lisp-expr | 2 +- 4 files changed, 42 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index 60ac550..1284e6a 100644 --- a/NEWS +++ b/NEWS @@ -2562,6 +2562,9 @@ changes in sbcl-0.8.13 relative to sbcl-0.8.12: * fixed bug #333: CHECK-TYPE now ensures that the type error signalled, if any, has the right object to be accessed by TYPE-ERROR-DATUM. (reported by Tony Martinez) + * fixed a bug: #\Space (and other whitespace characters) are no + longer considered to be macro characters in standard syntax by + GET-MACRO-CHARACTER. planned incompatible changes in 0.8.x: * (not done yet, but planned:) When the profiling interface settles diff --git a/src/code/reader.lisp b/src/code/reader.lisp index b5c5e73..0f2df53 100644 --- a/src/code/reader.lisp +++ b/src/code/reader.lisp @@ -276,6 +276,7 @@ (let ((*readtable* *standard-readtable*)) (flet ((whitespaceify (char) + (set-cmt-entry char nil) (set-cat-entry char +char-attr-whitespace+))) (whitespaceify (code-char tab-char-code)) (whitespaceify #\linefeed) @@ -284,7 +285,7 @@ (whitespaceify (code-char return-char-code))) (set-cat-entry #\\ +char-attr-escape+) - (set-cmt-entry #\\ #'read-token) + (set-cmt-entry #\\ nil) ;; Easy macro-character definitions are in this source file. (set-macro-character #\" #'read-string) @@ -301,8 +302,8 @@ ((= ichar #O200)) (setq char (code-char ichar)) (when (constituentp char *standard-readtable*) - (set-cat-entry char (get-secondary-attribute char)) - (set-cmt-entry char nil))))) + (set-cat-entry char (get-secondary-attribute char)) + (set-cmt-entry char nil))))) ;;;; implementation of the read buffer diff --git a/tests/reader.pure.lisp b/tests/reader.pure.lisp index 3a54591..be7f77c 100644 --- a/tests/reader.pure.lisp +++ b/tests/reader.pure.lisp @@ -173,3 +173,37 @@ (loop for i from 2 to 36 do (setq *read-base* i) do (assert (typep (read-from-string symbol-string) 'symbol))))) + +(let ((standard-chars " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ +") + (standard-terminating-macro-chars "\"'(),;`") + (standard-nonterminating-macro-chars "#")) + (flet ((frob (char) + (multiple-value-bind (fun non-terminating-p) + (get-macro-character char) + (cond + ((find char standard-terminating-macro-chars) + (unless (and fun (not non-terminating-p)) + (list char))) + ((find char standard-nonterminating-macro-chars) + (unless (and fun non-terminating-p) + (list char))) + (t (unless (and (not fun) (not non-terminating-p)) + (list char))))))) + (let ((*readtable* (copy-readtable nil))) + (assert (null (loop for c across standard-chars append (frob c))))))) + +(let ((standard-chars " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ +") + (undefined-chars "!\"$%&,;>?@[]^_`~{}/dDeEfFgGhHiIjJkKlLmMnNqQtTuUvVwWyYzZ")) + (flet ((frob (char) + (let ((fun (get-dispatch-macro-character #\# char))) + (cond + ((find char undefined-chars) + (when fun (list char))) + ((digit-char-p char 10) + (when fun (list char))) + (t + (unless fun (list char))))))) + (let ((*readtable* (copy-readtable nil))) + (assert (null (loop for c across standard-chars append (frob c))))))) diff --git a/version.lisp-expr b/version.lisp-expr index 87145a1..a554b97 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.2" +"0.8.12.3" -- 1.7.10.4