Changeset 12595
- Timestamp:
- 04/10/10 20:28:06 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abcl/src/org/armedbear/lisp/Stream.java
r12594 r12595 431 431 { 432 432 LispObject result = readPreservingWhitespace(eofError, eofValue, 433 recursive, thread); 433 recursive, thread, 434 currentReadtable); 434 435 if (result != eofValue && !recursive) { 435 436 try { … … 461 462 LispObject eofValue, 462 463 boolean recursive, 463 LispThread thread) 464 LispThread thread, 465 ReadtableAccessor rta) 464 466 465 467 { 466 468 if (recursive) { 467 final Readtable rt = (Readtable) Symbol.CURRENT_READTABLE.symbolValue(thread);469 final Readtable rt = rta.rt(thread); 468 470 while (true) { 469 471 int n = -1; … … 491 493 thread.bindSpecial(_SHARP_EQUAL_ALIST_, NIL); 492 494 try { 493 return readPreservingWhitespace(eofError, eofValue, true, thread); 495 return readPreservingWhitespace(eofError, eofValue, true, 496 thread, rta); 494 497 } finally { 495 498 thread.resetSpecialBindings(mark); … … 503 506 { 504 507 try { 505 LispObject result = faslReadPreservingWhitespace(eofError, eofValue, 506 recursive, thread); 508 LispObject result = 509 readPreservingWhitespace(eofError, eofValue, recursive, 510 thread, faslReadtable); 507 511 if (result != eofValue && !recursive) { 508 512 if (_charReady()) { … … 522 526 } catch (IOException e) { 523 527 return error(new StreamError(this, e)); 524 }525 }526 527 private final LispObject faslReadPreservingWhitespace(boolean eofError,528 LispObject eofValue,529 boolean recursive,530 LispThread thread)531 throws IOException {532 if (recursive) {533 final Readtable rt = FaslReadtable.getInstance();534 while (true) {535 int n = _readChar();536 if (n < 0) {537 if (eofError)538 return error(new EndOfFile(this));539 else540 return eofValue;541 }542 char c = (char) n; // ### BUG: Codepoint conversion543 if (rt.isWhitespace(c))544 continue;545 LispObject result = processChar(c, rt);546 if (result != null)547 return result;548 }549 } else {550 final SpecialBindingsMark mark = thread.markSpecialBindings();551 thread.bindSpecial(_SHARP_EQUAL_ALIST_, NIL);552 try {553 return faslReadPreservingWhitespace(eofError, eofValue, true, thread);554 } finally {555 thread.resetSpecialBindings(mark);556 }557 528 } 558 529 } … … 2266 2237 if (preserveWhitespace) 2267 2238 result = in.readPreservingWhitespace(eofError, third, false, 2268 thread );2239 thread, currentReadtable); 2269 2240 else 2270 2241 result = in.read(eofError, third, false, thread); … … 2351 2322 return stream.readPreservingWhitespace(eofError, eofValue, 2352 2323 recursive, 2353 LispThread.currentThread()); 2324 LispThread.currentThread(), 2325 currentReadtable); 2354 2326 } 2355 2327 };
Note: See TracChangeset
for help on using the changeset viewer.