
require('./core');

var parsers = require('./parser');
var compiler = require('./compiler');

function evaluate(text) {
    var parser = parsers.parser(text);
    var code = compiler.compile(parser.parse());
    return eval(code);
}

module.exports = {
    evaluate: evaluate
}
@@ -173,32 +173,87 @@
 var 
-code = compiler.compile(
+result = null;%0D%0A    %0D%0A    for (var expr = parser.parse(); expr != null; expr = 
 pars
@@ -267,32 +267,86 @@
 e())
-;
+ 
 %0D%0A    
-return eval(code)
+    result = eval(compiler.compile(expr));%0D%0A        %0D%0A    return result
 ;%0D%0A%7D

Refactor evaluate