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

Method parse

src/jvm/clojure/lang/Compiler.java:3330–3361  ·  view source on GitHub ↗
(C context, Object frm)

Source from the content-addressed store, hash-verified

3328
3329 static class Parser implements IParser{
3330 public Expr parse(C context, Object frm) {
3331 ISeq form = (ISeq) frm;
3332 //(if test then) or (if test then else)
3333 if(form.count() > 4)
3334 throw Util.runtimeException("Too many arguments to if");
3335 else if(form.count() < 3)
3336 throw Util.runtimeException("Too few arguments to if");
3337 PathNode branch = new PathNode(PATHTYPE.BRANCH, (PathNode) CLEAR_PATH.get());
3338 Expr testexpr = analyze(context == C.EVAL ? context : C.EXPRESSION, RT.second(form));
3339 Expr thenexpr, elseexpr;
3340 try {
3341 Var.pushThreadBindings(
3342 RT.map(CLEAR_PATH, new PathNode(PATHTYPE.PATH,branch)));
3343 thenexpr = analyze(context, RT.third(form));
3344 }
3345 finally{
3346 Var.popThreadBindings();
3347 }
3348 try {
3349 Var.pushThreadBindings(
3350 RT.map(CLEAR_PATH, new PathNode(PATHTYPE.PATH,branch)));
3351 elseexpr = analyze(context, RT.fourth(form));
3352 }
3353 finally{
3354 Var.popThreadBindings();
3355 }
3356 return new IfExpr(lineDeref(),
3357 columnDeref(),
3358 testexpr,
3359 thenexpr,
3360 elseexpr);
3361 }
3362 }
3363}
3364

Callers

nothing calls this directly

Calls 12

runtimeExceptionMethod · 0.95
secondMethod · 0.95
pushThreadBindingsMethod · 0.95
mapMethod · 0.95
thirdMethod · 0.95
popThreadBindingsMethod · 0.95
fourthMethod · 0.95
analyzeMethod · 0.80
lineDerefMethod · 0.80
columnDerefMethod · 0.80
countMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected