khepri-compile
Advanced tools
Comparing version
/* | ||
* THIS FILE IS AUTO GENERATED FROM 'lib/reachable.kep' | ||
* THIS FILE IS AUTO GENERATED from 'lib/reachable.kep' | ||
* DO NOT EDIT | ||
*/ | ||
"use strict"; | ||
*/"use strict"; | ||
var record = require("bes")["record"], | ||
@@ -21,3 +20,3 @@ hamt = require("hamt"), | ||
getUid = __o1["getUid"], | ||
optimize, x, y, x0, consequent, alternate, consequent0, x1, State = record.declare(null, ["bindings"]); | ||
optimize, x, y, consequent, x0, State = record.declare(null, ["bindings"]); | ||
(State.empty = State.create(hamt.empty)); | ||
@@ -51,12 +50,2 @@ (State.prototype.setReference = (function(uid, count) { | ||
})), | ||
setCount = (function(uid, count) { | ||
return (uid ? modifyState((function(s) { | ||
return s.setReference(uid, count); | ||
})) : pass); | ||
}), | ||
getCount = (function(uid, yes, no) { | ||
return (uid ? getState.map((function(s) { | ||
return s.getCount(uid); | ||
})) : M.of(0)); | ||
}), | ||
isReachable = (function(uid, yes, no) { | ||
@@ -119,15 +108,6 @@ return (uid ? getState.chain((function(s) { | ||
addRewrite(["LogicalExpression", "BinaryExpression"], seq(child("left", checkTop), child("right", checkTop))); | ||
addRewrite("AssignmentExpression", ((x0 = type), (consequent = extract((function(node) { | ||
var uid = getUid(node.left); | ||
return getCount(uid) | ||
.chain((function(count) { | ||
return (count ? seq(child("right", checkTop), setCount(uid, count)) : set(null)); | ||
})); | ||
}))), (alternate = seq(child("left", checkTop), child("right", checkTop))), extract((function(node) { | ||
var x1, y0; | ||
return (((x1 = node.left), (y0 = x0(x1)), ("Identifier" === y0)) ? consequent : (alternate || pass)); | ||
})))); | ||
addRewrite("MemberExpression", seq(child("object", checkTop), ((consequent0 = child("property", checkTop)), extract(( | ||
addRewrite("AssignmentExpression", seq(child("left", checkTop), child("right", checkTop))); | ||
addRewrite("MemberExpression", seq(child("object", checkTop), ((consequent = child("property", checkTop)), extract(( | ||
function(node) { | ||
return (node.computed ? consequent0 : (undefined || pass)); | ||
return (node.computed ? consequent : (undefined || pass)); | ||
}))))); | ||
@@ -142,4 +122,4 @@ addRewrite("NewExpression", seq(child("callee", checkTop), child("args", checkTop))); | ||
addRewrite("ObjectValue", child("value", checkTop)); | ||
addRewrite("Identifier", extract(((x1 = getUid), (function(x2) { | ||
var uid = x1(x2); | ||
addRewrite("Identifier", extract(((x0 = getUid), (function(x1) { | ||
var uid = x0(x1); | ||
return (uid ? modifyState((function(s) { | ||
@@ -146,0 +126,0 @@ return s.addReference(uid); |
{ | ||
"name": "khepri-compile", | ||
"version": "0.5.4", | ||
"version": "0.5.5", | ||
"description": "Compiler for the Khepri programming language", | ||
@@ -5,0 +5,0 @@ "author": "Matt Bierner", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
258182
-0.4%3409
-0.58%