krl-compiler
Advanced tools
Comparing version 0.32.2 to 0.32.3
{ | ||
"name": "krl-compiler", | ||
"version": "0.32.2", | ||
"version": "0.32.3", | ||
"description": "KRL compiler", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -10,3 +10,5 @@ var _ = require("lodash"); | ||
} | ||
var return_value = e("ycall", e("id", "runAction"), [ | ||
var fn_body = []; | ||
fn_body.push(e("var", "returns", e("ycall", e("id", "runAction"), [ | ||
e("id", "ctx"), | ||
@@ -18,12 +20,11 @@ ast.action.domain | ||
comp(ast.args), | ||
]); | ||
var fn_body = []; | ||
if(!_.isEmpty(ast.setting)){ | ||
return_value = e("call", e("id", "ctx.scope.set", ast.setting[0].loc), [ | ||
e("str", ast.setting[0].value, ast.setting[0].loc), | ||
return_value, | ||
], ast.setting[0].loc); | ||
} | ||
fn_body.push(e("return", return_value)); | ||
]))); | ||
_.each(ast.setting, function(set, i){ | ||
fn_body.push(e(";", e("call", e("id", "ctx.scope.set", set.loc), [ | ||
e("str", set.value, set.loc), | ||
e("get", e("id", "returns"), e("number", i, set.loc), set.loc), | ||
], set.loc), set.loc)); | ||
}); | ||
var obj = {}; | ||
@@ -30,0 +31,0 @@ if(ast.label && ast.label.type === "Identifier"){ |
@@ -10,3 +10,3 @@ var _ = require("lodash"); | ||
body.push(e(";", e("call", e("id", "processActionBlock", ast.action_block.loc), [ | ||
body.push(e(";", e("ycall", e("id", "processActionBlock", ast.action_block.loc), [ | ||
e("id", "ctx", ast.action_block), | ||
@@ -13,0 +13,0 @@ comp(ast.action_block), |
50362
1365