summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorÁkos Kőrösi <korakos99@gmail.com>2026-05-18 12:29:53 +0200
committerÁkos Kőrösi <korakos99@gmail.com>2026-05-18 12:29:53 +0200
commitd31d9ce64c3085bea1a094e649f62176b1a896a6 (patch)
treeed5b33946fb75a7ceaa275b02c09a5874771f668 /main.c
parent7c69040ab68097811cb58e36a86b25a064e4c465 (diff)
put line processing in exec
Diffstat (limited to 'main.c')
-rw-r--r--main.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/main.c b/main.c
index 3fe10bf..52e1691 100644
--- a/main.c
+++ b/main.c
@@ -3,7 +3,6 @@
#include <readline/readline.h>
#include <string.h>
-#include "preproc.h"
#include "exec.h"
@@ -14,19 +13,7 @@ int main() {
line = readline("$ ");
if (line[0] == '\0') continue;
if (strcmp(line, "exit") == 0) exit(0);
- PreprocArena arena = {
- .tokens = make_TokenVec(256),
- .chunks = make_ChunkVec(256),
- .regions = make_RegionVec(256),
- };
- TokenPtrVec line_tok_ptrs = lex(line, &arena);
- Token* tokstream = malloc(sizeof(Token) * line_tok_ptrs.count);
- for (int i = 0; i < line_tok_ptrs.count; i++) {
- tokstream[i] = **get_from_TokenPtrVec(&line_tok_ptrs, i);
- }
- Pipeline pl = parse_tokstream(tokstream);
- run_pipeline(pl, &shstate);
- free(tokstream);
+ process_input_line(line, &shstate);
}
free(line);
}