@fraczak/k
Advanced tools
Comparing version 1.1.3 to 1.1.4
@@ -159,2 +159,3 @@ // Generated by CoffeeScript 2.7.0 | ||
(function(code) { | ||
var ref; | ||
switch (code.code) { | ||
@@ -170,3 +171,3 @@ case "union": | ||
code: "vector", | ||
vector: representatives[code.vector] | ||
vector: (ref = representatives[code.vector]) != null ? ref : code.vector | ||
}; | ||
@@ -173,0 +174,0 @@ } |
{ | ||
"name": "@fraczak/k", | ||
"version": "1.1.3", | ||
"version": "1.1.4", | ||
"description": "k-language for JSON-like data transformation", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -115,3 +115,4 @@ // Generated by CoffeeScript 2.7.0 | ||
// representatives = run.defs.representatives | ||
// console.log {code,value,representatives} | ||
// defCodes = JSON.stringify run.defs.codes | ||
// console.log {code,value, representatives, defCodes} | ||
switch (code.code) { | ||
@@ -118,0 +119,0 @@ case "vector": |
30
test.js
@@ -119,2 +119,32 @@ // Generated by CoffeeScript 2.7.0 | ||
k_expression = "$ < < [ int ] ints, [ bool ] bools > list, string None>"; | ||
k_fn = k.compile(k_expression); | ||
console.log(`var k_fn = k.compile('${k_expression}');`); | ||
console.log(""); | ||
[ | ||
{ | ||
None: "None" | ||
}, | ||
{ | ||
list: { | ||
ints: [] | ||
} | ||
}, | ||
{ | ||
list: { | ||
ints: [1, | ||
2, | ||
3] | ||
} | ||
} | ||
].map(function(data) { | ||
console.log(`k_fn(${JSON.stringify(data)});`); | ||
console.log(`// RETURNS: ${JSON.stringify(k_fn(data))}`); | ||
return console.log(""); | ||
}); | ||
}).call(this); |
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
83446
1498