New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@fraczak/k

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fraczak/k - npm Package Compare versions

Comparing version 1.1.4 to 1.2.0

Examples/bnat.k

13

package.json
{
"name": "@fraczak/k",
"version": "1.1.4",
"version": "1.2.0",
"description": "k-language for JSON-like data transformation",

@@ -8,4 +8,4 @@ "main": "index.js",

"prepare": "coffee -c symbol-table.coffee; jison parser.jison",
"prepublishOnly": "coffee -c *.coffee; echo '#!/usr/bin/env node' | cat - k.js > k.sh",
"all": "npm run prepublishOnly; npm run prepare; npm run prepublishOnly",
"prepublishOnly": "coffee -c *.coffee; echo '#!/usr/bin/env node' | cat - k.js > k.sh; echo '#!/usr/bin/env node' | cat - repl.js > repl.sh;",
"all": "coffee -c *.coffee; npm run prepare; npm run prepublishOnly",
"test": "coffee -c symbol-table.coffee; jison parser.jison; coffee test.coffee"

@@ -16,10 +16,9 @@ },

"bin": {
"k": "./k.sh"
"k": "./k.sh",
"k-repl": "./repl.sh"
},
"devDependencies": {
"jison": "^0.4.18"
},
"dependencies": {
"jison": "^0.4.18",
"coffeescript": "^2.7.0"
}
}

@@ -75,8 +75,8 @@ /* parser generated by jison 0.4.18 */

