@atomist/clj-editors
Version:
We build a node module `@atomist/clj-editors` here. This allows us to construct clojure editors using `rewrite-cljs`. After adding this dependency, the node application will have access to javascript functions transpiled from clojurescript.
260 lines (221 loc) • 12 kB
JavaScript
// Compiled by ClojureScript 1.9.946 {:target :nodejs}
goog.provide('rewrite_clj.node.uneval');
goog.require('cljs.core');
goog.require('rewrite_clj.node.protocols');
/**
* @constructor
* @implements {cljs.core.IRecord}
* @implements {cljs.core.IEquiv}
* @implements {cljs.core.IHash}
* @implements {cljs.core.ICollection}
* @implements {cljs.core.ICounted}
* @implements {rewrite_clj.node.protocols.InnerNode}
* @implements {rewrite_clj.node.uneval.Object}
* @implements {cljs.core.ISeqable}
* @implements {cljs.core.IMeta}
* @implements {cljs.core.ICloneable}
* @implements {cljs.core.IPrintWithWriter}
* @implements {cljs.core.IIterable}
* @implements {rewrite_clj.node.protocols.Node}
* @implements {cljs.core.IWithMeta}
* @implements {cljs.core.IAssociative}
* @implements {cljs.core.IMap}
* @implements {cljs.core.ILookup}
*/
rewrite_clj.node.uneval.UnevalNode = (function (children,__meta,__extmap,__hash){
this.children = children;
this.__meta = __meta;
this.__extmap = __extmap;
this.__hash = __hash;
this.cljs$lang$protocol_mask$partition0$ = 2229667594;
this.cljs$lang$protocol_mask$partition1$ = 139264;
});
rewrite_clj.node.uneval.UnevalNode.prototype.toString = (function (){
var self__ = this;
var this$ = this;
return this$.rewrite_clj$node$protocols$Node$string$arity$1(null);
});
rewrite_clj.node.uneval.UnevalNode.prototype.cljs$core$ILookup$_lookup$arity$2 = (function (this__8518__auto__,k__8519__auto__){
var self__ = this;
var this__8518__auto____$1 = this;
return this__8518__auto____$1.cljs$core$ILookup$_lookup$arity$3(null,k__8519__auto__,null);
});
rewrite_clj.node.uneval.UnevalNode.prototype.cljs$core$ILookup$_lookup$arity$3 = (function (this__8520__auto__,k10255,else__8521__auto__){
var self__ = this;
var this__8520__auto____$1 = this;
var G__10262 = k10255;
var G__10262__$1 = (((G__10262 instanceof cljs.core.Keyword))?G__10262.fqn:null);
switch (G__10262__$1) {
case "children":
return self__.children;
break;
default:
return cljs.core.get.call(null,self__.__extmap,k10255,else__8521__auto__);
}
});
rewrite_clj.node.uneval.UnevalNode.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 = (function (this__8532__auto__,writer__8533__auto__,opts__8534__auto__){
var self__ = this;
var this__8532__auto____$1 = this;
var pr_pair__8535__auto__ = ((function (this__8532__auto____$1){
return (function (keyval__8536__auto__){
return cljs.core.pr_sequential_writer.call(null,writer__8533__auto__,cljs.core.pr_writer,""," ","",opts__8534__auto__,keyval__8536__auto__);
});})(this__8532__auto____$1))
;
return cljs.core.pr_sequential_writer.call(null,writer__8533__auto__,pr_pair__8535__auto__,"#rewrite-clj.node.uneval.UnevalNode{",", ","}",opts__8534__auto__,cljs.core.concat.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"children","children",-940561982),self__.children],null))], null),self__.__extmap));
});
rewrite_clj.node.uneval.UnevalNode.prototype.cljs$core$IIterable$_iterator$arity$1 = (function (G__10254){
var self__ = this;
var G__10254__$1 = this;
return (new cljs.core.RecordIter((0),G__10254__$1,1,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"children","children",-940561982)], null),(cljs.core.truth_(self__.__extmap)?cljs.core._iterator.call(null,self__.__extmap):cljs.core.nil_iter.call(null))));
});
rewrite_clj.node.uneval.UnevalNode.prototype.cljs$core$IMeta$_meta$arity$1 = (function (this__8516__auto__){
var self__ = this;
var this__8516__auto____$1 = this;
return self__.__meta;
});
rewrite_clj.node.uneval.UnevalNode.prototype.cljs$core$ICloneable$_clone$arity$1 = (function (this__8513__auto__){
var self__ = this;
var this__8513__auto____$1 = this;
return (new rewrite_clj.node.uneval.UnevalNode(self__.children,self__.__meta,self__.__extmap,self__.__hash));
});
rewrite_clj.node.uneval.UnevalNode.prototype.cljs$core$ICounted$_count$arity$1 = (function (this__8522__auto__){
var self__ = this;
var this__8522__auto____$1 = this;
return (1 + cljs.core.count.call(null,self__.__extmap));
});
rewrite_clj.node.uneval.UnevalNode.prototype.cljs$core$IHash$_hash$arity$1 = (function (this__8514__auto__){
var self__ = this;
var this__8514__auto____$1 = this;
var h__8332__auto__ = self__.__hash;
if(!((h__8332__auto__ == null))){
return h__8332__auto__;
} else {
var h__8332__auto____$1 = ((function (h__8332__auto__,this__8514__auto____$1){
return (function (coll__8515__auto__){
return (-1883175395 ^ cljs.core.hash_unordered_coll.call(null,coll__8515__auto__));
});})(h__8332__auto__,this__8514__auto____$1))
.call(null,this__8514__auto____$1);
self__.__hash = h__8332__auto____$1;
return h__8332__auto____$1;
}
});
rewrite_clj.node.uneval.UnevalNode.prototype.cljs$core$IEquiv$_equiv$arity$2 = (function (this10256,other10257){
var self__ = this;
var this10256__$1 = this;
return (!((other10257 == null))) && ((this10256__$1.constructor === other10257.constructor)) && (cljs.core._EQ_.call(null,this10256__$1.children,other10257.children)) && (cljs.core._EQ_.call(null,this10256__$1.__extmap,other10257.__extmap));
});
rewrite_clj.node.uneval.UnevalNode.prototype.rewrite_clj$node$protocols$Node$ = cljs.core.PROTOCOL_SENTINEL;
rewrite_clj.node.uneval.UnevalNode.prototype.rewrite_clj$node$protocols$Node$tag$arity$1 = (function (_){
var self__ = this;
var ___$1 = this;
return new cljs.core.Keyword(null,"uneval","uneval",1932037707);
});
rewrite_clj.node.uneval.UnevalNode.prototype.rewrite_clj$node$protocols$Node$printable_only_QMARK_$arity$1 = (function (_){
var self__ = this;
var ___$1 = this;
return true;
});
rewrite_clj.node.uneval.UnevalNode.prototype.rewrite_clj$node$protocols$Node$sexpr$arity$1 = (function (_){
var self__ = this;
var ___$1 = this;
throw (new Error("Unsupported operation for unevalnode"));
});
rewrite_clj.node.uneval.UnevalNode.prototype.rewrite_clj$node$protocols$Node$length$arity$1 = (function (_){
var self__ = this;
var ___$1 = this;
return ((2) + rewrite_clj.node.protocols.sum_lengths.call(null,self__.children));
});
rewrite_clj.node.uneval.UnevalNode.prototype.rewrite_clj$node$protocols$Node$string$arity$1 = (function (_){
var self__ = this;
var ___$1 = this;
return ["#_",cljs.core.str.cljs$core$IFn$_invoke$arity$1(rewrite_clj.node.protocols.concat_strings.call(null,self__.children))].join('');
});
rewrite_clj.node.uneval.UnevalNode.prototype.cljs$core$IMap$_dissoc$arity$2 = (function (this__8527__auto__,k__8528__auto__){
var self__ = this;
var this__8527__auto____$1 = this;
if(cljs.core.contains_QMARK_.call(null,new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"children","children",-940561982),null], null), null),k__8528__auto__)){
return cljs.core.dissoc.call(null,cljs.core._with_meta.call(null,cljs.core.into.call(null,cljs.core.PersistentArrayMap.EMPTY,this__8527__auto____$1),self__.__meta),k__8528__auto__);
} else {
return (new rewrite_clj.node.uneval.UnevalNode(self__.children,self__.__meta,cljs.core.not_empty.call(null,cljs.core.dissoc.call(null,self__.__extmap,k__8528__auto__)),null));
}
});
rewrite_clj.node.uneval.UnevalNode.prototype.rewrite_clj$node$protocols$InnerNode$ = cljs.core.PROTOCOL_SENTINEL;
rewrite_clj.node.uneval.UnevalNode.prototype.rewrite_clj$node$protocols$InnerNode$inner_QMARK_$arity$1 = (function (_){
var self__ = this;
var ___$1 = this;
return true;
});
rewrite_clj.node.uneval.UnevalNode.prototype.rewrite_clj$node$protocols$InnerNode$children$arity$1 = (function (_){
var self__ = this;
var ___$1 = this;
return self__.children;
});
rewrite_clj.node.uneval.UnevalNode.prototype.rewrite_clj$node$protocols$InnerNode$replace_children$arity$2 = (function (this$,children_SINGLEQUOTE_){
var self__ = this;
var this$__$1 = this;
rewrite_clj.node.protocols.assert_single_sexpr.call(null,children_SINGLEQUOTE_);
return cljs.core.assoc.call(null,this$__$1,new cljs.core.Keyword(null,"children","children",-940561982),children_SINGLEQUOTE_);
});
rewrite_clj.node.uneval.UnevalNode.prototype.cljs$core$IAssociative$_assoc$arity$3 = (function (this__8525__auto__,k__8526__auto__,G__10254){
var self__ = this;
var this__8525__auto____$1 = this;
var pred__10266 = cljs.core.keyword_identical_QMARK_;
var expr__10267 = k__8526__auto__;
if(cljs.core.truth_(pred__10266.call(null,new cljs.core.Keyword(null,"children","children",-940561982),expr__10267))){
return (new rewrite_clj.node.uneval.UnevalNode(G__10254,self__.__meta,self__.__extmap,null));
} else {
return (new rewrite_clj.node.uneval.UnevalNode(self__.children,self__.__meta,cljs.core.assoc.call(null,self__.__extmap,k__8526__auto__,G__10254),null));
}
});
rewrite_clj.node.uneval.UnevalNode.prototype.cljs$core$ISeqable$_seq$arity$1 = (function (this__8530__auto__){
var self__ = this;
var this__8530__auto____$1 = this;
return cljs.core.seq.call(null,cljs.core.concat.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[new cljs.core.Keyword(null,"children","children",-940561982),self__.children],null))], null),self__.__extmap));
});
rewrite_clj.node.uneval.UnevalNode.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (this__8517__auto__,G__10254){
var self__ = this;
var this__8517__auto____$1 = this;
return (new rewrite_clj.node.uneval.UnevalNode(self__.children,G__10254,self__.__extmap,self__.__hash));
});
rewrite_clj.node.uneval.UnevalNode.prototype.cljs$core$ICollection$_conj$arity$2 = (function (this__8523__auto__,entry__8524__auto__){
var self__ = this;
var this__8523__auto____$1 = this;
if(cljs.core.vector_QMARK_.call(null,entry__8524__auto__)){
return this__8523__auto____$1.cljs$core$IAssociative$_assoc$arity$3(null,cljs.core._nth.call(null,entry__8524__auto__,(0)),cljs.core._nth.call(null,entry__8524__auto__,(1)));
} else {
return cljs.core.reduce.call(null,cljs.core._conj,this__8523__auto____$1,entry__8524__auto__);
}
});
rewrite_clj.node.uneval.UnevalNode.getBasis = (function (){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"children","children",699969545,null)], null);
});
rewrite_clj.node.uneval.UnevalNode.cljs$lang$type = true;
rewrite_clj.node.uneval.UnevalNode.cljs$lang$ctorPrSeq = (function (this__8554__auto__){
return cljs.core._conj.call(null,cljs.core.List.EMPTY,"rewrite-clj.node.uneval/UnevalNode");
});
rewrite_clj.node.uneval.UnevalNode.cljs$lang$ctorPrWriter = (function (this__8554__auto__,writer__8555__auto__){
return cljs.core._write.call(null,writer__8555__auto__,"rewrite-clj.node.uneval/UnevalNode");
});
rewrite_clj.node.uneval.__GT_UnevalNode = (function rewrite_clj$node$uneval$__GT_UnevalNode(children){
return (new rewrite_clj.node.uneval.UnevalNode(children,null,null,null));
});
rewrite_clj.node.uneval.map__GT_UnevalNode = (function rewrite_clj$node$uneval$map__GT_UnevalNode(G__10258){
return (new rewrite_clj.node.uneval.UnevalNode(new cljs.core.Keyword(null,"children","children",-940561982).cljs$core$IFn$_invoke$arity$1(G__10258),null,cljs.core.not_empty.call(null,cljs.core.dissoc.call(null,G__10258,new cljs.core.Keyword(null,"children","children",-940561982))),null));
});
/**
* Create node representing an EDN uneval `#_` form.
*/
rewrite_clj.node.uneval.uneval_node = (function rewrite_clj$node$uneval$uneval_node(children){
while(true){
if(cljs.core.sequential_QMARK_.call(null,children)){
rewrite_clj.node.protocols.assert_single_sexpr.call(null,children);
return rewrite_clj.node.uneval.__GT_UnevalNode.call(null,children);
} else {
var G__10288 = new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [children], null);
children = G__10288;
continue;
}
break;
}
});
//# sourceMappingURL=uneval.js.map