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

Method parse

src/jvm/clojure/lang/Compiler.java:3768–3796  ·  view source on GitHub ↗
(C context, IPersistentVector form)

Source from the content-addressed store, hash-verified

3766 }
3767
3768 static public Expr parse(C context, IPersistentVector form) {
3769 boolean constant = true;
3770
3771 IPersistentVector args = PersistentVector.EMPTY;
3772 for(int i = 0; i < form.count(); i++)
3773 {
3774 Expr v = analyze(context == C.EVAL ? context : C.EXPRESSION, form.nth(i));
3775 args = (IPersistentVector) args.cons(v);
3776 if(!(v instanceof LiteralExpr))
3777 constant = false;
3778 }
3779 Expr ret = new VectorExpr(args);
3780 if(form instanceof IObj && ((IObj) form).meta() != null)
3781 return new MetaExpr(ret, MapExpr
3782 .parse(context == C.EVAL ? context : C.EXPRESSION, ((IObj) form).meta()));
3783 else if (constant)
3784 {
3785 IPersistentVector rv = PersistentVector.EMPTY;
3786 for(int i =0;i<args.count();i++)
3787 {
3788 LiteralExpr ve = (LiteralExpr)args.nth(i);
3789 rv = rv.cons(ve.val());
3790 }
3791// System.err.println("Constant: " + rv);
3792 return new ConstantExpr(rv);
3793 }
3794 else
3795 return ret;
3796 }
3797
3798}
3799

Callers 1

analyzeMethod · 0.95

Calls 7

consMethod · 0.95
parseMethod · 0.95
valMethod · 0.95
analyzeMethod · 0.80
countMethod · 0.65
nthMethod · 0.65
metaMethod · 0.65

Tested by

no test coverage detected