MCPcopy Index your code
hub / github.com/clojure/clojure / readNumber

Method readNumber

src/jvm/clojure/lang/LispReader.java:336–356  ·  view source on GitHub ↗
(PushbackReader r, char initch)

Source from the content-addressed store, hash-verified

334}
335
336static private Object readNumber(PushbackReader r, char initch) {
337 StringBuilder sb = new StringBuilder();
338 sb.append(initch);
339
340 for(; ;)
341 {
342 int ch = read1(r);
343 if(ch == -1 || isWhitespace(ch) || isMacro(ch))
344 {
345 unread(r, ch);
346 break;
347 }
348 sb.append((char) ch);
349 }
350
351 String s = sb.toString();
352 Object n = matchNumber(s);
353 if(n == null)
354 throw new NumberFormatException("Invalid number: " + s);
355 return n;
356}
357
358static private int readUnicodeChar(String token, int offset, int length, int base) {
359 if(token.length() != offset + length)

Callers 1

readMethod · 0.95

Calls 7

read1Method · 0.95
isWhitespaceMethod · 0.95
isMacroMethod · 0.95
unreadMethod · 0.95
matchNumberMethod · 0.95
appendMethod · 0.80
toStringMethod · 0.45

Tested by

no test coverage detected