Commit cb1799cd authored by mevenson@1c010e3e-69d0-11dd-93a8-456734b0d56f's avatar mevenson@1c010e3e-69d0-11dd-93a8-456734b0d56f
Browse files

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

A slightly modified version of the patch provided by Ole Arnedt with a
test.
parent 4fdc2d35
......@@ -545,15 +545,15 @@ public class Stream extends StructureObject {
public LispObject readSymbol() {
final Readtable rt =
(Readtable) Symbol.CURRENT_READTABLE.symbolValue(LispThread.currentThread());
StringBuilder sb = new StringBuilder();
_readToken(sb, rt);
return new Symbol(sb.toString());
return readSymbol(rt);
}
public LispObject readSymbol(Readtable rt) {
StringBuilder sb = new StringBuilder();
_readToken(sb, rt);
return new Symbol(sb.toString());
final StringBuilder sb = new StringBuilder();
final BitSet flags = _readToken(sb, rt);
return new Symbol(rt.getReadtableCase() == Keyword.INVERT
? invert(sb.toString(), flags)
: sb.toString());
}
public LispObject readStructure(ReadtableAccessor rta) {
......
......@@ -71,4 +71,15 @@ Subject: [armedbear-devel] Bug in translate-logical-pathname.
stream)
\ No newline at end of file
(deftest bugs.readtable-case.1
(let (original-case result)
(setf original-case (readtable-case *readtable*)
(readtable-case *readtable*) :invert
result (list (string (read-from-string "lower"))
(string (read-from-string "UPPER"))
(string (read-from-string "#:lower"))
(string (read-from-string "#:UPPER")))
(readtable-case *readtable*) original-case)
(values-list result))
"LOWER" "upper" "LOWER" "upper")
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment