Skip to content
Browse files

added in the clojure.* libs, fixed non-seq input, add the local dir t…

…o the classpath to allow for macros

Signed-off-by: Chris Granger <ibdknox@gmail.com>
  • Loading branch information...
1 parent 793a99d commit 7391a299f6e558d5e8c6c4fe6e462eacc766ea2e @ibdknox committed Aug 3, 2011
Showing with 5,776 additions and 4,044 deletions.
  1. +4,484 −4,042 out/cljs/core.js
  2. +375 −0 out/clojure/set.js
  3. +290 −0 out/clojure/string.js
  4. +113 −0 out/clojure/walk.js
  5. +506 −0 out/clojure/zip.js
  6. +5 −0 out/goog/deps.js
  7. +1 −1 script/cljbrepl
  8. +2 −1 src/brepl/core.clj
View
8,526 out/cljs/core.js
4,484 additions, 4,042 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
375 out/clojure/set.js
@@ -0,0 +1,375 @@
+goog.provide('clojure.set');
+goog.require('cljs.core');
+clojure.set.bubble_max_key = (function bubble_max_key(k,coll){
+var max__3353 = cljs.core.apply.call(null,cljs.core.max_key,k,coll);
+
+return cljs.core.cons.call(null,max__3353,cljs.core.remove.call(null,(function (p1__3352_SHARP_){
+return cljs.core.identical_QMARK_.call(null,max__3353,p1__3352_SHARP_);
+}),coll));
+});
+/**
+* Return a set that is the union of the input sets
+* @param {...*} var_args
+*/
+clojure.set.union = (function() {
+var union = null;
+var union__3356 = (function (){
+return cljs.core.set([]);
+});
+var union__3357 = (function (s1){
+return s1;
+});
+var union__3358 = (function (s1,s2){
+if(cljs.core.truth_(cljs.core._LT_.call(null,cljs.core.count.call(null,s1),cljs.core.count.call(null,s2))))
+{return cljs.core.reduce.call(null,cljs.core.conj,s2,s1);
+} else
+{return cljs.core.reduce.call(null,cljs.core.conj,s1,s2);
+}
+});
+var union__3359 = (function() {
+var G__3361__delegate = function (s1,s2,sets){
+var bubbled_sets__3355 = clojure.set.bubble_max_key.call(null,cljs.core.count,cljs.core.conj.call(null,sets,s2,s1));
+
+return cljs.core.reduce.call(null,cljs.core.into,cljs.core.first.call(null,bubbled_sets__3355),cljs.core.rest.call(null,bubbled_sets__3355));
+};
+var G__3361 = function (s1,s2,var_args){
+var sets = null;
+if (goog.isDef(var_args)) {
+ sets = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2),0);
+}
+return G__3361__delegate.call(this, s1, s2, sets);
+};
+G__3361.cljs$lang$maxFixedArity = 2;
+G__3361.cljs$lang$applyTo = (function (arglist__3362){
+var s1 = cljs.core.first(arglist__3362);
+var s2 = cljs.core.first(cljs.core.next(arglist__3362));
+var sets = cljs.core.rest(cljs.core.next(arglist__3362));
+return G__3361__delegate.call(this, s1, s2, sets);
+});
+return G__3361;
+})()
+;
+union = function(s1,s2,var_args){
+var sets = var_args;
+switch(arguments.length){
+case 0 :
+return union__3356.call(this);
+case 1 :
+return union__3357.call(this,s1);
+case 2 :
+return union__3358.call(this,s1,s2);
+default:
+return union__3359.apply(this,arguments);
+}
+throw('Invalid arity: ' + arguments.length);
+};
+union.cljs$lang$maxFixedArity = 2;
+union.cljs$lang$applyTo = union__3359.cljs$lang$applyTo;
+return union;
+})()
+;
+/**
+* Return a set that is the intersection of the input sets
+* @param {...*} var_args
+*/
+clojure.set.intersection = (function() {
+var intersection = null;
+var intersection__3364 = (function (s1){
+return s1;
+});
+var intersection__3365 = (function (s1,s2){
+while(true){
+if(cljs.core.truth_(cljs.core._LT_.call(null,cljs.core.count.call(null,s2),cljs.core.count.call(null,s1))))
+{{
+var G__3368 = s2;
+var G__3369 = s1;
+s1 = G__3368;
+s2 = G__3369;
+continue;
+}
+} else
+{return cljs.core.reduce.call(null,((function (s1,s2){
+return (function (result,item){
+if(cljs.core.truth_(cljs.core.contains_QMARK_.call(null,s2,item)))
+{return result;
+} else
+{return cljs.core.disj.call(null,result,item);
+}
+});})(s1,s2))
+,s1,s1);
+}
+break;
+}
+});
+var intersection__3366 = (function() {
+var G__3370__delegate = function (s1,s2,sets){
+var bubbled_sets__3363 = clojure.set.bubble_max_key.call(null,(function (p1__3354_SHARP_){
+return cljs.core._.call(null,cljs.core.count.call(null,p1__3354_SHARP_));
+}),cljs.core.conj.call(null,sets,s2,s1));
+
+return cljs.core.reduce.call(null,intersection,cljs.core.first.call(null,bubbled_sets__3363),cljs.core.rest.call(null,bubbled_sets__3363));
+};
+var G__3370 = function (s1,s2,var_args){
+var sets = null;
+if (goog.isDef(var_args)) {
+ sets = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2),0);
+}
+return G__3370__delegate.call(this, s1, s2, sets);
+};
+G__3370.cljs$lang$maxFixedArity = 2;
+G__3370.cljs$lang$applyTo = (function (arglist__3371){
+var s1 = cljs.core.first(arglist__3371);
+var s2 = cljs.core.first(cljs.core.next(arglist__3371));
+var sets = cljs.core.rest(cljs.core.next(arglist__3371));
+return G__3370__delegate.call(this, s1, s2, sets);
+});
+return G__3370;
+})()
+;
+intersection = function(s1,s2,var_args){
+var sets = var_args;
+switch(arguments.length){
+case 1 :
+return intersection__3364.call(this,s1);
+case 2 :
+return intersection__3365.call(this,s1,s2);
+default:
+return intersection__3366.apply(this,arguments);
+}
+throw('Invalid arity: ' + arguments.length);
+};
+intersection.cljs$lang$maxFixedArity = 2;
+intersection.cljs$lang$applyTo = intersection__3366.cljs$lang$applyTo;
+return intersection;
+})()
+;
+/**
+* Return a set that is the first set without elements of the remaining sets
+* @param {...*} var_args
+*/
+clojure.set.difference = (function() {
+var difference = null;
+var difference__3372 = (function (s1){
+return s1;
+});
+var difference__3373 = (function (s1,s2){
+if(cljs.core.truth_(cljs.core._LT_.call(null,cljs.core.count.call(null,s1),cljs.core.count.call(null,s2))))
+{return cljs.core.reduce.call(null,(function (result,item){
+if(cljs.core.truth_(cljs.core.contains_QMARK_.call(null,s2,item)))
+{return cljs.core.disj.call(null,result,item);
+} else
+{return result;
+}
+}),s1,s1);
+} else
+{return cljs.core.reduce.call(null,cljs.core.disj,s1,s2);
+}
+});
+var difference__3374 = (function() {
+var G__3376__delegate = function (s1,s2,sets){
+return cljs.core.reduce.call(null,difference,s1,cljs.core.conj.call(null,sets,s2));
+};
+var G__3376 = function (s1,s2,var_args){
+var sets = null;
+if (goog.isDef(var_args)) {
+ sets = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2),0);
+}
+return G__3376__delegate.call(this, s1, s2, sets);
+};
+G__3376.cljs$lang$maxFixedArity = 2;
+G__3376.cljs$lang$applyTo = (function (arglist__3377){
+var s1 = cljs.core.first(arglist__3377);
+var s2 = cljs.core.first(cljs.core.next(arglist__3377));
+var sets = cljs.core.rest(cljs.core.next(arglist__3377));
+return G__3376__delegate.call(this, s1, s2, sets);
+});
+return G__3376;
+})()
+;
+difference = function(s1,s2,var_args){
+var sets = var_args;
+switch(arguments.length){
+case 1 :
+return difference__3372.call(this,s1);
+case 2 :
+return difference__3373.call(this,s1,s2);
+default:
+return difference__3374.apply(this,arguments);
+}
+throw('Invalid arity: ' + arguments.length);
+};
+difference.cljs$lang$maxFixedArity = 2;
+difference.cljs$lang$applyTo = difference__3374.cljs$lang$applyTo;
+return difference;
+})()
+;
+/**
+* Returns a set of the elements for which pred is true
+*/
+clojure.set.select = (function select(pred,xset){
+return cljs.core.reduce.call(null,(function (s,k){
+if(cljs.core.truth_(pred.call(null,k)))
+{return s;
+} else
+{return cljs.core.disj.call(null,s,k);
+}
+}),xset,xset);
+});
+/**
+* Returns a rel of the elements of xrel with only the keys in ks
+*/
+clojure.set.project = (function project(xrel,ks){
+return cljs.core.set.call(null,cljs.core.map.call(null,(function (p1__3378_SHARP_){
+return cljs.core.select_keys.call(null,p1__3378_SHARP_,ks);
+}),xrel));
+});
+/**
+* Returns the map with the keys in kmap renamed to the vals in kmap
+*/
+clojure.set.rename_keys = (function rename_keys(map,kmap){
+return cljs.core.reduce.call(null,(function (m,p__3380){
+var vec__3381__3382 = p__3380;
+var old__3383 = cljs.core.nth.call(null,vec__3381__3382,0,null);
+var new$__3384 = cljs.core.nth.call(null,vec__3381__3382,1,null);
+
+if(cljs.core.truth_((function (){var and__3574__auto____3385 = cljs.core.not_EQ_.call(null,old__3383,new$__3384);
+
+if(cljs.core.truth_(and__3574__auto____3385))
+{return cljs.core.contains_QMARK_.call(null,m,old__3383);
+} else
+{return and__3574__auto____3385;
+}
+})()))
+{return cljs.core.dissoc.call(null,cljs.core.assoc.call(null,m,new$__3384,cljs.core.get.call(null,m,old__3383)),old__3383);
+} else
+{return m;
+}
+}),map,kmap);
+});
+/**
+* Returns a rel of the maps in xrel with the keys in kmap renamed to the vals in kmap
+*/
+clojure.set.rename = (function rename(xrel,kmap){
+return cljs.core.set.call(null,cljs.core.map.call(null,(function (p1__3379_SHARP_){
+return clojure.set.rename_keys.call(null,p1__3379_SHARP_,kmap);
+}),xrel));
+});
+/**
+* Returns a map of the distinct values of ks in the xrel mapped to a
+* set of the maps in xrel with the corresponding values of ks.
+*/
+clojure.set.index = (function index(xrel,ks){
+return cljs.core.reduce.call(null,(function (m,x){
+var ik__3386 = cljs.core.select_keys.call(null,x,ks);
+
+return cljs.core.assoc.call(null,m,ik__3386,cljs.core.conj.call(null,cljs.core.get.call(null,m,ik__3386,cljs.core.set([])),x));
+}),cljs.core.ObjMap.fromObject([],{}),xrel);
+});
+/**
+* Returns the map with the vals mapped to the keys.
+*/
+clojure.set.map_invert = (function map_invert(m){
+return cljs.core.reduce.call(null,(function (m,p__3391){
+var vec__3392__3393 = p__3391;
+var k__3394 = cljs.core.nth.call(null,vec__3392__3393,0,null);
+var v__3395 = cljs.core.nth.call(null,vec__3392__3393,1,null);
+
+return cljs.core.assoc.call(null,m,v__3395,k__3394);
+}),cljs.core.ObjMap.fromObject([],{}),m);
+});
+/**
+* When passed 2 rels, returns the rel corresponding to the natural
+* join. When passed an additional keymap, joins on the corresponding
+* keys.
+*/
+clojure.set.join = (function() {
+var join = null;
+var join__3412 = (function (xrel,yrel){
+if(cljs.core.truth_((function (){var and__3574__auto____3397 = cljs.core.seq.call(null,xrel);
+
+if(cljs.core.truth_(and__3574__auto____3397))
+{return cljs.core.seq.call(null,yrel);
+} else
+{return and__3574__auto____3397;
+}
+})()))
+{var ks__3399 = clojure.set.intersection.call(null,cljs.core.set.call(null,cljs.core.keys.call(null,cljs.core.first.call(null,xrel))),cljs.core.set.call(null,cljs.core.keys.call(null,cljs.core.first.call(null,yrel))));
+var vec__3398__3400 = (cljs.core.truth_(cljs.core._LT__EQ_.call(null,cljs.core.count.call(null,xrel),cljs.core.count.call(null,yrel)))?cljs.core.Vector.fromArray([xrel,yrel]):cljs.core.Vector.fromArray([yrel,xrel]));
+var r__3401 = cljs.core.nth.call(null,vec__3398__3400,0,null);
+var s__3402 = cljs.core.nth.call(null,vec__3398__3400,1,null);
+var idx__3403 = clojure.set.index.call(null,r__3401,ks__3399);
+
+return cljs.core.reduce.call(null,(function (ret,x){
+var found__3404 = idx__3403.call(null,cljs.core.select_keys.call(null,x,ks__3399));
+
+if(cljs.core.truth_(found__3404))
+{return cljs.core.reduce.call(null,(function (p1__3387_SHARP_,p2__3388_SHARP_){
+return cljs.core.conj.call(null,p1__3387_SHARP_,cljs.core.merge.call(null,p2__3388_SHARP_,x));
+}),ret,found__3404);
+} else
+{return ret;
+}
+}),cljs.core.set([]),s__3402);
+} else
+{return cljs.core.set([]);
+}
+});
+var join__3413 = (function (xrel,yrel,km){
+var vec__3405__3406 = (cljs.core.truth_(cljs.core._LT__EQ_.call(null,cljs.core.count.call(null,xrel),cljs.core.count.call(null,yrel)))?cljs.core.Vector.fromArray([xrel,yrel,clojure.set.map_invert.call(null,km)]):cljs.core.Vector.fromArray([yrel,xrel,km]));
+var r__3407 = cljs.core.nth.call(null,vec__3405__3406,0,null);
+var s__3408 = cljs.core.nth.call(null,vec__3405__3406,1,null);
+var k__3409 = cljs.core.nth.call(null,vec__3405__3406,2,null);
+var idx__3410 = clojure.set.index.call(null,r__3407,cljs.core.vals.call(null,k__3409));
+
+return cljs.core.reduce.call(null,(function (ret,x){
+var found__3411 = idx__3410.call(null,clojure.set.rename_keys.call(null,cljs.core.select_keys.call(null,x,cljs.core.keys.call(null,k__3409)),k__3409));
+
+if(cljs.core.truth_(found__3411))
+{return cljs.core.reduce.call(null,(function (p1__3389_SHARP_,p2__3390_SHARP_){
+return cljs.core.conj.call(null,p1__3389_SHARP_,cljs.core.merge.call(null,p2__3390_SHARP_,x));
+}),ret,found__3411);
+} else
+{return ret;
+}
+}),cljs.core.set([]),s__3408);
+});
+join = function(xrel,yrel,km){
+switch(arguments.length){
+case 2 :
+return join__3412.call(this,xrel,yrel);
+case 3 :
+return join__3413.call(this,xrel,yrel,km);
+}
+throw('Invalid arity: ' + arguments.length);
+};
+return join;
+})()
+;
+/**
+* Is set1 a subset of set2?
+*/
+clojure.set.subset_QMARK_ = (function subset_QMARK_(set1,set2){
+var and__3574__auto____3416 = cljs.core._LT__EQ_.call(null,cljs.core.count.call(null,set1),cljs.core.count.call(null,set2));
+
+if(cljs.core.truth_(and__3574__auto____3416))
+{return cljs.core.every_QMARK_.call(null,(function (p1__3396_SHARP_){
+return cljs.core.contains_QMARK_.call(null,set2,p1__3396_SHARP_);
+}),set1);
+} else
+{return and__3574__auto____3416;
+}
+});
+/**
+* Is set1 a superset of set2?
+*/
+clojure.set.superset_QMARK_ = (function superset_QMARK_(set1,set2){
+var and__3574__auto____3417 = cljs.core._GT__EQ_.call(null,cljs.core.count.call(null,set1),cljs.core.count.call(null,set2));
+
+if(cljs.core.truth_(and__3574__auto____3417))
+{return cljs.core.every_QMARK_.call(null,(function (p1__3415_SHARP_){
+return cljs.core.contains_QMARK_.call(null,set1,p1__3415_SHARP_);
+}),set2);
+} else
+{return and__3574__auto____3417;
+}
+});
View
290 out/clojure/string.js
@@ -0,0 +1,290 @@
+goog.provide('clojure.string');
+goog.require('cljs.core');
+goog.require('goog.string');
+goog.require('goog.string.StringBuffer');
+clojure.string.seq_reverse = (function seq_reverse(coll){
+return cljs.core.reduce.call(null,cljs.core.conj,cljs.core.List.EMPTY,coll);
+});
+/**
+* Returns s with its characters reversed.
+*/
+clojure.string.reverse = (function reverse(s){
+if(cljs.core.truth_(cljs.core._EQ_.call(null,s.length,0)))
+{return "";
+} else
+{var sb__3418 = (new goog.string.StringBuffer());
+
+var coll__3419 = clojure.string.seq_reverse.call(null,cljs.core.seq.call(null,s.split("")));
+
+while(true){
+if(cljs.core.truth_(coll__3419))
+{sb__3418.append(cljs.core.first.call(null,coll__3419));
+{
+var G__3420 = cljs.core.next.call(null,coll__3419);
+coll__3419 = G__3420;
+continue;
+}
+} else
+{}
+break;
+}
+return sb__3418.toString();
+}
+});
+/**
+* Replaces all instance of match with replacement in s.
+* match/replacement can be:
+*
+* string / string
+* pattern / (string or function of match).
+*/
+clojure.string.replace = (function replace(s,match,replacement){
+if(cljs.core.truth_(cljs.core.string_QMARK_.call(null,match)))
+{return s.replace((new goog.global['RegExp'](goog.string.regExpEscape.call(null,match),"g")),replacement);
+} else
+{if(cljs.core.truth_(match.hasOwnProperty("source")))
+{return s.replace((new goog.global['RegExp'](match.source,"g")),replacement);
+} else
+{if(cljs.core.truth_("﷐'else"))
+{throw cljs.core.str.call(null,"Invalid match arg: ",match);
+} else
+{return null;
+}
+}
+}
+});
+/**
+* Replaces the first instance of match with replacement in s.
+* match/replacement can be:
+*
+* string / string
+* pattern / (string or function of match).
+*/
+clojure.string.replace_first = (function replace_first(s,match,replacement){
+return s.replace(match,replacement);
+});
+/**
+* Returns a string of all elements in coll, as returned by (seq coll),
+* separated by an optional separator.
+*/
+clojure.string.join = (function() {
+var join = null;
+var join__3421 = (function (coll){
+return cljs.core.apply.call(null,cljs.core.str,coll);
+});
+var join__3422 = (function (separator,coll){
+return cljs.core.apply.call(null,cljs.core.str,cljs.core.interpose.call(null,separator,coll));
+});
+join = function(separator,coll){
+switch(arguments.length){
+case 1 :
+return join__3421.call(this,separator);
+case 2 :
+return join__3422.call(this,separator,coll);
+}
+throw('Invalid arity: ' + arguments.length);
+};
+return join;
+})()
+;
+/**
+* Converts string to all upper-case.
+*/
+clojure.string.upper_case = (function upper_case(s){
+return s.toUpperCase();
+});
+/**
+* Converts string to all lower-case.
+*/
+clojure.string.lower_case = (function lower_case(s){
+return s.toLowerCase();
+});
+/**
+* Converts first character of the string to upper-case, all other
+* characters to lower-case.
+*/
+clojure.string.capitalize = (function capitalize(s){
+if(cljs.core.truth_(cljs.core._LT_.call(null,cljs.core.count.call(null,s),2)))
+{return clojure.string.upper_case.call(null,s);
+} else
+{return cljs.core.str.call(null,clojure.string.upper_case.call(null,cljs.core.subs.call(null,s,0,1)),clojure.string.lower_case.call(null,cljs.core.subs.call(null,s,1)));
+}
+});
+/**
+* Splits string on a regular expression. Optional argument limit is
+* the maximum number of splits. Not lazy. Returns vector of the splits.
+*/
+clojure.string.split = (function() {
+var split = null;
+var split__3430 = (function (s,re){
+return cljs.core.vec.call(null,cljs.core.str.call(null,s).split(re));
+});
+var split__3431 = (function (s,re,limit){
+if(cljs.core.truth_(cljs.core._LT_.call(null,limit,1)))
+{return cljs.core.vec.call(null,cljs.core.str.call(null,s).split(re));
+} else
+{var s__3424 = s;
+var limit__3425 = limit;
+var parts__3426 = cljs.core.Vector.fromArray([]);
+
+while(true){
+if(cljs.core.truth_(cljs.core._EQ_.call(null,limit__3425,1)))
+{return cljs.core.conj.call(null,parts__3426,s__3424);
+} else
+{var temp__3723__auto____3427 = cljs.core.re_find.call(null,re,s__3424);
+
+if(cljs.core.truth_(temp__3723__auto____3427))
+{var m__3428 = temp__3723__auto____3427;
+
+var index__3429 = s__3424.indexOf(m__3428);
+
+{
+var G__3433 = s__3424.substring(cljs.core._PLUS_.call(null,index__3429,cljs.core.count.call(null,m__3428)));
+var G__3434 = cljs.core.dec.call(null,limit__3425);
+var G__3435 = cljs.core.conj.call(null,parts__3426,s__3424.substring(0,index__3429));
+s__3424 = G__3433;
+limit__3425 = G__3434;
+parts__3426 = G__3435;
+continue;
+}
+} else
+{return cljs.core.conj.call(null,parts__3426,s__3424);
+}
+}
+break;
+}
+}
+});
+split = function(s,re,limit){
+switch(arguments.length){
+case 2 :
+return split__3430.call(this,s,re);
+case 3 :
+return split__3431.call(this,s,re,limit);
+}
+throw('Invalid arity: ' + arguments.length);
+};
+return split;
+})()
+;
+/**
+* Splits s on
+* or
+* .
+*/
+clojure.string.split_lines = (function split_lines(s){
+return clojure.string.split.call(null,cljs.core.str.call(null,s),/\n|\r\n/);
+});
+/**
+* Removes whitespace from both ends of string.
+*/
+clojure.string.trim = (function trim(s){
+return goog.string.trim.call(null,s);
+});
+/**
+* Removes whitespace from the left side of string.
+*/
+clojure.string.triml = (function triml(s){
+return goog.string.trimLeft.call(null,s);
+});
+/**
+* Removes whitespace from the right side of string.
+*/
+clojure.string.trimr = (function trimr(s){
+return goog.string.trimRight.call(null,s);
+});
+/**
+* Removes all trailing newline \n or return \r characters from
+* string. Similar to Perl's chomp.
+*/
+clojure.string.trim_newline = (function trim_newline(s){
+var index__3436 = s.length;
+
+while(true){
+if(cljs.core.truth_(cljs.core.zero_QMARK_.call(null,index__3436)))
+{return "";
+} else
+{var ch__3437 = cljs.core.get.call(null,s,cljs.core.dec.call(null,index__3436));
+
+if(cljs.core.truth_((function (){var or__3576__auto____3438 = cljs.core._EQ_.call(null,ch__3437,"\n");
+
+if(cljs.core.truth_(or__3576__auto____3438))
+{return or__3576__auto____3438;
+} else
+{return cljs.core._EQ_.call(null,ch__3437,"\r");
+}
+})()))
+{{
+var G__3439 = cljs.core.dec.call(null,index__3436);
+index__3436 = G__3439;
+continue;
+}
+} else
+{return s.substring(0,index__3436);
+}
+}
+break;
+}
+});
+/**
+* True is s is nil, empty, or contains only whitespace.
+*/
+clojure.string.blank_QMARK_ = (function blank_QMARK_(s){
+var s__3440 = cljs.core.str.call(null,s);
+
+if(cljs.core.truth_((function (){var or__3576__auto____3441 = cljs.core.not.call(null,s__3440);
+
+if(cljs.core.truth_(or__3576__auto____3441))
+{return or__3576__auto____3441;
+} else
+{var or__3576__auto____3442 = cljs.core._EQ_.call(null,"",s__3440);
+
+if(cljs.core.truth_(or__3576__auto____3442))
+{return or__3576__auto____3442;
+} else
+{return cljs.core.re_matches.call(null,/\s+/,s__3440);
+}
+}
+})()))
+{return true;
+} else
+{return false;
+}
+});
+/**
+* Return a new string, using cmap to escape each character ch
+* from s as follows:
+*
+* If (cmap ch) is nil, append ch to the new string.
+* If (cmap ch) is non-nil, append (str (cmap ch)) instead.
+*/
+clojure.string.escape = (function escape(s,cmap){
+var buffer__3443 = (new goog.string.StringBuffer());
+var length__3444 = s.length;
+
+var index__3445 = 0;
+
+while(true){
+if(cljs.core.truth_(cljs.core._EQ_.call(null,length__3444,index__3445)))
+{return buffer__3443.toString();
+} else
+{var ch__3446 = s.charAt(index__3445);
+
+var temp__3723__auto____3447 = cljs.core.get.call(null,cmap,ch__3446);
+
+if(cljs.core.truth_(temp__3723__auto____3447))
+{var replacement__3448 = temp__3723__auto____3447;
+
+buffer__3443.append(cljs.core.str.call(null,replacement__3448));
+} else
+{buffer__3443.append(ch__3446);
+}
+{
+var G__3449 = cljs.core.inc.call(null,index__3445);
+index__3445 = G__3449;
+continue;
+}
+}
+break;
+}
+});
View
113 out/clojure/walk.js
@@ -0,0 +1,113 @@
+goog.provide('clojure.walk');
+goog.require('cljs.core');
+/**
+* Traverses form, an arbitrary data structure. inner and outer are
+* functions. Applies inner to each element of form, building up a
+* data structure of the same type, then applies outer to the result.
+* Recognizes all Clojure data structures. Consumes seqs as with doall.
+*/
+clojure.walk.walk = (function walk(inner,outer,form){
+if(cljs.core.truth_(cljs.core.seq_QMARK_.call(null,form)))
+{return outer.call(null,cljs.core.doall.call(null,cljs.core.map.call(null,inner,form)));
+} else
+{if(cljs.core.truth_(cljs.core.coll_QMARK_.call(null,form)))
+{return outer.call(null,cljs.core.into.call(null,cljs.core.empty.call(null,form),cljs.core.map.call(null,inner,form)));
+} else
+{if(cljs.core.truth_("﷐'else"))
+{return outer.call(null,form);
+} else
+{return null;
+}
+}
+}
+});
+/**
+* Performs a depth-first, post-order traversal of form. Calls f on
+* each sub-form, uses f's return value in place of the original.
+* Recognizes all Clojure data structures. Consumes seqs as with doall.
+*/
+clojure.walk.postwalk = (function postwalk(f,form){
+return clojure.walk.walk.call(null,cljs.core.partial.call(null,postwalk,f),f,form);
+});
+/**
+* Like postwalk, but does pre-order traversal.
+*/
+clojure.walk.prewalk = (function prewalk(f,form){
+return clojure.walk.walk.call(null,cljs.core.partial.call(null,prewalk,f),cljs.core.identity,f.call(null,form));
+});
+/**
+* Recursively transforms all map keys from strings to keywords.
+*/
+clojure.walk.keywordize_keys = (function keywordize_keys(m){
+var f__3455 = (function (p__3450){
+var vec__3451__3452 = p__3450;
+var k__3453 = cljs.core.nth.call(null,vec__3451__3452,0,null);
+var v__3454 = cljs.core.nth.call(null,vec__3451__3452,1,null);
+
+if(cljs.core.truth_(cljs.core.string_QMARK_.call(null,k__3453)))
+{return cljs.core.Vector.fromArray([cljs.core.keyword.call(null,k__3453),v__3454]);
+} else
+{return cljs.core.Vector.fromArray([k__3453,v__3454]);
+}
+});
+
+return clojure.walk.postwalk.call(null,(function (x){
+if(cljs.core.truth_(cljs.core.map_QMARK_.call(null,x)))
+{return cljs.core.into.call(null,cljs.core.ObjMap.fromObject([],{}),cljs.core.map.call(null,f__3455,x));
+} else
+{return x;
+}
+}),m);
+});
+/**
+* Recursively transforms all map keys from keywords to strings.
+*/
+clojure.walk.stringify_keys = (function stringify_keys(m){
+var f__3461 = (function (p__3456){
+var vec__3457__3458 = p__3456;
+var k__3459 = cljs.core.nth.call(null,vec__3457__3458,0,null);
+var v__3460 = cljs.core.nth.call(null,vec__3457__3458,1,null);
+
+if(cljs.core.truth_(cljs.core.keyword_QMARK_.call(null,k__3459)))
+{return cljs.core.Vector.fromArray([cljs.core.name.call(null,k__3459),v__3460]);
+} else
+{return cljs.core.Vector.fromArray([k__3459,v__3460]);
+}
+});
+
+return clojure.walk.postwalk.call(null,(function (x){
+if(cljs.core.truth_(cljs.core.map_QMARK_.call(null,x)))
+{return cljs.core.into.call(null,cljs.core.ObjMap.fromObject([],{}),cljs.core.map.call(null,f__3461,x));
+} else
+{return x;
+}
+}),m);
+});
+/**
+* Recursively transforms form by replacing keys in smap with their
+* values. Like clojure/replace but works on any data structure. Does
+* replacement at the root of the tree first.
+*/
+clojure.walk.prewalk_replace = (function prewalk_replace(smap,form){
+return clojure.walk.prewalk.call(null,(function (x){
+if(cljs.core.truth_(cljs.core.contains_QMARK_.call(null,smap,x)))
+{return smap.call(null,x);
+} else
+{return x;
+}
+}),form);
+});
+/**
+* Recursively transforms form by replacing keys in smap with their
+* values. Like clojure/replace but works on any data structure. Does
+* replacement at the leaves of the tree first.
+*/
+clojure.walk.postwalk_replace = (function postwalk_replace(smap,form){
+return clojure.walk.postwalk.call(null,(function (x){
+if(cljs.core.truth_(cljs.core.contains_QMARK_.call(null,smap,x)))
+{return smap.call(null,x);
+} else
+{return x;
+}
+}),form);
+});
View
506 out/clojure/zip.js
@@ -0,0 +1,506 @@
+goog.provide('clojure.zip');
+goog.require('cljs.core');
+/**
+* Creates a new zipper structure.
+*
+* branch? is a fn that, given a node, returns true if can have
+* children, even if it currently doesn't.
+*
+* children is a fn that, given a branch node, returns a seq of its
+* children.
+*
+* make-node is a fn that, given an existing node and a seq of
+* children, returns a new branch node with the supplied children.
+* root is the root node.
+*/
+clojure.zip.zipper = (function zipper(branch_QMARK_,children,make_node,root){
+return cljs.core.with_meta(cljs.core.Vector.fromArray([root,null]),cljs.core.ObjMap.fromObject(["﷐'zip/make-node","﷐'zip/children","﷐'zip/branch?"],{"﷐'zip/make-node":make_node,"﷐'zip/children":children,"﷐'zip/branch?":branch_QMARK_}));
+});
+/**
+* Returns a zipper for nested sequences, given a root sequence
+*/
+clojure.zip.seq_zip = (function seq_zip(root){
+return clojure.zip.zipper.call(null,cljs.core.seq_QMARK_,cljs.core.identity,(function (node,children){
+return cljs.core.with_meta.call(null,children,cljs.core.meta.call(null,node));
+}),root);
+});
+/**
+* Returns a zipper for nested vectors, given a root vector
+*/
+clojure.zip.vector_zip = (function vector_zip(root){
+return clojure.zip.zipper.call(null,cljs.core.vector_QMARK_,cljs.core.seq,(function (node,children){
+return cljs.core.with_meta.call(null,cljs.core.vec.call(null,children),cljs.core.meta.call(null,node));
+}),root);
+});
+/**
+* Returns a zipper for xml elements (as from xml/parse),
+* given a root element
+*/
+clojure.zip.xml_zip = (function xml_zip(root){
+return clojure.zip.zipper.call(null,cljs.core.complement.call(null,cljs.core.string_QMARK_),cljs.core.comp.call(null,cljs.core.seq,"﷐'content"),(function (node,children){
+return cljs.core.assoc.call(null,node,"﷐'content",(function (){var and__3574__auto____3462 = children;
+
+if(cljs.core.truth_(and__3574__auto____3462))
+{return cljs.core.apply.call(null,cljs.core.vector,children);
+} else
+{return and__3574__auto____3462;
+}
+})());
+}),root);
+});
+/**
+* Returns the node at loc
+*/
+clojure.zip.node = (function node(loc){
+return loc.call(null,0);
+});
+/**
+* Returns true if the node at loc is a branch
+*/
+clojure.zip.branch_QMARK_ = (function branch_QMARK_(loc){
+return "﷐'zip/branch?".call(null,cljs.core.meta.call(null,loc)).call(null,clojure.zip.node.call(null,loc));
+});
+/**
+* Returns a seq of the children of node at loc, which must be a branch
+*/
+clojure.zip.children = (function children(loc){
+if(cljs.core.truth_(clojure.zip.branch_QMARK_.call(null,loc)))
+{return "﷐'zip/children".call(null,cljs.core.meta.call(null,loc)).call(null,clojure.zip.node.call(null,loc));
+} else
+{throw "called children on a leaf node";
+}
+});
+/**
+* Returns a new branch node, given an existing node and new
+* children. The loc is only used to supply the constructor.
+*/
+clojure.zip.make_node = (function make_node(loc,node,children){
+return "﷐'zip/make-node".call(null,cljs.core.meta.call(null,loc)).call(null,node,children);
+});
+/**
+* Returns a seq of nodes leading to this loc
+*/
+clojure.zip.path = (function path(loc){
+return "﷐'pnodes".call(null,loc.call(null,1));
+});
+/**
+* Returns a seq of the left siblings of this loc
+*/
+clojure.zip.lefts = (function lefts(loc){
+return cljs.core.seq.call(null,"﷐'l".call(null,loc.call(null,1)));
+});
+/**
+* Returns a seq of the right siblings of this loc
+*/
+clojure.zip.rights = (function rights(loc){
+return "﷐'r".call(null,loc.call(null,1));
+});
+/**
+* Returns the loc of the leftmost child of the node at this loc, or
+* nil if no children
+*/
+clojure.zip.down = (function down(loc){
+if(cljs.core.truth_(clojure.zip.branch_QMARK_.call(null,loc)))
+{var vec__3463__3465 = loc;
+var node__3466 = cljs.core.nth.call(null,vec__3463__3465,0,null);
+var path__3467 = cljs.core.nth.call(null,vec__3463__3465,1,null);
+var vec__3464__3468 = clojure.zip.children.call(null,loc);
+var c__3469 = cljs.core.nth.call(null,vec__3464__3468,0,null);
+var cnext__3470 = cljs.core.nthnext.call(null,vec__3464__3468,1);
+var cs__3471 = vec__3464__3468;
+
+if(cljs.core.truth_(cs__3471))
+{return cljs.core.with_meta.call(null,cljs.core.Vector.fromArray([c__3469,cljs.core.ObjMap.fromObject(["﷐'l","﷐'pnodes","﷐'ppath","﷐'r"],{"﷐'l":cljs.core.Vector.fromArray([]),"﷐'pnodes":(cljs.core.truth_(path__3467)?cljs.core.conj.call(null,"﷐'pnodes".call(null,path__3467),node__3466):cljs.core.Vector.fromArray([node__3466])),"﷐'ppath":path__3467,"﷐'r":cnext__3470})]),cljs.core.meta.call(null,loc));
+} else
+{return null;
+}
+} else
+{return null;
+}
+});
+/**
+* Returns the loc of the parent of the node at this loc, or nil if at
+* the top
+*/
+clojure.zip.up = (function up(loc){
+var vec__3472__3473 = loc;
+var node__3474 = cljs.core.nth.call(null,vec__3472__3473,0,null);
+var path__3475 = cljs.core.nth.call(null,vec__3472__3473,1,null);
+var path__3476 = (cljs.core.truth_(cljs.core.seq_QMARK_.call(null,path__3475))?cljs.core.apply.call(null,cljs.core.hash_map,path__3475):path__3475);
+var l__3477 = cljs.core.get.call(null,path__3476,"﷐'l");
+var ppath__3478 = cljs.core.get.call(null,path__3476,"﷐'ppath");
+var pnodes__3479 = cljs.core.get.call(null,path__3476,"﷐'pnodes");
+var r__3480 = cljs.core.get.call(null,path__3476,"﷐'r");
+var changed_QMARK___3481 = cljs.core.get.call(null,path__3476,"﷐'changed?");
+
+if(cljs.core.truth_(pnodes__3479))
+{var pnode__3482 = cljs.core.peek.call(null,pnodes__3479);
+
+return cljs.core.with_meta.call(null,(cljs.core.truth_(changed_QMARK___3481)?cljs.core.Vector.fromArray([clojure.zip.make_node.call(null,loc,pnode__3482,cljs.core.concat.call(null,l__3477,cljs.core.cons.call(null,node__3474,r__3480))),(function (){var and__3574__auto____3483 = ppath__3478;
+
+if(cljs.core.truth_(and__3574__auto____3483))
+{return cljs.core.assoc.call(null,ppath__3478,"﷐'changed?",true);
+} else
+{return and__3574__auto____3483;
+}
+})()]):cljs.core.Vector.fromArray([pnode__3482,ppath__3478])),cljs.core.meta.call(null,loc));
+} else
+{return null;
+}
+});
+/**
+* zips all the way up and returns the root node, reflecting any
+* changes.
+*/
+clojure.zip.root = (function root(loc){
+while(true){
+if(cljs.core.truth_(cljs.core._EQ_.call(null,"﷐'end",loc.call(null,1))))
+{return clojure.zip.node.call(null,loc);
+} else
+{var p__3484 = clojure.zip.up.call(null,loc);
+
+if(cljs.core.truth_(p__3484))
+{{
+var G__3485 = p__3484;
+loc = G__3485;
+continue;
+}
+} else
+{return clojure.zip.node.call(null,loc);
+}
+}
+break;
+}
+});
+/**
+* Returns the loc of the right sibling of the node at this loc, or nil
+*/
+clojure.zip.right = (function right(loc){
+var vec__3486__3488 = loc;
+var node__3489 = cljs.core.nth.call(null,vec__3486__3488,0,null);
+var path__3490 = cljs.core.nth.call(null,vec__3486__3488,1,null);
+var path__3491 = (cljs.core.truth_(cljs.core.seq_QMARK_.call(null,path__3490))?cljs.core.apply.call(null,cljs.core.hash_map,path__3490):path__3490);
+var l__3492 = cljs.core.get.call(null,path__3491,"﷐'l");
+var vec__3487__3493 = cljs.core.get.call(null,path__3491,"﷐'r");
+var r__3494 = cljs.core.nth.call(null,vec__3487__3493,0,null);
+var rnext__3495 = cljs.core.nthnext.call(null,vec__3487__3493,1);
+var rs__3496 = vec__3487__3493;
+
+if(cljs.core.truth_((function (){var and__3574__auto____3497 = path__3491;
+
+if(cljs.core.truth_(and__3574__auto____3497))
+{return rs__3496;
+} else
+{return and__3574__auto____3497;
+}
+})()))
+{return cljs.core.with_meta.call(null,cljs.core.Vector.fromArray([r__3494,cljs.core.assoc.call(null,path__3491,"﷐'l",cljs.core.conj.call(null,l__3492,node__3489),"﷐'r",rnext__3495)]),cljs.core.meta.call(null,loc));
+} else
+{return null;
+}
+});
+/**
+* Returns the loc of the rightmost sibling of the node at this loc, or self
+*/
+clojure.zip.rightmost = (function rightmost(loc){
+var vec__3498__3499 = loc;
+var node__3500 = cljs.core.nth.call(null,vec__3498__3499,0,null);
+var path__3501 = cljs.core.nth.call(null,vec__3498__3499,1,null);
+var path__3502 = (cljs.core.truth_(cljs.core.seq_QMARK_.call(null,path__3501))?cljs.core.apply.call(null,cljs.core.hash_map,path__3501):path__3501);
+var l__3503 = cljs.core.get.call(null,path__3502,"﷐'l");
+var r__3504 = cljs.core.get.call(null,path__3502,"﷐'r");
+
+if(cljs.core.truth_((function (){var and__3574__auto____3505 = path__3502;
+
+if(cljs.core.truth_(and__3574__auto____3505))
+{return r__3504;
+} else
+{return and__3574__auto____3505;
+}
+})()))
+{return cljs.core.with_meta.call(null,cljs.core.Vector.fromArray([cljs.core.last.call(null,r__3504),cljs.core.assoc.call(null,path__3502,"﷐'l",cljs.core.apply.call(null,cljs.core.conj,l__3503,node__3500,cljs.core.butlast.call(null,r__3504)),"﷐'r",null)]),cljs.core.meta.call(null,loc));
+} else
+{return loc;
+}
+});
+/**
+* Returns the loc of the left sibling of the node at this loc, or nil
+*/
+clojure.zip.left = (function left(loc){
+var vec__3506__3507 = loc;
+var node__3508 = cljs.core.nth.call(null,vec__3506__3507,0,null);
+var path__3509 = cljs.core.nth.call(null,vec__3506__3507,1,null);
+var path__3510 = (cljs.core.truth_(cljs.core.seq_QMARK_.call(null,path__3509))?cljs.core.apply.call(null,cljs.core.hash_map,path__3509):path__3509);
+var l__3511 = cljs.core.get.call(null,path__3510,"﷐'l");
+var r__3512 = cljs.core.get.call(null,path__3510,"﷐'r");
+
+if(cljs.core.truth_((function (){var and__3574__auto____3513 = path__3510;
+
+if(cljs.core.truth_(and__3574__auto____3513))
+{return cljs.core.seq.call(null,l__3511);
+} else
+{return and__3574__auto____3513;
+}
+})()))
+{return cljs.core.with_meta.call(null,cljs.core.Vector.fromArray([cljs.core.peek.call(null,l__3511),cljs.core.assoc.call(null,path__3510,"﷐'l",cljs.core.pop.call(null,l__3511),"﷐'r",cljs.core.cons.call(null,node__3508,r__3512))]),cljs.core.meta.call(null,loc));
+} else
+{return null;
+}
+});
+/**
+* Returns the loc of the leftmost sibling of the node at this loc, or self
+*/
+clojure.zip.leftmost = (function leftmost(loc){
+var vec__3514__3515 = loc;
+var node__3516 = cljs.core.nth.call(null,vec__3514__3515,0,null);
+var path__3517 = cljs.core.nth.call(null,vec__3514__3515,1,null);
+var path__3518 = (cljs.core.truth_(cljs.core.seq_QMARK_.call(null,path__3517))?cljs.core.apply.call(null,cljs.core.hash_map,path__3517):path__3517);
+var l__3519 = cljs.core.get.call(null,path__3518,"﷐'l");
+var r__3520 = cljs.core.get.call(null,path__3518,"﷐'r");
+
+if(cljs.core.truth_((function (){var and__3574__auto____3521 = path__3518;
+
+if(cljs.core.truth_(and__3574__auto____3521))
+{return cljs.core.seq.call(null,l__3519);
+} else
+{return and__3574__auto____3521;
+}
+})()))
+{return cljs.core.with_meta.call(null,cljs.core.Vector.fromArray([cljs.core.first.call(null,l__3519),cljs.core.assoc.call(null,path__3518,"﷐'l",cljs.core.Vector.fromArray([]),"﷐'r",cljs.core.concat.call(null,cljs.core.rest.call(null,l__3519),cljs.core.Vector.fromArray([node__3516]),r__3520))]),cljs.core.meta.call(null,loc));
+} else
+{return loc;
+}
+});
+/**
+* Inserts the item as the left sibling of the node at this loc,
+* without moving
+*/
+clojure.zip.insert_left = (function insert_left(loc,item){
+var vec__3522__3523 = loc;
+var node__3524 = cljs.core.nth.call(null,vec__3522__3523,0,null);
+var path__3525 = cljs.core.nth.call(null,vec__3522__3523,1,null);
+var path__3526 = (cljs.core.truth_(cljs.core.seq_QMARK_.call(null,path__3525))?cljs.core.apply.call(null,cljs.core.hash_map,path__3525):path__3525);
+var l__3527 = cljs.core.get.call(null,path__3526,"﷐'l");
+
+if(cljs.core.truth_(cljs.core.nil_QMARK_.call(null,path__3526)))
+{throw "Insert at top";
+} else
+{return cljs.core.with_meta.call(null,cljs.core.Vector.fromArray([node__3524,cljs.core.assoc.call(null,path__3526,"﷐'l",cljs.core.conj.call(null,l__3527,item),"﷐'changed?",true)]),cljs.core.meta.call(null,loc));
+}
+});
+/**
+* Inserts the item as the right sibling of the node at this loc,
+* without moving
+*/
+clojure.zip.insert_right = (function insert_right(loc,item){
+var vec__3528__3529 = loc;
+var node__3530 = cljs.core.nth.call(null,vec__3528__3529,0,null);
+var path__3531 = cljs.core.nth.call(null,vec__3528__3529,1,null);
+var path__3532 = (cljs.core.truth_(cljs.core.seq_QMARK_.call(null,path__3531))?cljs.core.apply.call(null,cljs.core.hash_map,path__3531):path__3531);
+var r__3533 = cljs.core.get.call(null,path__3532,"﷐'r");
+
+if(cljs.core.truth_(cljs.core.nil_QMARK_.call(null,path__3532)))
+{throw "Insert at top";
+} else
+{return cljs.core.with_meta.call(null,cljs.core.Vector.fromArray([node__3530,cljs.core.assoc.call(null,path__3532,"﷐'r",cljs.core.cons.call(null,item,r__3533),"﷐'changed?",true)]),cljs.core.meta.call(null,loc));
+}
+});
+/**
+* Replaces the node at this loc, without moving
+*/
+clojure.zip.replace = (function replace(loc,node){
+var vec__3534__3535 = loc;
+var ___3536 = cljs.core.nth.call(null,vec__3534__3535,0,null);
+var path__3537 = cljs.core.nth.call(null,vec__3534__3535,1,null);
+
+return cljs.core.with_meta.call(null,cljs.core.Vector.fromArray([node,cljs.core.assoc.call(null,path__3537,"﷐'changed?",true)]),cljs.core.meta.call(null,loc));
+});
+/**
+* Replaces the node at this loc with the value of (f node args)
+* @param {...*} var_args
+*/
+clojure.zip.edit = (function() {
+var edit__delegate = function (loc,f,args){
+return clojure.zip.replace.call(null,loc,cljs.core.apply.call(null,f,clojure.zip.node.call(null,loc),args));
+};
+var edit = function (loc,f,var_args){
+var args = null;
+if (goog.isDef(var_args)) {
+ args = cljs.core.array_seq(Array.prototype.slice.call(arguments, 2),0);
+}
+return edit__delegate.call(this, loc, f, args);
+};
+edit.cljs$lang$maxFixedArity = 2;
+edit.cljs$lang$applyTo = (function (arglist__3538){
+var loc = cljs.core.first(arglist__3538);
+var f = cljs.core.first(cljs.core.next(arglist__3538));
+var args = cljs.core.rest(cljs.core.next(arglist__3538));
+return edit__delegate.call(this, loc, f, args);
+});
+return edit;
+})()
+;
+/**
+* Inserts the item as the leftmost child of the node at this loc,
+* without moving
+*/
+clojure.zip.insert_child = (function insert_child(loc,item){
+return clojure.zip.replace.call(null,loc,clojure.zip.make_node.call(null,loc,clojure.zip.node.call(null,loc),cljs.core.cons.call(null,item,clojure.zip.children.call(null,loc))));
+});
+/**
+* Inserts the item as the rightmost child of the node at this loc,
+* without moving
+*/
+clojure.zip.append_child = (function append_child(loc,item){
+return clojure.zip.replace.call(null,loc,clojure.zip.make_node.call(null,loc,clojure.zip.node.call(null,loc),cljs.core.concat.call(null,clojure.zip.children.call(null,loc),cljs.core.Vector.fromArray([item]))));
+});
+/**
+* Moves to the next loc in the hierarchy, depth-first. When reaching
+* the end, returns a distinguished loc detectable via end?. If already
+* at the end, stays there.
+*/
+clojure.zip.next = (function next(loc){
+if(cljs.core.truth_(cljs.core._EQ_.call(null,"﷐'end",loc.call(null,1))))
+{return loc;
+} else
+{var or__3576__auto____3540 = (function (){var and__3574__auto____3539 = clojure.zip.branch_QMARK_.call(null,loc);
+
+if(cljs.core.truth_(and__3574__auto____3539))
+{return clojure.zip.down.call(null,loc);
+} else
+{return and__3574__auto____3539;
+}
+})();
+
+if(cljs.core.truth_(or__3576__auto____3540))
+{return or__3576__auto____3540;
+} else
+{var or__3576__auto____3541 = clojure.zip.right.call(null,loc);
+
+if(cljs.core.truth_(or__3576__auto____3541))
+{return or__3576__auto____3541;
+} else
+{var p__3542 = loc;
+
+while(true){
+if(cljs.core.truth_(clojure.zip.up.call(null,p__3542)))
+{var or__3576__auto____3543 = clojure.zip.right.call(null,clojure.zip.up.call(null,p__3542));
+
+if(cljs.core.truth_(or__3576__auto____3543))
+{return or__3576__auto____3543;
+} else
+{{
+var G__3544 = clojure.zip.up.call(null,p__3542);
+p__3542 = G__3544;
+continue;
+}
+}
+} else
+{return cljs.core.Vector.fromArray([clojure.zip.node.call(null,p__3542),"﷐'end"]);
+}
+break;
+}
+}
+}
+}
+});
+/**
+* Moves to the previous loc in the hierarchy, depth-first. If already
+* at the root, returns nil.
+*/
+clojure.zip.prev = (function prev(loc){
+var temp__3723__auto____3545 = clojure.zip.left.call(null,loc);
+
+if(cljs.core.truth_(temp__3723__auto____3545))
+{var lloc__3546 = temp__3723__auto____3545;
+
+var loc__3547 = lloc__3546;
+
+while(true){
+var temp__3723__auto____3549 = (function (){var and__3574__auto____3548 = clojure.zip.branch_QMARK_.call(null,loc__3547);
+
+if(cljs.core.truth_(and__3574__auto____3548))
+{return clojure.zip.down.call(null,loc__3547);
+} else
+{return and__3574__auto____3548;
+}
+})();
+
+if(cljs.core.truth_(temp__3723__auto____3549))
+{var child__3550 = temp__3723__auto____3549;
+
+{
+var G__3551 = clojure.zip.rightmost.call(null,child__3550);
+loc__3547 = G__3551;
+continue;
+}
+} else
+{return loc__3547;
+}
+break;
+}
+} else
+{return clojure.zip.up.call(null,loc);
+}
+});
+/**
+* Returns true if loc represents the end of a depth-first walk
+*/
+clojure.zip.end_QMARK_ = (function end_QMARK_(loc){
+return cljs.core._EQ_.call(null,"﷐'end",loc.call(null,1));
+});
+/**
+* Removes the node at loc, returning the loc that would have preceded
+* it in a depth-first walk.
+*/
+clojure.zip.remove = (function remove(loc){
+var vec__3552__3553 = loc;
+var node__3554 = cljs.core.nth.call(null,vec__3552__3553,0,null);
+var path__3555 = cljs.core.nth.call(null,vec__3552__3553,1,null);
+var path__3556 = (cljs.core.truth_(cljs.core.seq_QMARK_.call(null,path__3555))?cljs.core.apply.call(null,cljs.core.hash_map,path__3555):path__3555);
+var l__3557 = cljs.core.get.call(null,path__3556,"﷐'l");
+var ppath__3558 = cljs.core.get.call(null,path__3556,"﷐'ppath");
+var pnodes__3559 = cljs.core.get.call(null,path__3556,"﷐'pnodes");
+var rs__3560 = cljs.core.get.call(null,path__3556,"﷐'r");
+
+if(cljs.core.truth_(cljs.core.nil_QMARK_.call(null,path__3556)))
+{throw "Remove at top";
+} else
+{if(cljs.core.truth_(cljs.core.pos_QMARK_.call(null,cljs.core.count.call(null,l__3557))))
+{var loc__3561 = cljs.core.with_meta.call(null,cljs.core.Vector.fromArray([cljs.core.peek.call(null,l__3557),cljs.core.assoc.call(null,path__3556,"﷐'l",cljs.core.pop.call(null,l__3557),"﷐'changed?",true)]),cljs.core.meta.call(null,loc));
+
+while(true){
+var temp__3723__auto____3563 = (function (){var and__3574__auto____3562 = clojure.zip.branch_QMARK_.call(null,loc__3561);
+
+if(cljs.core.truth_(and__3574__auto____3562))
+{return clojure.zip.down.call(null,loc__3561);
+} else
+{return and__3574__auto____3562;
+}
+})();
+
+if(cljs.core.truth_(temp__3723__auto____3563))
+{var child__3564 = temp__3723__auto____3563;
+
+{
+var G__3566 = clojure.zip.rightmost.call(null,child__3564);
+loc__3561 = G__3566;
+continue;
+}
+} else
+{return loc__3561;
+}
+break;
+}
+} else
+{return cljs.core.with_meta.call(null,cljs.core.Vector.fromArray([clojure.zip.make_node.call(null,loc,cljs.core.peek.call(null,pnodes__3559),rs__3560),(function (){var and__3574__auto____3565 = ppath__3558;
+
+if(cljs.core.truth_(and__3574__auto____3565))
+{return cljs.core.assoc.call(null,ppath__3558,"﷐'changed?",true);
+} else
+{return and__3574__auto____3565;
+}
+})()]),cljs.core.meta.call(null,loc));
+}
+}
+});
View
5 out/goog/deps.js
@@ -688,3 +688,8 @@ goog.addDependency('../goog-ext/mochikit/async/deferredlist.js', ['goog.async.De
goog.addDependency('../goog-ext/osapi/osapi.js', ['goog.osapi'], []);
goog.addDependency('../goog-ext/silverlight/silverlight.js', ['goog.silverlight'], []);
goog.addDependency('../goog-ext/silverlight/supporteduseragent.js', ['goog.silverlight.supportedUserAgent'], []);
+
+/* CLOJURE DEPS */
+goog.addDependency("../clojure/set.js", ['clojure.set'], ['cljs.core']);
+goog.addDependency("../clojure/string.js", ['clojure.string'], ['cljs.core', 'goog.string', 'goog.string.StringBuffer']);
+
View
2 script/cljbrepl
@@ -6,6 +6,6 @@ CLJS_CLJS=$CLOJURESCRIPT_HOME/src/cljs
BREPL_SRC=$BREPL_DIR/src/
BREPL_LIB=$BREPL_DIR/lib/*
-java -server -Xmx2G -Xms2G -Xmn256m -cp "${CLJS_LIB}:${CLJS_SRC}:${CLJS_CLJS}:${BREPL_SRC}:${BREPL_LIB}" clojure.main -e \
+java -server -Xmx2G -Xms2G -Xmn256m -cp "${CLJS_LIB}:${CLJS_SRC}:${CLJS_CLJS}:${BREPL_SRC}:${BREPL_LIB}:$1" clojure.main -e \
"(require '[brepl.core :as brepl])
(brepl/browser-repl {:classpath \"$1\"})"
View
3 src/brepl/core.clj
@@ -43,7 +43,8 @@
(defn browser-eval1
[repl-env env form]
(try
- (when-not (browser-handles? env form)
+ (when-not (and (seq? form)
+ (browser-handles? env form))
(let [ast (analyze env form)]
(server/send-js (emits ast))))
(catch Throwable ex

0 comments on commit 7391a29

Please sign in to comment.
Something went wrong with that request. Please try again.