Make things able to change data

This commit is contained in:
ElementG9 2019-12-06 10:44:49 -07:00
parent 01f6d05038
commit 243395d319
2 changed files with 6 additions and 2 deletions

View File

@ -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);
});
}

View File

@ -30,7 +30,10 @@ function translate(ast, data) {
out += temp;
}
}
return out;
return {
data,
code: out
};
}
module.exports = {