diff options
Diffstat (limited to 'src/parse/parse_error.c')
| -rw-r--r-- | src/parse/parse_error.c | 45 |
1 files changed, 17 insertions, 28 deletions
diff --git a/src/parse/parse_error.c b/src/parse/parse_error.c index b721c28..e48eda2 100644 --- a/src/parse/parse_error.c +++ b/src/parse/parse_error.c @@ -6,38 +6,27 @@ /* By: nahaddac <nahaddac@student.42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/06/18 15:09:48 by nahaddac #+# #+# */ -/* Updated: 2020/06/19 12:46:56 by nahaddac ### ########.fr */ +/* Updated: 2020/07/13 14:30:39 by nahaddac ### ########.fr */ /* */ /* ************************************************************************** */ #include "parser.h" -t_token *error_syntax_parent(t_ftlst *in) -{ - int op; - int cl; - t_token *tk; - - op = 0; - cl = 0; - while(in != NULL) - { - tk = in->data; - if (tk->tag & TAG_PARENT_OPEN) - op++; - if(tk->tag & TAG_PARENT_CLOSE) - cl++; - if (cl && op == 0) - { - tk->content = ft_strjoin3( - "minishell: syntax error near unexpected token `", - tk->content, "'"); - return tk; - } - in = in->next; - } - return NULL; -} +// t_token *error_syntax_parent(t_ftlst *in) +// { +// t_token *tk; +// t_ftlst *first; +// +// first = in; +// while(in != NULL) +// { +// tk = in->data; +// if (tk->tag & TAG_PARENT_OPEN || tk->tag & TAG_PARENT_CLOSE) +// printf("%s\n", "coucouc"); +// in = in->next; +// } +// return first; +// } int out_error_first(t_token *tk) { @@ -101,6 +90,6 @@ t_token *error_syntax_simple(t_ftlst *in) } in = in->next; } - return error_syntax_parent(first); + return first; } |
