Closed abtrout closed 10 months ago
This is in progress.
One complexity is dealing with loops: since we Eval
commands one byte at a time, we could Eval
an [
on a cell that has zero value. In this situation, the [
instruction tells us to jump to matching ]
but we don't know that yet. Could handle this by keeping internal state that indicates if we're jumping out of a loop, probably requiring maintaining the index of the opening [
to deal with nested loops.
We simply delay evaluation when there are partial loops. PR incoming!
Read from stream, convert to internal Brainfuck bytecode and execute as we go. This allows for easier unit testing, and makes interactive/non-interactive execution use the same interface.
Loop construction should be similar from #2.