From 7b783fcb4de72598854cecdf37b2821ca3fc4be6 Mon Sep 17 00:00:00 2001 From: gazhonsepaskwa Date: Tue, 11 Feb 2025 15:11:24 +0100 Subject: [PATCH] syntax correction --- srcs/parsing/syntax.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/srcs/parsing/syntax.c b/srcs/parsing/syntax.c index 84eaf6f..3b380f6 100644 --- a/srcs/parsing/syntax.c +++ b/srcs/parsing/syntax.c @@ -104,15 +104,15 @@ int syntax_error(t_node *head) cpy = head; if (cpy->token == OPERATOR && cpy->next && cpy->next->token == OPERATOR) return (syntax_err_mess(cpy->next->val, 0)); - if (cpy->token == OPERATOR) + if (cpy->token == OPERATOR && cpy->pressision != SUBSH_S) return (syntax_err_mess(cpy->val, 0)); while (cpy) { if (unexpected_token(cpy)) return (syntax_err_mess(cpy->val, 0)); - if (cpy->token == OPERATOR && cpy->next == NULL) + if (cpy->token == OPERATOR && cpy->next == NULL && cpy->pressision != SUBSH_E) return (syntax_err_mess(cpy->val, 3)); - if (cpy->token == OPERATOR && cpy->next->token == OPERATOR) + if (cpy->token == OPERATOR && cpy->pressision != SUBSH_E && cpy->next && cpy->next->token == OPERATOR) return (syntax_err_mess(cpy->next->val, 0)); if (cpy->token == OPERATOR && ft_strlen(cpy->val) > 2) return (syntax_err_mess(cpy->val, 0));