diff options
| author | Ákos Kőrösi <korakos99@gmail.com> | 2026-05-14 21:41:17 +0200 |
|---|---|---|
| committer | Ákos Kőrösi <korakos99@gmail.com> | 2026-05-14 21:41:17 +0200 |
| commit | 5009a29f4b13786673198616838a8bd8c93cdc50 (patch) | |
| tree | e1e0fda1b46063626b10a913cf9bfc62c1edbd84 /main.c | |
| parent | 6632fa4168c4d619c60e55c9eeedf90f6ef50234 (diff) | |
add more expansion code
Diffstat (limited to 'main.c')
| -rw-r--r-- | main.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -5,10 +5,11 @@ #include "lex.h" #include "parse.h" +#include "exec.h" void uglyprint_pl(Pipeline pl) { for (int i = 0; i < pl.count; i++) { - printf("%d\n"); + printf("%d\n", i); TokenVec toks = (*get_from_Pipeline(&pl, i)).cmd.args; for (int j = 0; j < toks.count; j++) { Token tok = *get_from_TokenVec(&toks, j); @@ -30,13 +31,14 @@ void uglyprint_pl(Pipeline pl) { int main() { char* line; + ShellState shstate = {.shell_vars = make_KeyValMap(1), .aliases = make_KeyValMap(1)}; while (1) { line = readline("$ "); if (line[0] == '\0') continue; if (strcmp(line, "exit") == 0) exit(0); LexResult res = lex(line); Pipeline pl = parse_tokstream(res.top_tokens); - uglyprint_pl(pl); + run_pipeline(pl, &shstate); } free(line); } |
