aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/doml.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/doml.js b/lib/doml.js
index 332a17e..c813db9 100644
--- a/lib/doml.js
+++ b/lib/doml.js
@@ -136,6 +136,21 @@
return me.evaluate(child, context);
});
console.log.apply(this, args);
+ },
+
+ 'function': function(dataset, children, context) {
+ var argNames = dataset.args.split(',');
+ return function(argValues) {
+ for (var idx = 0; idx < argNames.length; idx++) {
+ var argName = argNames[idx];
+ context[argName] = me.evaluate(argValues[idx], context);
+ }
+ me.evaluate(children[0], context);
+ }
+ },
+
+ 'call': function(dataset, children, context) {
+ return context[dataset.name](children);
}
};