feat: redirection rules

This commit is contained in:
Gu://em_ 2026-01-24 15:34:10 +01:00
parent 18c1da6bdf
commit 32f56beb6b
8 changed files with 218 additions and 25 deletions

View file

@ -0,0 +1,28 @@
#include "grammar_advanced.h"
#include <stdio.h>
#include "grammar_basic.h"
struct ast *parse_redirection(struct lexer_context *ctx)
{
struct token *token = PEEK_TOKEN();
if (token->type == TOKEN_IONUMBER)
{
// TODO
POP_TOKEN();
token = PEEK_TOKEN();
}
if (token->type != TOKEN_REDIRECTION)
{
puts("Syntax error: expected a redirection token but got something "
"else");
return NULL;
}
}
struct ast *parse_prefix(struct lexer_context *ctx)
{
return parse_redirection(ctx);
}