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

Method parse

src/jvm/clojure/lang/Compiler.java:3694–3723  ·  view source on GitHub ↗
(C context, IPersistentSet form)

Source from the content-addressed store, hash-verified

3692
3693
3694 static public Expr parse(C context, IPersistentSet form) {
3695 IPersistentVector keys = PersistentVector.EMPTY;
3696 boolean constant = true;
3697
3698 for(ISeq s = RT.seq(form); s != null; s = s.next())
3699 {
3700 Object e = s.first();
3701 Expr expr = analyze(context == C.EVAL ? context : C.EXPRESSION, e);
3702 keys = (IPersistentVector) keys.cons(expr);
3703 if(!(expr instanceof LiteralExpr))
3704 constant = false;
3705 }
3706 Expr ret = new SetExpr(keys);
3707 if(form instanceof IObj && ((IObj) form).meta() != null)
3708 return new MetaExpr(ret, MapExpr
3709 .parse(context == C.EVAL ? context : C.EXPRESSION, ((IObj) form).meta()));
3710 else if(constant)
3711 {
3712 IPersistentSet set = PersistentHashSet.EMPTY;
3713 for(int i=0;i<keys.count();i++)
3714 {
3715 LiteralExpr ve = (LiteralExpr)keys.nth(i);
3716 set = (IPersistentSet)set.cons(ve.val());
3717 }
3718// System.err.println("Constant: " + set);
3719 return new ConstantExpr(set);
3720 }
3721 else
3722 return ret;
3723 }
3724}
3725
3726public static class VectorExpr implements Expr{

Callers 1

analyzeMethod · 0.95

Calls 11

seqMethod · 0.95
nextMethod · 0.95
firstMethod · 0.95
consMethod · 0.95
parseMethod · 0.95
valMethod · 0.95
analyzeMethod · 0.80
metaMethod · 0.65
countMethod · 0.65
nthMethod · 0.65
consMethod · 0.65

Tested by

no test coverage detected