krl-compiler
Advanced tools
Comparing version 0.35.4 to 0.40.0
{ | ||
"name": "krl-compiler", | ||
"version": "0.35.4", | ||
"version": "0.40.0", | ||
"description": "KRL compiler", | ||
@@ -14,4 +14,4 @@ "main": "src/index.js", | ||
"scripts": { | ||
"start": "onchange -i src/ test-rulesets/ -- npm test -s", | ||
"lint": "eslint src/ && echo lint-ok", | ||
"start": "onchange -i src/ ../../test-rulesets/ -- npm test -s", | ||
"lint": "../../node_modules/.bin/eslint src/ && echo lint-ok", | ||
"test": "npm run lint -s && node src/tests.js" | ||
@@ -21,3 +21,3 @@ }, | ||
"type": "git", | ||
"url": "git+https://github.com/Picolab/node-krl-compiler.git" | ||
"url": "git+https://github.com/Picolab/pico-engine.git" | ||
}, | ||
@@ -32,11 +32,10 @@ "keywords": [ | ||
"bugs": { | ||
"url": "https://github.com/Picolab/node-krl-compiler/issues" | ||
"url": "https://github.com/Picolab/pico-engine/issues" | ||
}, | ||
"homepage": "https://github.com/Picolab/node-krl-compiler#readme", | ||
"homepage": "https://github.com/Picolab/pico-engine#readme", | ||
"devDependencies": { | ||
"contra": "^1.9.4", | ||
"diff-lines": "^1.1.0", | ||
"eslint": "^3.3.1", | ||
"onchange": "^3.0.0", | ||
"tape": "^4.6.0" | ||
"tape": "^4.8.0" | ||
}, | ||
@@ -48,3 +47,3 @@ "dependencies": { | ||
"estree-loc": "^2.0.0", | ||
"krl-parser": "^0.24.0", | ||
"krl-parser": "^0.40.0", | ||
"lodash": "^4.13.1", | ||
@@ -51,0 +50,0 @@ "minimist": "^1.2.0" |
@@ -8,3 +8,3 @@ var _ = require("lodash"); | ||
&& ast.callee.property.type === "Identifier" | ||
){ | ||
){ | ||
//operator syntax is just sugar for stdlib functions | ||
@@ -11,0 +11,0 @@ var operator = ast.callee.property; |
@@ -11,10 +11,10 @@ var _ = require("lodash"); | ||
fn_body.push(e("var", "matches", | ||
callModuleFn(e, "event", "attrMatches", e("array", [ | ||
e("array", _.map(ast.event_attrs, function(a){ | ||
return e("array", [ | ||
e("string", a.key.value, a.key.loc), | ||
comp(a.value) | ||
], a.loc); | ||
})) | ||
]), ast.loc))); | ||
callModuleFn(e, "event", "attrMatches", e("array", [ | ||
e("array", _.map(ast.event_attrs, function(a){ | ||
return e("array", [ | ||
e("string", a.key.value, a.key.loc), | ||
comp(a.value) | ||
], a.loc); | ||
})) | ||
]), ast.loc))); | ||
fn_body.push(e("if", e("!", e("id", "matches")), e("return", e("false")))); | ||
@@ -41,16 +41,16 @@ }else if(!_.isEmpty(ast.setting)){ | ||
fn_body.push(e(";", | ||
e("ycall", | ||
e("id", "aggregateEvent", ast.aggregator.loc), | ||
[ | ||
e("id", "ctx", ast.aggregator.loc), | ||
e("string", ast.aggregator.op, ast.aggregator.loc), | ||
e("array", _.map(ast.aggregator.args, function(a, i){ | ||
return e("array", [ | ||
e("string", a.value, a.loc), | ||
e("get", e("id", "matches", a.loc), e("num", i, a.loc), a.loc) | ||
], a.loc); | ||
}), ast.aggregator.loc) | ||
], | ||
ast.aggregator.loc | ||
), ast.aggregator.loc)); | ||
e("ycall", | ||
e("id", "aggregateEvent", ast.aggregator.loc), | ||
[ | ||
e("id", "ctx", ast.aggregator.loc), | ||
e("string", ast.aggregator.op, ast.aggregator.loc), | ||
e("array", _.map(ast.aggregator.args, function(a, i){ | ||
return e("array", [ | ||
e("string", a.value, a.loc), | ||
e("get", e("id", "matches", a.loc), e("num", i, a.loc), a.loc) | ||
], a.loc); | ||
}), ast.aggregator.loc) | ||
], | ||
ast.aggregator.loc | ||
), ast.aggregator.loc)); | ||
} | ||
@@ -57,0 +57,0 @@ |
@@ -9,3 +9,3 @@ var _ = require("lodash"); | ||
var files_dir = path.resolve(__dirname, "../test-rulesets"); | ||
var files_dir = path.resolve(__dirname, "../../../test-rulesets"); | ||
@@ -12,0 +12,0 @@ test("compiler", function(t){ |
4
7
53735
+ Addedcommander@2.20.3(transitive)
+ Addeddiscontinuous-range@1.0.0(transitive)
+ Addedkrl-parser@0.40.1(transitive)
+ Addedmoo@0.5.2(transitive)
+ Addednearley@2.20.1(transitive)
+ Addedrandexp@0.4.6(transitive)
+ Addedret@0.1.15(transitive)
- Removedcolors@0.5.1(transitive)
- Removeddrange@1.1.1(transitive)
- Removedkrl-parser@0.24.1(transitive)
- Removednearley@2.10.5(transitive)
- Removednomnom@1.6.2(transitive)
- Removedrandexp@0.4.9(transitive)
- Removedret@0.2.2(transitive)
- Removedunderscore@1.4.4(transitive)
Updatedkrl-parser@^0.40.0