From 3ea9f3e7e9b40c8e0b17ab394576c82f7b92c0b4 Mon Sep 17 00:00:00 2001 From: nass1pro Date: Tue, 14 Jul 2020 09:59:47 +0200 Subject: uptdate error --- src/parse/parse.c | 6 +----- src/parse/parse_error.c | 8 ++++---- 2 files changed, 5 insertions(+), 9 deletions(-) (limited to 'src/parse') diff --git a/src/parse/parse.c b/src/parse/parse.c index 610b640..6e4721a 100644 --- a/src/parse/parse.c +++ b/src/parse/parse.c @@ -6,7 +6,7 @@ /* By: nahaddac +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/06/17 18:09:04 by nahaddac #+# #+# */ -/* Updated: 2020/07/13 14:54:37 by nahaddac ### ########.fr */ +/* Updated: 2020/07/14 09:43:41 by nahaddac ### ########.fr */ /* */ /* ************************************************************************** */ @@ -174,12 +174,8 @@ t_ret *parse(t_ftlst *input) return (NULL); ret->ast = NULL; ret->rest = NULL; - if((ret->unexpected = error_syntax_simple(input))) return (ret); - printf("%s\n",((t_token *)ret->unexpected)->content); ret = parse_op(input); - //ast_destroy(ret->ast); - //ft_lstdestroy(&ret->rest, (void (*)(void*))token_destroy); return (ret); } diff --git a/src/parse/parse_error.c b/src/parse/parse_error.c index e48eda2..b63715d 100644 --- a/src/parse/parse_error.c +++ b/src/parse/parse_error.c @@ -6,7 +6,7 @@ /* By: nahaddac +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/06/18 15:09:48 by nahaddac #+# #+# */ -/* Updated: 2020/07/13 14:30:39 by nahaddac ### ########.fr */ +/* Updated: 2020/07/14 09:43:35 by nahaddac ### ########.fr */ /* */ /* ************************************************************************** */ @@ -81,15 +81,15 @@ t_token *error_syntax_simple(t_ftlst *in) tk = in->next->data; i = ft_strlen(tk->content); if (i >= 3) - tk->content[3] = '\0'; + tk->content[2] = '\0'; tk->content = ft_strjoin3("minishell: syntax error near unexpected token `", tk->content, "'"); + printf("%s\n",tk->content ); return(tk); } } in = in->next; } - return first; - + return 0; } -- cgit