From c48d86c8de2bcd88629fcf675b279831221740e0 Mon Sep 17 00:00:00 2001 From: Matteo Flebus Date: Tue, 27 Jan 2026 16:35:30 +0100 Subject: [PATCH] feat(parser): negation handled --- src/parser/grammar_basic.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/parser/grammar_basic.c b/src/parser/grammar_basic.c index d229549..25d29d1 100644 --- a/src/parser/grammar_basic.c +++ b/src/parser/grammar_basic.c @@ -119,9 +119,11 @@ struct ast *parse_pipeline(struct lexer_context *ctx) token = PEEK_TOKEN(); } - // TODO handle negation (new AST type) - struct ast *left = parse_command(ctx); + if (negation) + { + left = ast_create_neg(negation, left); + } token = PEEK_TOKEN(); while (token->type == TOKEN_PIPE)