aboutsummaryrefslogtreecommitdiff
path: root/src/parse/parse_error.c
diff options
context:
space:
mode:
authornass1pro <nass1pro@gmail.com>2020-07-13 14:55:46 +0200
committernass1pro <nass1pro@gmail.com>2020-07-13 14:55:46 +0200
commit4ad25e7fe330df66725bf74a662a49bcd31b8a8a (patch)
tree81d325bde4ad453ffcca4f382810ae6e62ffb6dc /src/parse/parse_error.c
parent051d035e57918d824eab50b81288bd98a1a95675 (diff)
downloadminishell-4ad25e7fe330df66725bf74a662a49bcd31b8a8a.tar.gz
minishell-4ad25e7fe330df66725bf74a662a49bcd31b8a8a.tar.bz2
minishell-4ad25e7fe330df66725bf74a662a49bcd31b8a8a.zip
test error gestion
Diffstat (limited to 'src/parse/parse_error.c')
-rw-r--r--src/parse/parse_error.c45
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;
}