This commit is contained in:
gwojda 2017-03-29 16:04:44 +02:00
parent 6f0fb666aa
commit 06c7d44c1a

View file

@ -6,7 +6,7 @@
/* By: ariard <ariard@student.42.fr> +#+ +:+ +#+ */ /* By: ariard <ariard@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2017/02/15 18:32:59 by ariard #+# #+# */ /* Created: 2017/02/15 18:32:59 by ariard #+# #+# */
/* Updated: 2017/03/29 15:40:57 by ariard ### ########.fr */ /* Updated: 2017/03/29 16:04:00 by gwojda ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -77,10 +77,9 @@ static int check_cache(t_token *token, int cache)
return (0); return (0);
} }
int build_tree(t_btree **ast, t_list **lst, t_parser *parser) int build_tree(t_btree **ast, t_list **lst, t_parser *parser)
{ {
int i; int i;
// static int cache;
t_token *token; t_token *token;
i = 0; i = 0;
@ -88,7 +87,8 @@ int build_tree(t_btree **ast, t_list **lst, t_parser *parser)
check_cache(token, parser->cache); check_cache(token, parser->cache);
while (g_treematch[i].type) while (g_treematch[i].type)
{ {
if ((isseparator(token, parser->cache) && g_treematch[i].type == token->type)) if ((isseparator(token, parser->cache) &&
g_treematch[i].type == token->type))
{ {
parser->cache = token->type; parser->cache = token->type;
return (g_treematch[i].add(ast, lst)); return (g_treematch[i].add(ast, lst));