diff options
Diffstat (limited to 'src/parse')
| -rw-r--r-- | src/parse/parse.c | 6 | ||||
| -rw-r--r-- | src/parse/parse_error.c | 8 |
2 files changed, 5 insertions, 9 deletions
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 <nahaddac@student.42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* 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 <nahaddac@student.42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* 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; } |
