khepri-compile
Advanced tools
Comparing version 1.3.5 to 1.3.6
@@ -35,20 +35,16 @@ /* | ||
(rename = (function(prefix, list, root) { | ||
var x = tree.node, | ||
y = preWalk((function(ctx) { | ||
var node = tree.node(ctx), | ||
uid = getUid(node); | ||
return (contains(list, uid) ? tree.setNode(setUid(((prefix + "-") + uid), node), ctx) : (( | ||
type(node) === "FunctionExpression") ? tree.setNode(prefixClosure(node, prefix, | ||
list), ctx) : ctx)); | ||
}), khepriZipper(root)); | ||
return x(y); | ||
return tree.node(preWalk((function(ctx) { | ||
var node = tree.node(ctx), | ||
uid = getUid(node); | ||
return (contains(list, uid) ? tree.setNode(setUid(((prefix + "-") + uid), node), ctx) : (( | ||
type(node) === "FunctionExpression") ? tree.setNode(prefixClosure(node, prefix, | ||
list), ctx) : ctx)); | ||
}), khepriZipper(root))); | ||
})); | ||
(incCount = (function(target, count, value, root) { | ||
var x = tree.node, | ||
y = preWalk((function(ctx) { | ||
var node = tree.node(ctx), | ||
uid = getUid(node); | ||
return ((target === uid) ? tree.setNode(incrementCount(node, count, value), ctx) : ctx); | ||
}), khepriZipper(root)); | ||
return x(y); | ||
return tree.node(preWalk((function(ctx) { | ||
var node = tree.node(ctx), | ||
uid = getUid(node); | ||
return ((target === uid) ? tree.setNode(incrementCount(node, count, value), ctx) : ctx); | ||
}), khepriZipper(root))); | ||
})); | ||
@@ -55,0 +51,0 @@ (exports["rename"] = rename); |
@@ -15,3 +15,3 @@ /* | ||
builtinBinaryOps = ["*", "/", "+", "-", "%", "<<", ">>", ">>>", "<", ">", "<=", ">=", "==", "!=", "===", "!==", "&", | ||
"^", "|", "||", "&&", "|>", "||>", "\\>", "\\>>", "<|", "<<|", "<\\", "<<\\", ".", "??", "@", "instanceof", | ||
"^", "|", "||", "&&", "|>", "|>>", "\\>", "\\>>", "<|", "<<|", "<\\", "<<\\", ".", "??", "@", "instanceof", | ||
"new" | ||
@@ -18,0 +18,0 @@ ], |
{ | ||
"name": "khepri-compile", | ||
"version": "1.3.5", | ||
"version": "1.3.6", | ||
"description": "Compiler for the Khepri programming language", | ||
@@ -5,0 +5,0 @@ "author": "Matt Bierner", |
@@ -49,2 +49,18 @@ var parser = require('khepri-parse').parse.parser; | ||
test.equal( | ||
testParser("var args := \\...args -> args.length; [] |>> args;"), | ||
0); | ||
test.equal( | ||
testParser("var args := \\...args -> args.length; [1, 2] |>> args;"), | ||
2); | ||
test.equal( | ||
testParser("var args := \\...args -> args.length; var x = [1, 2]; x |>> args;"), | ||
2); | ||
test.done(); | ||
}; | ||
exports.reverse_pipen = function(test) { | ||
test.equal( | ||
testParser("var args := \\...args -> args.length; args <<| [];"), | ||
@@ -51,0 +67,0 @@ 0); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
375685
5239