var parser = (function(){
var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[4,6,8,15,17,20,22,31,33],$V1=[1,7],$V2=[1,15],$V3=[1,16],$V4=[1,8],$V5=[1,9],$V6=[1,10],$V7=[1,11],$V8=[1,14],$V9=[1,20],$Va=[4,6,8,12,15,17,20,22,31,33],$Vb=[2,25],$Vc=[1,24],$Vd=[1,25],$Ve=[1,26],$Vf=[4,6,8,12,14,15,17,19,20,21,22,23,26,31,32,33],$Vg=[2,42],$Vh=[2,28],$Vi=[2,8],$Vj=[2,12],$Vk=[19,26],$Vl=[21,23,26],$Vm=[19,23,26],$Vn=[2,38],$Vo=[2,39];
var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[4,6,8,15,18,21,23,32,34],$V1=[1,7],$V2=[1,15],$V3=[1,16],$V4=[1,8],$V5=[1,9],$V6=[1,10],$V7=[1,11],$V8=[1,14],$V9=[1,20],$Va=[4,6,8,12,15,18,21,23,32,34],$Vb=[2,26],$Vc=[1,25],$Vd=[1,26],$Ve=[1,27],$Vf=[4,6,8,12,14,15,18,20,21,22,23,24,27,32,33,34],$Vg=[2,43],$Vh=[2,29],$Vi=[2,8],$Vj=[2,13],$Vk=[20,27],$Vl=[22,24,27],$Vm=[20,24,27],$Vn=[2,39],$Vo=[2,40];
var parser = {trace: function trace () { },
yy: {},
symbols_: {"error":2,"name":3,"NAME":4,"str":5,"STRING":6,"int":7,"INT":8,"input_with_eof":9,"defs":10,"comp":11,"EOF":12,"EQ":13,"SC":14,"DOLLAR":15,"code":16,"LC":17,"labelled_codes":18,"RC":19,"LB":20,"RB":21,"LA":22,"RA":23,"non_empty_labelled_codes":24,"code_label":25,"COMMA":26,"COL":27,"exp":28,"labelled":29,"list":30,"LP":31,"RP":32,"DOT":33,"non_empty_labelled":34,"comp_label":35,"non_empty_list":36,"$accept":0,"$end":1},
terminals_: {2:"error",4:"NAME",6:"STRING",8:"INT",12:"EOF",13:"EQ",14:"SC",15:"DOLLAR",17:"LC",19:"RC",20:"LB",21:"RB",22:"LA",23:"RA",26:"COMMA",27:"COL",31:"LP",32:"RP",33:"DOT"},
productions_: [0,[3,1],[5,1],[7,1],[9,3],[10,0],[10,5],[10,6],[16,1],[16,3],[16,3],[16,3],[18,0],[18,1],[24,1],[24,3],[25,2],[25,2],[25,3],[25,3],[11,1],[11,2],[28,3],[28,3],[28,3],[28,1],[28,2],[28,3],[28,1],[28,1],[28,2],[28,2],[28,2],[28,2],[29,0],[29,1],[34,1],[34,3],[35,2],[35,2],[35,3],[35,3],[30,0],[30,1],[36,1],[36,3]],
symbols_: {"error":2,"name":3,"NAME":4,"str":5,"STRING":6,"int":7,"INT":8,"input_with_eof":9,"defs":10,"comp":11,"EOF":12,"EQ":13,"SC":14,"DOLLAR":15,"codeDef":16,"code":17,"LC":18,"labelled_codes":19,"RC":20,"LB":21,"RB":22,"LA":23,"RA":24,"non_empty_labelled_codes":25,"code_label":26,"COMMA":27,"COL":28,"exp":29,"labelled":30,"list":31,"LP":32,"RP":33,"DOT":34,"non_empty_labelled":35,"comp_label":36,"non_empty_list":37,"$accept":0,"$end":1},
terminals_: {2:"error",4:"NAME",6:"STRING",8:"INT",12:"EOF",13:"EQ",14:"SC",15:"DOLLAR",18:"LC",20:"RC",21:"LB",22:"RB",23:"LA",24:"RA",27:"COMMA",28:"COL",32:"LP",33:"RP",34:"DOT"},
productions_: [0,[3,1],[5,1],[7,1],[9,3],[10,0],[10,5],[10,6],[17,1],[17,1],[16,3],[16,3],[16,3],[19,0],[19,1],[25,1],[25,3],[26,2],[26,2],[26,3],[26,3],[11,1],[11,2],[29,3],[29,3],[29,3],[29,1],[29,2],[29,3],[29,1],[29,1],[29,2],[29,2],[29,2],[29,2],[30,0],[30,1],[35,1],[35,3],[36,2],[36,2],[36,3],[36,3],[31,0],[31,1],[37,1],[37,3]],
performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {

@@ -115,86 +115,84 @@ /* this == yyval */

break;
case 9:
this.$ = {code: "product",
product: $$[$0-1].reduce((r, lc) => {
r[lc.label] = s.as_ref(lc.code);
return r }
, {})};
case 9: case 21: case 36: case 44:
this.$ = $$[$0];
break;
case 10:
this.$ = {code: "vector", vector: s.as_ref($$[$0-1])};
this.$ = {code: "product", product: $$[$0-1]};
break;
case 11:
this.$ = {code: "union",
union: $$[$0-1].reduce((r, lc) => {
r[lc.label] = s.as_ref(lc.code);
return r }
, {})};
this.$ = {code: "vector", vector: s.as_ref($$[$0-1])};
break;
case 12:
this.$ = []
this.$ = {code: "union", union: $$[$0-1]};
break;
case 13: case 20: case 35: case 43:
this.$ = $$[$0];
case 13:
this.$ = {}
break;
case 14: case 44:
case 14:
this.$ = $$[$0].reduce((r, lc) => {
r[lc.label] = s.as_ref(lc.code);
return r }
, {});
break;
case 15: case 45:
this.$ = [$$[$0]];
break;
case 15: case 45:
case 16: case 46:
this.$ = [].concat($$[$0-2],$$[$0]);
break;
case 16: case 17:
case 17: case 18:
this.$ = {label: $$[$0], code: $$[$0-1]};
break;
case 18: case 19:
case 19: case 20:
this.$ = {label: $$[$0-2], code: $$[$0]};
break;
case 21:
case 22:
this.$ = s.comp($$[$0-1], $$[$0]);
break;
case 22:
case 23:
this.$ = $$[$0-1];
break;
case 23:
case 24:
this.$ = {op: "vector", vector: $$[$0-1]};
break;
case 24:
case 25:
this.$ = s.union($$[$0-1]);
break;
case 25:
case 26:
this.$ = {op: "ref", ref: $$[$0]};
break;
case 26:
case 27:
this.$ = s.identity;
break;
case 27:
case 28:
this.$ = $$[$0-1];
break;
case 28:
case 29:
this.$ = {op: "str", str: $$[$0]};
break;
case 29:
case 30:
this.$ = {op: "int", int: $$[$0]};
break;
case 30: case 31: case 32:
case 31: case 32: case 33:
this.$ = {op: "dot", dot: $$[$0]};
break;
case 33:
case 34:
this.$ = {op: "code", code: s.as_ref($$[$0])};
break;
case 34:
case 35:
this.$ = {op: "product", product: []};
break;
case 36:
case 37:
this.$ = {op: "product", product: [$$[$0]]};
break;
case 37:
case 38:
$$[$0-2].product = [].concat($$[$0-2].product,$$[$0]); this.$ = $$[$0-2];
break;
case 38: case 39:
case 39: case 40:
this.$ = {label: $$[$0], exp: $$[$0-1]};
break;
case 40: case 41:
case 41: case 42:
this.$ = {label: $$[$0-2], exp: $$[$0]};
break;
case 42:
case 43:
this.$ = [];

@@ -204,3 +202,3 @@ break;

},
table: [o($V0,[2,5],{9:1,10:2}),{1:[3]},{3:4,4:$V1,5:12,6:$V2,7:13,8:$V3,11:3,15:[1,5],17:$V4,20:$V5,22:$V6,28:6,31:$V7,33:$V8},{3:19,4:$V1,5:12,6:$V2,7:13,8:$V3,12:[1,17],15:$V9,17:$V4,20:$V5,22:$V6,28:18,31:$V7,33:$V8},o($Va,$Vb,{13:[1,21]}),{3:22,4:$V1,16:23,17:$Vc,20:$Vd,22:$Ve},o($Vf,[2,20]),o([4,6,8,12,13,14,15,17,19,20,21,22,23,26,27,31,32,33],[2,1]),{3:31,4:$V1,5:32,6:$V2,7:13,8:$V3,11:30,15:$V9,17:$V4,19:[2,34],20:$V5,22:$V6,28:6,29:27,31:$V7,33:$V8,34:28,35:29},{3:19,4:$V1,5:12,6:$V2,7:13,8:$V3,11:35,15:$V9,17:$V4,20:$V5,21:$Vg,22:$V6,28:6,30:33,31:$V7,33:$V8,36:34},{3:19,4:$V1,5:12,6:$V2,7:13,8:$V3,11:35,15:$V9,17:$V4,20:$V5,22:$V6,23:$Vg,28:6,30:36,31:$V7,33:$V8,36:34},{3:19,4:$V1,5:12,6:$V2,7:13,8:$V3,11:38,15:$V9,17:$V4,20:$V5,22:$V6,28:6,31:$V7,32:[1,37],33:$V8},o($Vf,$Vh),o($Vf,[2,29]),{3:41,4:$V1,5:40,6:$V2,7:39,8:$V3},o([4,6,8,12,14,15,17,19,20,21,22,23,26,27,31,32,33],[2,2]),o($Vf,[2,3]),{1:[2,4]},o($Vf,[2,21]),o($Vf,$Vb),{3:42,4:$V1,16:23,17:$Vc,20:$Vd,22:$Ve},{3:19,4:$V1,5:12,6:$V2,7:13,8:$V3,11:43,15:$V9,17:$V4,20:$V5,22:$V6,28:6,31:$V7,33:$V8},o($Va,$Vi,{13:[1,44]}),o($Vf,[2,33]),{3:49,4:$V1,5:50,6:$V2,16:48,17:$Vc,18:45,19:$Vj,20:$Vd,22:$Ve,24:46,25:47},{3:42,4:$V1,16:51,17:$Vc,20:$Vd,22:$Ve},{3:49,4:$V1,5:50,6:$V2,16:48,17:$Vc,18:52,20:$Vd,22:$Ve,23:$Vj,24:46,25:47},{19:[1,53]},{19:[2,35],26:[1,54]},o($Vk,[2,36]),{3:55,4:$V1,5:56,6:$V2,7:13,8:$V3,15:$V9,17:$V4,20:$V5,22:$V6,28:18,31:$V7,33:$V8},o($V0,$Vb,{27:[1,57]}),o($V0,$Vh,{27:[1,58]}),{21:[1,59]},o([21,23],[2,43],{26:[1,60]}),o($Vl,[2,44],{5:12,7:13,28:18,3:19,4:$V1,6:$V2,8:$V3,15:$V9,17:$V4,20:$V5,22:$V6,31:$V7,33:$V8}),{23:[1,61]},o($Vf,[2,26]),{3:19,4:$V1,5:12,6:$V2,7:13,8:$V3,15:$V9,17:$V4,20:$V5,22:$V6,28:18,31:$V7,32:[1,62],33:$V8},o($Vf,[2,30]),o($Vf,[2,31]),o($Vf,[2,32]),o($Vf,$Vi),{3:19,4:$V1,5:12,6:$V2,7:13,8:$V3,14:[1,63],15:$V9,17:$V4,20:$V5,22:$V6,28:18,31:$V7,33:$V8},{3:42,4:$V1,16:64,17:$Vc,20:$Vd,22:$Ve},{19:[1,65]},o([19,23],[2,13],{26:[1,66]}),o($Vm,[2,14]),{3:67,4:$V1,5:68,6:$V2},o([4,6],$Vi,{27:[1,69]}),{27:[1,70]},{21:[1,71]},{23:[1,72]},o($Vf,[2,22]),{3:31,4:$V1,5:32,6:$V2,7:13,8:$V3,11:30,15:$V9,17:$V4,20:$V5,22:$V6,28:6,31:$V7,33:$V8,35:73},o($V0,$Vb,{19:$Vn,26:$Vn}),o($V0,$Vh,{19:$Vo,26:$Vo}),{3:19,4:$V1,5:12,6:$V2,7:13,8:$V3,11:74,15:$V9,17:$V4,20:$V5,22:$V6,28:6,31:$V7,33:$V8},{3:19,4:$V1,5:12,6:$V2,7:13,8:$V3,11:75,15:$V9,17:$V4,20:$V5,22:$V6,28:6,31:$V7,33:$V8},o($Vf,[2,23]),{3:19,4:$V1,5:12,6:$V2,7:13,8:$V3,11:76,15:$V9,17:$V4,20:$V5,22:$V6,28:6,31:$V7,33:$V8},o($Vf,[2,24]),o($Vf,[2,27]),o($V0,[2,6]),{14:[1,77]},o($Vf,[2,9]),{3:49,4:$V1,5:50,6:$V2,16:48,17:$Vc,20:$Vd,22:$Ve,25:78},o($Vm,[2,16]),o($Vm,[2,17]),{3:42,4:$V1,16:79,17:$Vc,20:$Vd,22:$Ve},{3:42,4:$V1,16:80,17:$Vc,20:$Vd,22:$Ve},o($Vf,[2,10]),o($Vf,[2,11]),o($Vk,[2,37]),o($Vk,[2,40],{5:12,7:13,28:18,3:19,4:$V1,6:$V2,8:$V3,15:$V9,17:$V4,20:$V5,22:$V6,31:$V7,33:$V8}),o($Vk,[2,41],{5:12,7:13,28:18,3:19,4:$V1,6:$V2,8:$V3,15:$V9,17:$V4,20:$V5,22:$V6,31:$V7,33:$V8}),o($Vl,[2,45],{5:12,7:13,28:18,3:19,4:$V1,6:$V2,8:$V3,15:$V9,17:$V4,20:$V5,22:$V6,31:$V7,33:$V8}),o($V0,[2,7]),o($Vm,[2,15]),o($Vm,[2,18]),o($Vm,[2,19])],
table: [o($V0,[2,5],{9:1,10:2}),{1:[3]},{3:4,4:$V1,5:12,6:$V2,7:13,8:$V3,11:3,15:[1,5],18:$V4,21:$V5,23:$V6,29:6,32:$V7,34:$V8},{3:19,4:$V1,5:12,6:$V2,7:13,8:$V3,12:[1,17],15:$V9,18:$V4,21:$V5,23:$V6,29:18,32:$V7,34:$V8},o($Va,$Vb,{13:[1,21]}),{3:22,4:$V1,16:24,17:23,18:$Vc,21:$Vd,23:$Ve},o($Vf,[2,21]),o([4,6,8,12,13,14,15,18,20,21,22,23,24,27,28,32,33,34],[2,1]),{3:32,4:$V1,5:33,6:$V2,7:13,8:$V3,11:31,15:$V9,18:$V4,20:[2,35],21:$V5,23:$V6,29:6,30:28,32:$V7,34:$V8,35:29,36:30},{3:19,4:$V1,5:12,6:$V2,7:13,8:$V3,11:36,15:$V9,18:$V4,21:$V5,22:$Vg,23:$V6,29:6,31:34,32:$V7,34:$V8,37:35},{3:19,4:$V1,5:12,6:$V2,7:13,8:$V3,11:36,15:$V9,18:$V4,21:$V5,23:$V6,24:$Vg,29:6,31:37,32:$V7,34:$V8,37:35},{3:19,4:$V1,5:12,6:$V2,7:13,8:$V3,11:39,15:$V9,18:$V4,21:$V5,23:$V6,29:6,32:$V7,33:[1,38],34:$V8},o($Vf,$Vh),o($Vf,[2,30]),{3:42,4:$V1,5:41,6:$V2,7:40,8:$V3},o([4,6,8,12,14,15,18,20,21,22,23,24,27,28,32,33,34],[2,2]),o($Vf,[2,3]),{1:[2,4]},o($Vf,[2,22]),o($Vf,$Vb),{3:43,4:$V1,16:24,17:23,18:$Vc,21:$Vd,23:$Ve},{3:19,4:$V1,5:12,6:$V2,7:13,8:$V3,11:44,15:$V9,18:$V4,21:$V5,23:$V6,29:6,32:$V7,34:$V8},o($Va,$Vi,{13:[1,45]}),o($Vf,[2,34]),o($Vf,[2,9]),{3:50,4:$V1,5:51,6:$V2,16:24,17:49,18:$Vc,19:46,20:$Vj,21:$Vd,23:$Ve,25:47,26:48},{3:43,4:$V1,16:24,17:52,18:$Vc,21:$Vd,23:$Ve},{3:50,4:$V1,5:51,6:$V2,16:24,17:49,18:$Vc,19:53,21:$Vd,23:$Ve,24:$Vj,25:47,26:48},{20:[1,54]},{20:[2,36],27:[1,55]},o($Vk,[2,37]),{3:56,4:$V1,5:57,6:$V2,7:13,8:$V3,15:$V9,18:$V4,21:$V5,23:$V6,29:18,32:$V7,34:$V8},o($V0,$Vb,{28:[1,58]}),o($V0,$Vh,{28:[1,59]}),{22:[1,60]},o([22,24],[2,44],{27:[1,61]}),o($Vl,[2,45],{5:12,7:13,29:18,3:19,4:$V1,6:$V2,8:$V3,15:$V9,18:$V4,21:$V5,23:$V6,32:$V7,34:$V8}),{24:[1,62]},o($Vf,[2,27]),{3:19,4:$V1,5:12,6:$V2,7:13,8:$V3,15:$V9,18:$V4,21:$V5,23:$V6,29:18,32:$V7,33:[1,63],34:$V8},o($Vf,[2,31]),o($Vf,[2,32]),o($Vf,[2,33]),o($Vf,$Vi),{3:19,4:$V1,5:12,6:$V2,7:13,8:$V3,14:[1,64],15:$V9,18:$V4,21:$V5,23:$V6,29:18,32:$V7,34:$V8},{16:65,18:$Vc,21:$Vd,23:$Ve},{20:[1,66]},o([20,24],[2,14],{27:[1,67]}),o($Vm,[2,15]),{3:68,4:$V1,5:69,6:$V2},o([4,6],$Vi,{28:[1,70]}),{28:[1,71]},{22:[1,72]},{24:[1,73]},o($Vf,[2,23]),{3:32,4:$V1,5:33,6:$V2,7:13,8:$V3,11:31,15:$V9,18:$V4,21:$V5,23:$V6,29:6,32:$V7,34:$V8,36:74},o($V0,$Vb,{20:$Vn,27:$Vn}),o($V0,$Vh,{20:$Vo,27:$Vo}),{3:19,4:$V1,5:12,6:$V2,7:13,8:$V3,11:75,15:$V9,18:$V4,21:$V5,23:$V6,29:6,32:$V7,34:$V8},{3:19,4:$V1,5:12,6:$V2,7:13,8:$V3,11:76,15:$V9,18:$V4,21:$V5,23:$V6,29:6,32:$V7,34:$V8},o($Vf,[2,24]),{3:19,4:$V1,5:12,6:$V2,7:13,8:$V3,11:77,15:$V9,18:$V4,21:$V5,23:$V6,29:6,32:$V7,34:$V8},o($Vf,[2,25]),o($Vf,[2,28]),o($V0,[2,6]),{14:[1,78]},o($Vf,[2,10]),{3:50,4:$V1,5:51,6:$V2,16:24,17:49,18:$Vc,21:$Vd,23:$Ve,26:79},o($Vm,[2,17]),o($Vm,[2,18]),{3:43,4:$V1,16:24,17:80,18:$Vc,21:$Vd,23:$Ve},{3:43,4:$V1,16:24,17:81,18:$Vc,21:$Vd,23:$Ve},o($Vf,[2,11]),o($Vf,[2,12]),o($Vk,[2,38]),o($Vk,[2,41],{5:12,7:13,29:18,3:19,4:$V1,6:$V2,8:$V3,15:$V9,18:$V4,21:$V5,23:$V6,32:$V7,34:$V8}),o($Vk,[2,42],{5:12,7:13,29:18,3:19,4:$V1,6:$V2,8:$V3,15:$V9,18:$V4,21:$V5,23:$V6,32:$V7,34:$V8}),o($Vl,[2,46],{5:12,7:13,29:18,3:19,4:$V1,6:$V2,8:$V3,15:$V9,18:$V4,21:$V5,23:$V6,32:$V7,34:$V8}),o($V0,[2,7]),o($Vm,[2,16]),o($Vm,[2,19]),o($Vm,[2,20])],
defaultActions: {17:[2,4]},

@@ -692,27 +690,27 @@ parseError: function parseError (str, hash) {

break;
case 3:return 22;
case 3:return 23;
break;
case 4:return 17;
case 4:return 18;
break;
case 5:return 20;
case 5:return 21;
break;
case 6:return 31;
case 6:return 32;
break;
case 7:return 23;
case 7:return 24;
break;
case 8:return 19;
case 8:return 20;
break;
case 9:return 21;
case 9:return 22;
break;
case 10:return 32;
case 10:return 33;
break;
case 11:return 13;
break;
case 12:return 33;
case 12:return 34;
break;
case 13:return 26;
case 13:return 27;
break;
case 14:return 14;
break;
case 15:return 27;
case 15:return 28;
break;

@@ -719,0 +717,0 @@ case 16:return 15;

// Generated by CoffeeScript 2.7.0
(function() {
var builtin, codes, run, valid, verify,
var builtin, codes, fs, run, valid, verify,
modulo = function(a, b) { return (+a % (b = +b) + b) % b; };
fs = require("fs");
valid = function(x) {

@@ -20,2 +22,9 @@ if (isNaN(x)) {

},
"fromFILE": function(fileName) {
return fs.readFileSync(fileName).toString();
},
"toFILE": function([x, fileName]) {
fs.writeFileSync(fileName, x);
return x;
},
"GT": function(args) {

@@ -22,0 +31,0 @@ var _, ok;

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc