summaryrefslogtreecommitdiff
path: root/redes/preproc.c
diff options
context:
space:
mode:
Diffstat (limited to 'redes/preproc.c')
-rw-r--r--redes/preproc.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/redes/preproc.c b/redes/preproc.c
index 1ba4640..33a00e4 100644
--- a/redes/preproc.c
+++ b/redes/preproc.c
@@ -56,16 +56,11 @@ Pipeline* process_token_sequence(TokenVec tokens, PipelineVec* pl_pool) {
);
tok_pos++
) {
- printf("Tok pos: %d\n", tok_pos);
StrVec exp_word;
switch (curr_tok.kind) {
case TOK_WORD:
exp_word = process_word(curr_tok.as.word);
- printf("hi %d\n", exp_word.count);
- fflush(stdout);
for (int j = 0; j < exp_word.count; j++) {
- printf("%d\n", j);
- fflush(stdout);
char* arg_str = *get_from_StrVec(&exp_word, j);
push_to_ArgVec(&pl_cmd.args, (Arg){.kind = ARG_LIT, .as.lit_str = arg_str});
}
@@ -74,7 +69,7 @@ Pipeline* process_token_sequence(TokenVec tokens, PipelineVec* pl_pool) {
exit(68); // TODO: the other kinds
}
}
- Token delim_tok = *get_from_TokenVec(&tokens, tok_pos);
+ Token delim_tok = *get_from_TokenVec(&tokens, tok_pos++);
assert(delim_tok.kind == TOK_SPEC);
switch (delim_tok.as.spec) {
case SPEC_PIPE:
@@ -86,6 +81,7 @@ Pipeline* process_token_sequence(TokenVec tokens, PipelineVec* pl_pool) {
default:
exit(69);
}
+ push_to_Pipeline(&pl, pl_cmd);
}
return push_to_PipelineVec(pl_pool, pl);
}