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

Method matchSymbol

src/jvm/clojure/lang/EdnReader.java:289–311  ·  view source on GitHub ↗
(String s)

Source from the content-addressed store, hash-verified

287
288
289private static Object matchSymbol(String s){
290 Matcher m = symbolPat.matcher(s);
291 if(m.matches())
292 {
293 int gc = m.groupCount();
294 String ns = m.group(1);
295 String name = m.group(2);
296 if(ns != null && ns.endsWith(":/")
297 || name.endsWith(":")
298 || s.indexOf("::", 1) != -1)
299 return null;
300 if(s.startsWith("::"))
301 {
302 return null;
303 }
304 boolean isKeyword = s.charAt(0) == ':';
305 Symbol sym = Symbol.intern(s.substring(isKeyword ? 1 : 0));
306 if(isKeyword)
307 return Keyword.intern(sym);
308 return sym;
309 }
310 return null;
311}
312
313
314private static Object matchNumber(String s){

Callers 1

interpretTokenMethod · 0.95

Calls 3

internMethod · 0.95
internMethod · 0.95
indexOfMethod · 0.45

Tested by

no test coverage detected