summaryrefslogtreecommitdiff
path: root/redes/preproc.c
diff options
context:
space:
mode:
authorÁkos Kőrösi <korakos99@gmail.com>2026-05-21 10:19:29 +0200
committerÁkos Kőrösi <korakos99@gmail.com>2026-05-21 10:19:29 +0200
commit2bc953a840f19af33f41f3fedb1c8a36bb0254b6 (patch)
treeec902d498e5c98901ebea2b75a85257220af427b /redes/preproc.c
parentf5eeeb1f1a0ce300c88abfc70962d26469f8a782 (diff)
fix bug
Diffstat (limited to 'redes/preproc.c')
-rw-r--r--redes/preproc.c14
1 files changed, 12 insertions, 2 deletions
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);