kiro7shiro / monkey-coder

an ai that writes programs
0 stars 0 forks source link

make error handler for brainfuck.run() #3

Closed kiro7shiro closed 4 years ago

kiro7shiro commented 4 years ago

https://github.com/kiro7shiro/monkey-coder/blob/be17101137bdc73682b200e06b2d42e8c62e840c/js/Monkey.js#L26

https://github.com/kiro7shiro/monkey-coder/blob/be17101137bdc73682b200e06b2d42e8c62e840c/js/Monkey.js#L91

kiro7shiro commented 4 years ago

wrote a handler, execution errors of the interpreter get pushed into an array https://github.com/kiro7shiro/monkey-coder/blob/4a55900c8262aee659d2ae9203931d1fe44aa572/js/js-brainfuck/Brainfuck.js#L117-L125

errors, memory and the output get returned for debugging https://github.com/kiro7shiro/monkey-coder/blob/4a55900c8262aee659d2ae9203931d1fe44aa572/js/js-brainfuck/Brainfuck.js#L127