Skip to content

Instantly share code, notes, and snippets.

@swannodette swannodette/match.js
Created Jun 24, 2013

Embed
What would you like to do?
/*
(defn balance-array [node]
(matchv ::m/objects [node]
[(:or [:black [:red [:red a x b] y c] z d]
[:black [:red a x [:red b y c]] z d]
[:black a x [:red [:red b y c] z d]]
[:black a x [:red b y [:red c z d]]])] :balance
:else :balanced))
*/
function xu(a) {
var b = a instanceof Array;
if((b ? 4 === a.length : b) && A.a(a[0], "\ufdd0:black")) {
var b = a[1], e = b instanceof Array;
if(e ? 4 === b.length : e) {
if(A.a(b[0], "\ufdd0:red")) {
var e = b[1], h = e instanceof Array;
if(h ? 4 === e.length : h) {
if(A.a(e[0], "\ufdd0:red")) {
return"\ufdd0:balance"
}
b = b[3];
if((e = b instanceof Array) ? 4 === b.length : e) {
if(A.a(b[0], "\ufdd0:red")) {
return"\ufdd0:balance"
}
a = a[3];
if(((b = a instanceof Array) ? 4 === a.length : b) && A.a(a[0], "\ufdd0:red")) {
b = a[1];
if((e = b instanceof Array) ? 4 === b.length : e) {
if(A.a(b[0], "\ufdd0:red")) {
return"\ufdd0:balance"
}
a = a[3];
return((b = a instanceof Array) ? 4 === a.length : b) && A.a(a[0], "\ufdd0:red") ? "\ufdd0:balance" : "\ufdd0:balanced"
}
a = a[3];
if(((b = a instanceof Array) ? 4 === a.length : b) && A.a(a[0], "\ufdd0:red")) {
return"\ufdd0:balance"
}
}
return"\ufdd0:balanced"
}
a = a[3];
if(((b = a instanceof Array) ? 4 === a.length : b) && A.a(a[0], "\ufdd0:red")) {
b = a[1];
if((e = b instanceof Array) ? 4 === b.length : e) {
if(A.a(b[0], "\ufdd0:red")) {
return"\ufdd0:balance"
}
a = a[3];
return((b = a instanceof Array) ? 4 === a.length : b) && A.a(a[0], "\ufdd0:red") ? "\ufdd0:balance" : "\ufdd0:balanced"
}
a = a[3];
if(((b = a instanceof Array) ? 4 === a.length : b) && A.a(a[0], "\ufdd0:red")) {
return"\ufdd0:balance"
}
}
return"\ufdd0:balanced"
}
b = b[3];
if((e = b instanceof Array) ? 4 === b.length : e) {
if(A.a(b[0], "\ufdd0:red")) {
return"\ufdd0:balance"
}
a = a[3];
if(((b = a instanceof Array) ? 4 === a.length : b) && A.a(a[0], "\ufdd0:red")) {
b = a[1];
if((e = b instanceof Array) ? 4 === b.length : e) {
if(A.a(b[0], "\ufdd0:red")) {
return"\ufdd0:balance"
}
a = a[3];
return((b = a instanceof Array) ? 4 === a.length : b) && A.a(a[0], "\ufdd0:red") ? "\ufdd0:balance" : "\ufdd0:balanced"
}
a = a[3];
if(((b = a instanceof Array) ? 4 === a.length : b) && A.a(a[0], "\ufdd0:red")) {
return"\ufdd0:balance"
}
}
return"\ufdd0:balanced"
}
a = a[3];
if(((b = a instanceof Array) ? 4 === a.length : b) && A.a(a[0], "\ufdd0:red")) {
b = a[1];
if((e = b instanceof Array) ? 4 === b.length : e) {
if(A.a(b[0], "\ufdd0:red")) {
return"\ufdd0:balance"
}
a = a[3];
return((b = a instanceof Array) ? 4 === a.length : b) && A.a(a[0], "\ufdd0:red") ? "\ufdd0:balance" : "\ufdd0:balanced"
}
a = a[3];
if(((b = a instanceof Array) ? 4 === a.length : b) && A.a(a[0], "\ufdd0:red")) {
return"\ufdd0:balance"
}
}
return"\ufdd0:balanced"
}
a = a[3];
if(((b = a instanceof Array) ? 4 === a.length : b) && A.a(a[0], "\ufdd0:red")) {
b = a[1];
if((e = b instanceof Array) ? 4 === b.length : e) {
if(A.a(b[0], "\ufdd0:red")) {
return"\ufdd0:balance"
}
a = a[3];
return((b = a instanceof Array) ? 4 === a.length : b) && A.a(a[0], "\ufdd0:red") ? "\ufdd0:balance" : "\ufdd0:balanced"
}
a = a[3];
if(((b = a instanceof Array) ? 4 === a.length : b) && A.a(a[0], "\ufdd0:red")) {
return"\ufdd0:balance"
}
}
return"\ufdd0:balanced"
}
a = a[3];
if(((b = a instanceof Array) ? 4 === a.length : b) && A.a(a[0], "\ufdd0:red")) {
b = a[1];
if((e = b instanceof Array) ? 4 === b.length : e) {
if(A.a(b[0], "\ufdd0:red")) {
return"\ufdd0:balance"
}
a = a[3];
return((b = a instanceof Array) ? 4 === a.length : b) && A.a(a[0], "\ufdd0:red") ? "\ufdd0:balance" : "\ufdd0:balanced"
}
a = a[3];
if(((b = a instanceof Array) ? 4 === a.length : b) && A.a(a[0], "\ufdd0:red")) {
return"\ufdd0:balance"
}
}
}
return"\ufdd0:balanced"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.