Changeset 12648 for trunk/abcl/src/org/armedbear
- Timestamp:
- 05/02/10 18:30:47 (13 years ago)
- Location:
- trunk/abcl/src/org/armedbear/lisp
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abcl/src/org/armedbear/lisp/Lisp.java
r12607 r12648 352 352 353 353 public static final LispObject error(LispObject condition) 354 355 354 { 356 355 pushJavaStackFrames(); … … 358 357 } 359 358 359 public static final int ierror(LispObject condition) 360 { 361 error(condition); 362 return 0; // Not reached 363 } 364 365 public static final String serror(LispObject condition) 366 { 367 error(condition); 368 return ""; // Not reached 369 } 370 371 360 372 public static final LispObject error(LispObject condition, LispObject message) 361 362 373 { 363 374 pushJavaStackFrames(); 364 375 return Symbol.ERROR.execute(condition, Keyword.FORMAT_CONTROL, message); 365 376 } 377 378 public static final int ierror(LispObject condition, LispObject message) 379 { 380 error(condition, message); 381 return 0; // Not reached 382 } 383 384 public static final String serror(LispObject condition, LispObject message) 385 { 386 error(condition, message); 387 return ""; // Not reached 388 } 389 390 366 391 367 392 public static final LispObject type_error(LispObject datum, -
trunk/abcl/src/org/armedbear/lisp/Stream.java
r12646 r12648 605 605 while (true) { 606 606 int n = _readChar(); 607 if (n < 0) { 608 error(new EndOfFile(this)); 609 // Not reached. 610 return null; 611 } 607 if (n < 0) 608 return error(new EndOfFile(this)); 609 612 610 char c = (char) n; // ### BUG: Codepoint conversion 613 611 if (rt.getSyntaxType(c) == Readtable.SYNTAX_TYPE_SINGLE_ESCAPE) { 614 612 // Single escape. 615 613 n = _readChar(); 616 if (n < 0) { 617 error(new EndOfFile(this)); 618 // Not reached. 619 return null; 620 } 614 if (n < 0) 615 return error(new EndOfFile(this)); 616 621 617 sb.append((char)n); // ### BUG: Codepoint conversion 622 618 continue; … … 971 967 while (true) { 972 968 int n = _readChar(); 973 if (n < 0) { 974 error(new EndOfFile(this)); 975 // Not reached. 976 return null; 977 } 969 if (n < 0) 970 return serror(new EndOfFile(this)); 971 978 972 char c = (char) n; // ### BUG: Codepoint conversion 979 973 byte syntaxType = rt.getSyntaxType(c); 980 974 if (syntaxType == Readtable.SYNTAX_TYPE_SINGLE_ESCAPE) { 981 975 n = _readChar(); 982 if (n < 0) { 983 error(new EndOfFile(this)); 984 // Not reached. 985 return null; 986 } 976 if (n < 0) 977 return serror(new EndOfFile(this)); 978 987 979 sb.append((char)n); // ### BUG: Codepoint conversion 988 980 continue; … … 993 985 } 994 986 } catch (IOException e) { 995 error(new StreamError(this, e));987 return serror(new StreamError(this, e)); 996 988 } 997 989 return sb.toString(); … … 1137 1129 if (n < 0) { 1138 1130 error(new EndOfFile(this)); 1139 // Not reached.1140 return flags;1141 } 1131 return null; // Not reached 1132 } 1133 1142 1134 sb.setCharAt(0, (char) n); // ### BUG: Codepoint conversion 1143 1135 flags = new BitSet(1); … … 1253 1245 if (readBaseObject instanceof Fixnum) { 1254 1246 readBase = ((Fixnum)readBaseObject).value; 1255 } else {1247 } else 1256 1248 // The value of *READ-BASE* is not a Fixnum. 1257 error(new LispError("The value of *READ-BASE* is not of type '(INTEGER 2 36).")); 1258 // Not reached. 1259 return 10; 1260 } 1261 if (readBase < 2 || readBase > 36) { 1262 error(new LispError("The value of *READ-BASE* is not of type '(INTEGER 2 36).")); 1263 // Not reached. 1264 return 10; 1265 } 1249 return ierror(new LispError("The value of *READ-BASE* is not " + 1250 "of type '(INTEGER 2 36).")); 1251 1252 if (readBase < 2 || readBase > 36) 1253 return ierror(new LispError("The value of *READ-BASE* is not " + 1254 "of type '(INTEGER 2 36).")); 1255 1266 1256 return readBase; 1267 1257 } 1268 1258 1269 1259 private final LispObject makeNumber(String token, int length, int radix) 1270 1271 1260 { 1272 1261 if (length == 0) … … 1437 1426 while (true) { 1438 1427 int n = _readChar(); 1439 if (n < 0) { 1440 error(new EndOfFile(this)); 1441 // Not reached. 1442 return 0; 1443 } 1428 if (n < 0) 1429 return (char)ierror(new EndOfFile(this)); 1430 1444 1431 char c = (char) n; // ### BUG: Codepoint conversion 1445 1432 if (!rt.isWhitespace(c)) … … 1863 1850 return n; // Reads an 8-bit byte. 1864 1851 } catch (IOException e) { 1865 error(new StreamError(this, e)); 1866 // Not reached. 1867 return -1; 1852 return ierror(new StreamError(this, e)); 1868 1853 } 1869 1854 }
Note: See TracChangeset
for help on using the changeset viewer.