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

Method readToken

src/jvm/clojure/lang/EdnReader.java:184–204  ·  view source on GitHub ↗
(PushbackReader r, char initch, boolean leadConstituent)

Source from the content-addressed store, hash-verified

182}
183
184static private String readToken(PushbackReader r, char initch, boolean leadConstituent) {
185 StringBuilder sb = new StringBuilder();
186 if(leadConstituent && nonConstituent(initch))
187 throw Util.runtimeException("Invalid leading character: " + (char)initch);
188
189 sb.append(initch);
190
191 for(; ;)
192 {
193 int ch = read1(r);
194
195 if(ch == -1 || isWhitespace(ch) || isTerminatingMacro(ch))
196 {
197 unread(r, ch);
198 return sb.toString();
199 }
200 else if(nonConstituent(ch))
201 throw Util.runtimeException("Invalid constituent character: " + (char)ch);
202 sb.append((char) ch);
203 }
204}
205
206static private Object readNumber(PushbackReader r, char initch) {
207 StringBuilder sb = new StringBuilder();

Callers 2

readMethod · 0.95
invokeMethod · 0.45

Calls 8

nonConstituentMethod · 0.95
runtimeExceptionMethod · 0.95
read1Method · 0.95
isWhitespaceMethod · 0.95
isTerminatingMacroMethod · 0.95
unreadMethod · 0.95
appendMethod · 0.80
toStringMethod · 0.45

Tested by

no test coverage detected