Extract line reading logic to reader and remove REPL tests
Reading a line into the buffer was the only logic complex enough to be worth testing really, and exposing the necessary parts of it to test it effectively was a pain. Makes more sense to move read_line out and throw away most of the tests.
This commit is contained in:
14
app/main.c
14
app/main.c
@@ -1,21 +1,9 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "evaluator.h"
|
||||
#include "reader.h"
|
||||
#include "repl.h"
|
||||
|
||||
static void print(const char *output, int len)
|
||||
{
|
||||
fwrite(output, 1, len, stdout);
|
||||
}
|
||||
|
||||
static repl_t repl = {
|
||||
.get_byte = getchar,
|
||||
.read = read_expression,
|
||||
.evaluate = evaluate,
|
||||
.print = print,
|
||||
};
|
||||
static repl_t repl;
|
||||
|
||||
int main(void)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user