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

Method parse

src/jvm/clojure/lang/Compiler.java:2507–2534  ·  view source on GitHub ↗
(C context, Object form)

Source from the content-addressed store, hash-verified

2505 static Keyword formKey = Keyword.intern("form");
2506
2507 public Expr parse(C context, Object form){
2508 int argCount = RT.count(form) - 1;
2509 if(argCount != 1){
2510 IPersistentMap exData = new PersistentArrayMap(new Object[]{formKey, form});
2511 throw new ExceptionInfo("Wrong number of args (" +
2512 argCount +
2513 ") passed to quote",
2514 exData);
2515 }
2516 Object v = RT.second(form);
2517
2518 if(v == null)
2519 return NIL_EXPR;
2520 else if(v == Boolean.TRUE)
2521 return TRUE_EXPR;
2522 else if(v == Boolean.FALSE)
2523 return FALSE_EXPR;
2524 if(v instanceof Number)
2525 return NumberExpr.parse((Number)v);
2526 else if(v instanceof String)
2527 return new StringExpr((String) v);
2528 else if(v instanceof IPersistentCollection
2529 && (((IPersistentCollection) v).count() == 0)
2530 && (!(v instanceof IObj) || ((IObj) v).meta() == null))
2531 return new EmptyExpr(v);
2532 else
2533 return new ConstantExpr(v);
2534 }
2535 }
2536}
2537

Callers

nothing calls this directly

Calls 5

countMethod · 0.95
secondMethod · 0.95
parseMethod · 0.95
countMethod · 0.65
metaMethod · 0.65

Tested by

no test coverage detected