use of java.lang.NumberFormatException in project clochure by videlalvaro.
the class LispReader method readNumber.
private static Object readNumber(PushbackReader r, char initch) {
StringBuilder sb = new StringBuilder();
sb.append(initch);
for (; ; ) {
int ch = read1(r);
if (ch == -1 || isWhitespace(ch) || isMacro(ch)) {
unread(r, ch);
break;
}
sb.append((char) ch);
}
String s = sb.toString();
Object n = matchNumber(s);
if (n == null)
throw new NumberFormatException("Invalid number: " + s);
return n;
}
Aggregations