Changeset 13508


Ignore:
Timestamp:
08/16/11 09:49:25 (10 years ago)
Author:
Mark Evenson
Message:

Fix #148: READTABLE-CASE :invert doesn't work for symbols.

A slightly modified version of the patch provided by Ole Arnedt with a
test.

Location:
trunk/abcl
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/src/org/armedbear/lisp/Stream.java

    r13461 r13508  
    546546        final Readtable rt =
    547547            (Readtable) Symbol.CURRENT_READTABLE.symbolValue(LispThread.currentThread());
    548         StringBuilder sb = new StringBuilder();
    549         _readToken(sb, rt);
    550         return new Symbol(sb.toString());
     548        return readSymbol(rt);
    551549    }
    552550
    553551    public LispObject readSymbol(Readtable rt) {
    554         StringBuilder sb = new StringBuilder();
    555         _readToken(sb, rt);
    556         return new Symbol(sb.toString());
     552        final StringBuilder sb = new StringBuilder();
     553        final BitSet flags = _readToken(sb, rt);
     554        return new Symbol(rt.getReadtableCase() == Keyword.INVERT
     555                          ? invert(sb.toString(), flags)
     556                          : sb.toString());
    557557    }
    558558
  • trunk/abcl/test/lisp/abcl/bugs.lisp

    r12606 r13508  
    7272               
    7373                   
    74                    
     74
     75(deftest bugs.readtable-case.1
     76  (let (original-case result)
     77    (setf original-case (readtable-case *readtable*)
     78          (readtable-case *readtable*) :invert
     79          result (list (string (read-from-string "lower"))
     80                       (string (read-from-string "UPPER"))
     81                       (string (read-from-string "#:lower"))
     82                       (string (read-from-string "#:UPPER")))
     83          (readtable-case *readtable*) original-case)
     84    (values-list result))
     85  "LOWER" "upper" "LOWER" "upper")
Note: See TracChangeset for help on using the changeset viewer.