Make things able to change data
This commit is contained in:
parent
01f6d05038
commit
243395d319
@ -29,7 +29,8 @@ if (typeof args[0] != 'undefined') {
|
|||||||
};
|
};
|
||||||
repl('> ', (answer) => {
|
repl('> ', (answer) => {
|
||||||
let jsAnswer = code.translate(parser.parse(tokenizer.tokenize(answer)), data);
|
let jsAnswer = code.translate(parser.parse(tokenizer.tokenize(answer)), data);
|
||||||
|
data = jsAnswer.data;
|
||||||
// console.log(require('util').inspect(jsAnswer, { depth: null }));
|
// console.log(require('util').inspect(jsAnswer, { depth: null }));
|
||||||
eval(jsAnswer);
|
eval(jsAnswer.code);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,10 @@ function translate(ast, data) {
|
|||||||
out += temp;
|
out += temp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return out;
|
return {
|
||||||
|
data,
|
||||||
|
code: out
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user