From 2bc953a840f19af33f41f3fedb1c8a36bb0254b6 Mon Sep 17 00:00:00 2001 From: Ákos Kőrösi Date: Thu, 21 May 2026 10:19:29 +0200 Subject: fix bug --- redes/preproc.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'redes/preproc.c') diff --git a/redes/preproc.c b/redes/preproc.c index 33a00e4..8528c5a 100644 --- a/redes/preproc.c +++ b/redes/preproc.c @@ -3,6 +3,7 @@ #include "syntax.h" void split_str_on_space(char* str, StrVec* result) { + printf("Splitting %s\n", str); String buf = make_String(256); for (int pos = 0; str[pos] != '\0'; pos++) { if (str[pos] == ' ') { @@ -14,13 +15,16 @@ void split_str_on_space(char* str, StrVec* result) { } if (buf.count > 0) { - push_to_StrVec(result, inner(&buf)); + char* buf_str = inner(&buf); + printf("Fahh %s\n", buf_str); + push_to_StrVec(result, buf_str); } } StrVec process_word(Word word) { StrVec result = make_StrVec(256); for (int i = 0; i < word.count; i++) { + printf("Chunk %d\n", i); Chunk chunk = *get_from_Word(&word, i); switch (chunk.qmode) { case SINGLE_Q: @@ -56,7 +60,8 @@ Pipeline* process_token_sequence(TokenVec tokens, PipelineVec* pl_pool) { ); tok_pos++ ) { - StrVec exp_word; + printf("Boo\n"); + StrVec exp_word = make_StrVec(256); switch (curr_tok.kind) { case TOK_WORD: exp_word = process_word(curr_tok.as.word); @@ -81,6 +86,11 @@ Pipeline* process_token_sequence(TokenVec tokens, PipelineVec* pl_pool) { default: exit(69); } + printf("Argcount: %d\n", pl_cmd.args.count); + for (int k = 0; k < pl_cmd.args.count; k++) { + Arg arg = *get_from_ArgVec(&pl_cmd.args, k); + printf("\t%s\n", arg.as.lit_str); + } push_to_Pipeline(&pl, pl_cmd); } return push_to_PipelineVec(pl_pool, pl); -- cgit v1.2.3