The repl I have implemented cannot be quit out of using the quit commend. It is impossible to tell if a quit command was implicit or explicit, so it will only exit the loop on EOF. In short, the repl reads a line, parses it, and executes it. In order to maintain program state, it keeps the same struct Program lying around between iterations and simply re-reads a line of code in to the source field, parses it, and executes it.
Also fixes some memory leaks I encountered while developing the repl and having parse failures.
Does what it says on the tin.
The repl I have implemented cannot be quit out of using the quit commend. It is impossible to tell if a quit command was implicit or explicit, so it will only exit the loop on EOF. In short, the repl reads a line, parses it, and executes it. In order to maintain program state, it keeps the same
struct Program
lying around between iterations and simply re-reads a line of code in to the source field, parses it, and executes it.Also fixes some memory leaks I encountered while developing the repl and having parse failures.