(C context, Object frm)
| 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 |
nothing calls this directly
no test coverage detected