From 75a808eb49fd78d33e21ea23d16f994b7c976f30 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Luk=C3=A1=C5=A1=20Ji=C5=99i=C5=A1t=C4=9B?= Date: Mon, 26 Aug 2024 12:08:16 +0200 Subject: [PATCH] Fix tokenization bug introduced in aac1d76 In commit aac1d76 the tokenization was changed to set ASSIGNMENT_WORDs to WORDs when the ASSIGNMENT_WORD is not in a proper place. The filter however didn't check whether current token is ASSIGNMENT_WORD hence other tokens could be changed to WORD also. --- src/tokenization.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tokenization.c b/src/tokenization.c index 2c38392..679dbd5 100644 --- a/src/tokenization.c +++ b/src/tokenization.c @@ -6,7 +6,7 @@ /* By: ljiriste +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/06/21 16:34:43 by ljiriste #+# #+# */ -/* Updated: 2024/08/23 18:43:53 by ljiriste ### ########.fr */ +/* Updated: 2024/08/26 12:07:29 by ljiriste ### ########.fr */ /* */ /* ************************************************************************** */ @@ -235,7 +235,7 @@ void filter_assignment_word(t_vec *tokens) while (i < tokens->size) { token = ft_vec_access(tokens, i); - if (i == 0) + if (i == 0 || token->type != g_tokens[ASSIGNMENT_WORD]) { ++i; continue ; -- 2.30.2