[armedbear-cvs] r14358 - in branches/1.1.x: src/org/armedbear/lisp test/lisp/abcl

mevenson at common-lisp.net mevenson at common-lisp.net
Wed Jan 16 12:28:41 UTC 2013


Author: mevenson
Date: Wed Jan 16 04:28:40 2013
New Revision: 14358

Log:
Backport r14357 | mevenson | 2013-01-16 13:27:33 +0100 (Wed, 16 Jan 2013) | 3 lines.

Fixes #294: Reader doesn't recognize terminating characters in some cases.

Patch and test by Stas.

Modified:
   branches/1.1.x/src/org/armedbear/lisp/Stream.java
   branches/1.1.x/test/lisp/abcl/bugs.lisp

Modified: branches/1.1.x/src/org/armedbear/lisp/Stream.java
==============================================================================
--- branches/1.1.x/src/org/armedbear/lisp/Stream.java	Wed Jan 16 04:27:33 2013	(r14357)
+++ branches/1.1.x/src/org/armedbear/lisp/Stream.java	Wed Jan 16 04:28:40 2013	(r14358)
@@ -739,18 +739,11 @@
     private static final boolean isTokenDelimiter(char c, Readtable rt)
 
     {
-        switch (c) {
-        case '"':
-        case '\'':
-        case '(':
-        case ')':
-        case ',':
-        case ';':
-        case '`':
-            return true;
-        default:
-            return rt.isWhitespace(c);
-        }
+        byte type = rt.getSyntaxType(c);
+
+        return type == Readtable.SYNTAX_TYPE_TERMINATING_MACRO ||
+                type == Readtable.SYNTAX_TYPE_WHITESPACE;
+        
     }
 
     public LispObject readDispatchChar(char dispChar,
@@ -909,7 +902,8 @@
                 c = (char) n; // ### BUG: Codepoint conversion
                 if (rt.isWhitespace(c))
                     break;
-                if (c == '(' || c == ')') {
+                if (rt.getSyntaxType(c) == 
+                    Readtable.SYNTAX_TYPE_TERMINATING_MACRO) {
                     _unreadChar(c);
                     break;
                 }

Modified: branches/1.1.x/test/lisp/abcl/bugs.lisp
==============================================================================
--- branches/1.1.x/test/lisp/abcl/bugs.lisp	Wed Jan 16 04:27:33 2013	(r14357)
+++ branches/1.1.x/test/lisp/abcl/bugs.lisp	Wed Jan 16 04:28:40 2013	(r14358)
@@ -133,3 +133,11 @@
        :collecting (cons x y))
   ((0.0 . 0) (0.0 . 1)))
 
+
+;; http://trac.common-lisp.net/armedbear/ticket/294
+(deftest bugs.reader.1
+    (let ((*readtable* *readtable*))
+      (set-macro-character #\? (lambda (stream char) (code-char (read stream nil nil t))))
+      '(a .?0))
+  (A . #\Null))
+      




More information about the armedbear-cvs mailing list