Changeset 14209
- Timestamp:
- 10/21/12 16:09:53 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abcl/src/org/armedbear/lisp/ConcatenatedStream.java
r12513 r14209 128 128 public LispObject listen() 129 129 { 130 if (unreadChar >= 0)131 return T;132 130 if (streams == NIL) 133 131 return NIL; 134 LispObject obj = readCharNoHang(false, this); 135 if (obj == this) 136 return NIL; 137 unreadChar = ((LispCharacter)obj).getValue(); 138 return T; 139 } 140 141 private int unreadChar = -1; 132 Stream stream = (Stream)streams.car(); 133 return stream.listen(); 134 } 142 135 143 136 // Returns -1 at end of file. … … 146 139 { 147 140 int n; 148 if (unreadChar >= 0) {149 n = unreadChar;150 unreadChar = -1;151 return n;152 }153 141 if (streams == NIL) 154 142 return -1; … … 162 150 163 151 @Override 164 protected void _unreadChar(int n) 165 { 166 if (unreadChar >= 0) 167 error(new StreamError(this, "UNREAD-CHAR was invoked twice consecutively without an intervening call to READ-CHAR.")); 168 unreadChar = n; 152 protected void _unreadChar(int n) throws java.io.IOException 153 { 154 if (streams == NIL) 155 error(new StreamError(this, "UNREAD-CHAR was invoked without a stream to unread into.")); 156 Stream stream = (Stream)streams.car(); 157 158 stream._unreadChar(n); 169 159 } 170 160 … … 172 162 protected boolean _charReady() throws java.io.IOException 173 163 { 174 if (unreadChar >= 0)175 return true;176 164 if (streams == NIL) 177 165 return false;
Note: See TracChangeset
for help on using the changeset viewer.