diff --git a/bin/pivot.js b/bin/pivot.js index b673125..0fd7c3d 100755 --- a/bin/pivot.js +++ b/bin/pivot.js @@ -29,7 +29,8 @@ if (typeof args[0] != 'undefined') { }; repl('> ', (answer) => { let jsAnswer = code.translate(parser.parse(tokenizer.tokenize(answer)), data); + data = jsAnswer.data; // console.log(require('util').inspect(jsAnswer, { depth: null })); - eval(jsAnswer); + eval(jsAnswer.code); }); } diff --git a/src/code.js b/src/code.js index f756cf6..57624a2 100644 --- a/src/code.js +++ b/src/code.js @@ -30,7 +30,10 @@ function translate(ast, data) { out += temp; } } - return out; + return { + data, + code: out + }; } module.exports = {