UNPKG

@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.

524 lines (460 loc) 25.5 kB
// Compiled by ClojureScript 1.9.946 {:target :nodejs} goog.provide('rewrite_clj.node.whitespace'); goog.require('cljs.core'); goog.require('rewrite_clj.node.protocols'); /** * This function is applied to every newline string. */ rewrite_clj.node.whitespace._STAR_newline_fn_STAR_ = cljs.core.identity; /** * This function is applied to every newline string and should produce * the eventual character count. */ rewrite_clj.node.whitespace._STAR_count_fn_STAR_ = cljs.core.count; /** * @constructor * @implements {cljs.core.IRecord} * @implements {cljs.core.IEquiv} * @implements {cljs.core.IHash} * @implements {cljs.core.ICollection} * @implements {rewrite_clj.node.whitespace.Object} * @implements {cljs.core.ICounted} * @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.whitespace.WhitespaceNode = (function (whitespace,__meta,__extmap,__hash){ this.whitespace = whitespace; 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.whitespace.WhitespaceNode.prototype.toString = (function (){ var self__ = this; var this$ = this; return this$.rewrite_clj$node$protocols$Node$string$arity$1(null); }); rewrite_clj.node.whitespace.WhitespaceNode.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.whitespace.WhitespaceNode.prototype.cljs$core$ILookup$_lookup$arity$3 = (function (this__8520__auto__,k10105,else__8521__auto__){ var self__ = this; var this__8520__auto____$1 = this; var G__10111 = k10105; var G__10111__$1 = (((G__10111 instanceof cljs.core.Keyword))?G__10111.fqn:null); switch (G__10111__$1) { case "whitespace": return self__.whitespace; break; default: return cljs.core.get.call(null,self__.__extmap,k10105,else__8521__auto__); } }); rewrite_clj.node.whitespace.WhitespaceNode.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.whitespace.WhitespaceNode{",", ","}",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,"whitespace","whitespace",-1340035483),self__.whitespace],null))], null),self__.__extmap)); }); rewrite_clj.node.whitespace.WhitespaceNode.prototype.cljs$core$IIterable$_iterator$arity$1 = (function (G__10104){ var self__ = this; var G__10104__$1 = this; return (new cljs.core.RecordIter((0),G__10104__$1,1,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"whitespace","whitespace",-1340035483)], null),(cljs.core.truth_(self__.__extmap)?cljs.core._iterator.call(null,self__.__extmap):cljs.core.nil_iter.call(null)))); }); rewrite_clj.node.whitespace.WhitespaceNode.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.whitespace.WhitespaceNode.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.whitespace.WhitespaceNode(self__.whitespace,self__.__meta,self__.__extmap,self__.__hash)); }); rewrite_clj.node.whitespace.WhitespaceNode.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.whitespace.WhitespaceNode.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 (1595850179 ^ 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.whitespace.WhitespaceNode.prototype.cljs$core$IEquiv$_equiv$arity$2 = (function (this10106,other10107){ var self__ = this; var this10106__$1 = this; return (!((other10107 == null))) && ((this10106__$1.constructor === other10107.constructor)) && (cljs.core._EQ_.call(null,this10106__$1.whitespace,other10107.whitespace)) && (cljs.core._EQ_.call(null,this10106__$1.__extmap,other10107.__extmap)); }); rewrite_clj.node.whitespace.WhitespaceNode.prototype.rewrite_clj$node$protocols$Node$ = cljs.core.PROTOCOL_SENTINEL; rewrite_clj.node.whitespace.WhitespaceNode.prototype.rewrite_clj$node$protocols$Node$tag$arity$1 = (function (_){ var self__ = this; var ___$1 = this; return new cljs.core.Keyword(null,"whitespace","whitespace",-1340035483); }); rewrite_clj.node.whitespace.WhitespaceNode.prototype.rewrite_clj$node$protocols$Node$printable_only_QMARK_$arity$1 = (function (_){ var self__ = this; var ___$1 = this; return true; }); rewrite_clj.node.whitespace.WhitespaceNode.prototype.rewrite_clj$node$protocols$Node$sexpr$arity$1 = (function (_){ var self__ = this; var ___$1 = this; throw (new Error("Unsupported operation")); }); rewrite_clj.node.whitespace.WhitespaceNode.prototype.rewrite_clj$node$protocols$Node$length$arity$1 = (function (_){ var self__ = this; var ___$1 = this; return cljs.core.count.call(null,self__.whitespace); }); rewrite_clj.node.whitespace.WhitespaceNode.prototype.rewrite_clj$node$protocols$Node$string$arity$1 = (function (_){ var self__ = this; var ___$1 = this; return self__.whitespace; }); rewrite_clj.node.whitespace.WhitespaceNode.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,"whitespace","whitespace",-1340035483),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.whitespace.WhitespaceNode(self__.whitespace,self__.__meta,cljs.core.not_empty.call(null,cljs.core.dissoc.call(null,self__.__extmap,k__8528__auto__)),null)); } }); rewrite_clj.node.whitespace.WhitespaceNode.prototype.cljs$core$IAssociative$_assoc$arity$3 = (function (this__8525__auto__,k__8526__auto__,G__10104){ var self__ = this; var this__8525__auto____$1 = this; var pred__10119 = cljs.core.keyword_identical_QMARK_; var expr__10120 = k__8526__auto__; if(cljs.core.truth_(pred__10119.call(null,new cljs.core.Keyword(null,"whitespace","whitespace",-1340035483),expr__10120))){ return (new rewrite_clj.node.whitespace.WhitespaceNode(G__10104,self__.__meta,self__.__extmap,null)); } else { return (new rewrite_clj.node.whitespace.WhitespaceNode(self__.whitespace,self__.__meta,cljs.core.assoc.call(null,self__.__extmap,k__8526__auto__,G__10104),null)); } }); rewrite_clj.node.whitespace.WhitespaceNode.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,"whitespace","whitespace",-1340035483),self__.whitespace],null))], null),self__.__extmap)); }); rewrite_clj.node.whitespace.WhitespaceNode.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (this__8517__auto__,G__10104){ var self__ = this; var this__8517__auto____$1 = this; return (new rewrite_clj.node.whitespace.WhitespaceNode(self__.whitespace,G__10104,self__.__extmap,self__.__hash)); }); rewrite_clj.node.whitespace.WhitespaceNode.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.whitespace.WhitespaceNode.getBasis = (function (){ return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"whitespace","whitespace",300496044,null)], null); }); rewrite_clj.node.whitespace.WhitespaceNode.cljs$lang$type = true; rewrite_clj.node.whitespace.WhitespaceNode.cljs$lang$ctorPrSeq = (function (this__8554__auto__){ return cljs.core._conj.call(null,cljs.core.List.EMPTY,"rewrite-clj.node.whitespace/WhitespaceNode"); }); rewrite_clj.node.whitespace.WhitespaceNode.cljs$lang$ctorPrWriter = (function (this__8554__auto__,writer__8555__auto__){ return cljs.core._write.call(null,writer__8555__auto__,"rewrite-clj.node.whitespace/WhitespaceNode"); }); rewrite_clj.node.whitespace.__GT_WhitespaceNode = (function rewrite_clj$node$whitespace$__GT_WhitespaceNode(whitespace){ return (new rewrite_clj.node.whitespace.WhitespaceNode(whitespace,null,null,null)); }); rewrite_clj.node.whitespace.map__GT_WhitespaceNode = (function rewrite_clj$node$whitespace$map__GT_WhitespaceNode(G__10108){ return (new rewrite_clj.node.whitespace.WhitespaceNode(new cljs.core.Keyword(null,"whitespace","whitespace",-1340035483).cljs$core$IFn$_invoke$arity$1(G__10108),null,cljs.core.not_empty.call(null,cljs.core.dissoc.call(null,G__10108,new cljs.core.Keyword(null,"whitespace","whitespace",-1340035483))),null)); }); /** * @constructor * @implements {cljs.core.IRecord} * @implements {cljs.core.IEquiv} * @implements {cljs.core.IHash} * @implements {cljs.core.ICollection} * @implements {rewrite_clj.node.whitespace.Object} * @implements {cljs.core.ICounted} * @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.whitespace.NewlineNode = (function (newlines,__meta,__extmap,__hash){ this.newlines = newlines; 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.whitespace.NewlineNode.prototype.toString = (function (){ var self__ = this; var this$ = this; return this$.rewrite_clj$node$protocols$Node$string$arity$1(null); }); rewrite_clj.node.whitespace.NewlineNode.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.whitespace.NewlineNode.prototype.cljs$core$ILookup$_lookup$arity$3 = (function (this__8520__auto__,k10139,else__8521__auto__){ var self__ = this; var this__8520__auto____$1 = this; var G__10145 = k10139; var G__10145__$1 = (((G__10145 instanceof cljs.core.Keyword))?G__10145.fqn:null); switch (G__10145__$1) { case "newlines": return self__.newlines; break; default: return cljs.core.get.call(null,self__.__extmap,k10139,else__8521__auto__); } }); rewrite_clj.node.whitespace.NewlineNode.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.whitespace.NewlineNode{",", ","}",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,"newlines","newlines",-1185451518),self__.newlines],null))], null),self__.__extmap)); }); rewrite_clj.node.whitespace.NewlineNode.prototype.cljs$core$IIterable$_iterator$arity$1 = (function (G__10138){ var self__ = this; var G__10138__$1 = this; return (new cljs.core.RecordIter((0),G__10138__$1,1,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"newlines","newlines",-1185451518)], null),(cljs.core.truth_(self__.__extmap)?cljs.core._iterator.call(null,self__.__extmap):cljs.core.nil_iter.call(null)))); }); rewrite_clj.node.whitespace.NewlineNode.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.whitespace.NewlineNode.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.whitespace.NewlineNode(self__.newlines,self__.__meta,self__.__extmap,self__.__hash)); }); rewrite_clj.node.whitespace.NewlineNode.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.whitespace.NewlineNode.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 (979711303 ^ 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.whitespace.NewlineNode.prototype.cljs$core$IEquiv$_equiv$arity$2 = (function (this10140,other10141){ var self__ = this; var this10140__$1 = this; return (!((other10141 == null))) && ((this10140__$1.constructor === other10141.constructor)) && (cljs.core._EQ_.call(null,this10140__$1.newlines,other10141.newlines)) && (cljs.core._EQ_.call(null,this10140__$1.__extmap,other10141.__extmap)); }); rewrite_clj.node.whitespace.NewlineNode.prototype.rewrite_clj$node$protocols$Node$ = cljs.core.PROTOCOL_SENTINEL; rewrite_clj.node.whitespace.NewlineNode.prototype.rewrite_clj$node$protocols$Node$tag$arity$1 = (function (_){ var self__ = this; var ___$1 = this; return new cljs.core.Keyword(null,"newline","newline",1790071323); }); rewrite_clj.node.whitespace.NewlineNode.prototype.rewrite_clj$node$protocols$Node$printable_only_QMARK_$arity$1 = (function (_){ var self__ = this; var ___$1 = this; return true; }); rewrite_clj.node.whitespace.NewlineNode.prototype.rewrite_clj$node$protocols$Node$sexpr$arity$1 = (function (_){ var self__ = this; var ___$1 = this; throw (new Error("Unsupported operation")); }); rewrite_clj.node.whitespace.NewlineNode.prototype.rewrite_clj$node$protocols$Node$length$arity$1 = (function (_){ var self__ = this; var ___$1 = this; return rewrite_clj.node.whitespace._STAR_count_fn_STAR_.call(null,self__.newlines); }); rewrite_clj.node.whitespace.NewlineNode.prototype.rewrite_clj$node$protocols$Node$string$arity$1 = (function (_){ var self__ = this; var ___$1 = this; return rewrite_clj.node.whitespace._STAR_newline_fn_STAR_.call(null,self__.newlines); }); rewrite_clj.node.whitespace.NewlineNode.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,"newlines","newlines",-1185451518),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.whitespace.NewlineNode(self__.newlines,self__.__meta,cljs.core.not_empty.call(null,cljs.core.dissoc.call(null,self__.__extmap,k__8528__auto__)),null)); } }); rewrite_clj.node.whitespace.NewlineNode.prototype.cljs$core$IAssociative$_assoc$arity$3 = (function (this__8525__auto__,k__8526__auto__,G__10138){ var self__ = this; var this__8525__auto____$1 = this; var pred__10152 = cljs.core.keyword_identical_QMARK_; var expr__10153 = k__8526__auto__; if(cljs.core.truth_(pred__10152.call(null,new cljs.core.Keyword(null,"newlines","newlines",-1185451518),expr__10153))){ return (new rewrite_clj.node.whitespace.NewlineNode(G__10138,self__.__meta,self__.__extmap,null)); } else { return (new rewrite_clj.node.whitespace.NewlineNode(self__.newlines,self__.__meta,cljs.core.assoc.call(null,self__.__extmap,k__8526__auto__,G__10138),null)); } }); rewrite_clj.node.whitespace.NewlineNode.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,"newlines","newlines",-1185451518),self__.newlines],null))], null),self__.__extmap)); }); rewrite_clj.node.whitespace.NewlineNode.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (this__8517__auto__,G__10138){ var self__ = this; var this__8517__auto____$1 = this; return (new rewrite_clj.node.whitespace.NewlineNode(self__.newlines,G__10138,self__.__extmap,self__.__hash)); }); rewrite_clj.node.whitespace.NewlineNode.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.whitespace.NewlineNode.getBasis = (function (){ return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"newlines","newlines",455080009,null)], null); }); rewrite_clj.node.whitespace.NewlineNode.cljs$lang$type = true; rewrite_clj.node.whitespace.NewlineNode.cljs$lang$ctorPrSeq = (function (this__8554__auto__){ return cljs.core._conj.call(null,cljs.core.List.EMPTY,"rewrite-clj.node.whitespace/NewlineNode"); }); rewrite_clj.node.whitespace.NewlineNode.cljs$lang$ctorPrWriter = (function (this__8554__auto__,writer__8555__auto__){ return cljs.core._write.call(null,writer__8555__auto__,"rewrite-clj.node.whitespace/NewlineNode"); }); rewrite_clj.node.whitespace.__GT_NewlineNode = (function rewrite_clj$node$whitespace$__GT_NewlineNode(newlines){ return (new rewrite_clj.node.whitespace.NewlineNode(newlines,null,null,null)); }); rewrite_clj.node.whitespace.map__GT_NewlineNode = (function rewrite_clj$node$whitespace$map__GT_NewlineNode(G__10142){ return (new rewrite_clj.node.whitespace.NewlineNode(new cljs.core.Keyword(null,"newlines","newlines",-1185451518).cljs$core$IFn$_invoke$arity$1(G__10142),null,cljs.core.not_empty.call(null,cljs.core.dissoc.call(null,G__10142,new cljs.core.Keyword(null,"newlines","newlines",-1185451518))),null)); }); /** * Create whitespace node. */ rewrite_clj.node.whitespace.whitespace_node = (function rewrite_clj$node$whitespace$whitespace_node(s){ return rewrite_clj.node.whitespace.__GT_WhitespaceNode.call(null,s); }); /** * Create newline node. */ rewrite_clj.node.whitespace.newline_node = (function rewrite_clj$node$whitespace$newline_node(s){ return rewrite_clj.node.whitespace.__GT_NewlineNode.call(null,s); }); /** * Check whether a character represents a linebreak. */ rewrite_clj.node.whitespace.newline_QMARK_ = (function rewrite_clj$node$whitespace$newline_QMARK_(c){ return cljs.core.contains_QMARK_.call(null,new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 2, ["\n",null,"\r",null], null), null),c); }); /** * Convert a string of whitespace to whitespace/newline nodes. */ rewrite_clj.node.whitespace.whitespace_nodes = (function rewrite_clj$node$whitespace$whitespace_nodes(s){ return cljs.core.map.call(null,(function (char_seq){ var s__$1 = cljs.core.apply.call(null,cljs.core.str,char_seq); if(cljs.core.truth_(rewrite_clj.node.whitespace.newline_QMARK_.call(null,cljs.core.first.call(null,char_seq)))){ return rewrite_clj.node.whitespace.newline_node.call(null,s__$1); } else { return rewrite_clj.node.whitespace.whitespace_node.call(null,s__$1); } }),cljs.core.partition_by.call(null,rewrite_clj.node.whitespace.newline_QMARK_,s)); }); /** * Create node representing the given number of spaces. */ rewrite_clj.node.whitespace.spaces = (function rewrite_clj$node$whitespace$spaces(n){ return rewrite_clj.node.whitespace.whitespace_node.call(null,cljs.core.apply.call(null,cljs.core.str,cljs.core.repeat.call(null,n," "))); }); /** * Create node representing the given number of newline characters. */ rewrite_clj.node.whitespace.newlines = (function rewrite_clj$node$whitespace$newlines(n){ return rewrite_clj.node.whitespace.newline_node.call(null,cljs.core.apply.call(null,cljs.core.str,cljs.core.repeat.call(null,n,"\n"))); }); var comma_10177 = rewrite_clj.node.whitespace.whitespace_node.call(null,", "); /** * Interleave the given seq of nodes with `", "` nodes. */ rewrite_clj.node.whitespace.comma_separated = ((function (comma_10177){ return (function rewrite_clj$node$whitespace$comma_separated(nodes){ return cljs.core.butlast.call(null,cljs.core.interleave.call(null,nodes,cljs.core.repeat.call(null,comma_10177))); });})(comma_10177)) ; var nl_10178 = rewrite_clj.node.whitespace.newline_node.call(null,"\n"); /** * Interleave the given seq of nodes with newline nodes. */ rewrite_clj.node.whitespace.line_separated = ((function (nl_10178){ return (function rewrite_clj$node$whitespace$line_separated(nodes){ return cljs.core.butlast.call(null,cljs.core.interleave.call(null,nodes,cljs.core.repeat.call(null,nl_10178))); });})(nl_10178)) ; var space_10179 = rewrite_clj.node.whitespace.whitespace_node.call(null," "); /** * Interleave the given seq of nodes with `" "` nodes. */ rewrite_clj.node.whitespace.space_separated = ((function (space_10179){ return (function rewrite_clj$node$whitespace$space_separated(nodes){ return cljs.core.butlast.call(null,cljs.core.interleave.call(null,nodes,cljs.core.repeat.call(null,space_10179))); });})(space_10179)) ; /** * Check whether a node represents whitespace. */ rewrite_clj.node.whitespace.whitespace_QMARK_ = (function rewrite_clj$node$whitespace$whitespace_QMARK_(node){ return cljs.core.contains_QMARK_.call(null,new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"whitespace","whitespace",-1340035483),null,new cljs.core.Keyword(null,"newline","newline",1790071323),null], null), null),rewrite_clj.node.protocols.tag.call(null,node)); }); /** * Check whether a ndoe represents linebreaks. */ rewrite_clj.node.whitespace.linebreak_QMARK_ = (function rewrite_clj$node$whitespace$linebreak_QMARK_(node){ return cljs.core._EQ_.call(null,rewrite_clj.node.protocols.tag.call(null,node),new cljs.core.Keyword(null,"newline","newline",1790071323)); }); //# sourceMappingURL=whitespace.js.map