Following up to #992 (comment)
I prototyped this refactor on raw_repl, and it worked. @dpgeorge, I'd like to be sure you're ok with going forward with this. For friendly_repl, core of which in readline() function, following changes would be needed:
Loop body
for (;;) {
int c = stdin_rx_chr();
...
}
should be extracted to a separate function, accepting "c". Any state which was previously kept in stack variable should be made persistent between function calls (top-level static variable puts into structure). Code before the loop should be turned into "init" function. All other functions calling readline() should undergo similar transformation. More changes will be needed later to actually supporting event-driven operation.
Following up to #992 (comment)
I prototyped this refactor on raw_repl, and it worked. @dpgeorge, I'd like to be sure you're ok with going forward with this. For friendly_repl, core of which in readline() function, following changes would be needed:
Loop body
should be extracted to a separate function, accepting "c". Any state which was previously kept in stack variable should be made persistent between function calls (top-level static variable puts into structure). Code before the loop should be turned into "init" function. All other functions calling readline() should undergo similar transformation. More changes will be needed later to actually supporting event-driven operation.