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

Method readNumber

src/jvm/clojure/lang/EdnReader.java:206–226  ·  view source on GitHub ↗
(PushbackReader r, char initch)

Source from the content-addressed store, hash-verified

204}
205
206static private Object readNumber(PushbackReader r, char initch) {
207 StringBuilder sb = new StringBuilder();
208 sb.append(initch);
209
210 for(; ;)
211 {
212 int ch = read1(r);
213 if(ch == -1 || isWhitespace(ch) || isMacro(ch))
214 {
215 unread(r, ch);
216 break;
217 }
218 sb.append((char) ch);
219 }
220
221 String s = sb.toString();
222 Object n = matchNumber(s);
223 if(n == null)
224 throw new NumberFormatException("Invalid number: " + s);
225 return n;
226}
227
228static private int readUnicodeChar(String token, int offset, int length, int base) {
229 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