This commit is contained in:
Antoine Riard 2017-03-21 16:24:02 +01:00
parent a5247bea82
commit bd0d63468e
3 changed files with 8 additions and 6 deletions

View file

@ -6,14 +6,14 @@
# By: wescande <wescande@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2016/08/29 21:32:58 by wescande #+# #+# #
# Updated: 2017/03/21 15:06:37 by gwojda ### ########.fr #
# Updated: 2017/03/21 15:47:55 by ariard ### ########.fr #
# #
# **************************************************************************** #
NAME = 42sh
CC = gcc
FLAGS = -Wall -Wextra -Werror #-fvisibility=hidden #-fsanitize=address
FLAGS = -Wall -Wextra -Werror -fvisibility=hidden -fsanitize=address
D_FLAGS = -g
DELTA = $$(echo "$$(tput cols)-47"|bc)

View file

@ -6,7 +6,7 @@
/* By: gwojda <gwojda@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/03/20 14:45:40 by gwojda #+# #+# */
/* Updated: 2017/03/21 14:04:33 by jhalford ### ########.fr */
/* Updated: 2017/03/21 16:12:37 by ariard ### ########.fr */
/* */
/* ************************************************************************** */
@ -43,8 +43,10 @@ static int handle_instruction(t_list **token, t_btree **ast)
return (ret);
if (do_lexer_routine(token, stream) > 0)
continue ;
if (do_parser_routine(token, ast) > 0)
if ((ret = do_parser_routine(token, ast)) > 1)
break ;
else if (ret == 1)
return (ret);
}
if (data->parser.state == SUCCESS && ft_exec(ast) < 0)
exit(1);

View file

@ -6,7 +6,7 @@
/* By: wescande <wescande@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/03/19 14:24:14 by wescande #+# #+# */
/* Updated: 2017/03/20 21:11:21 by jhalford ### ########.fr */
/* Updated: 2017/03/21 16:09:48 by ariard ### ########.fr */
/* */
/* ************************************************************************** */
@ -31,6 +31,6 @@ int do_parser_routine(t_list **token, t_btree **ast)
return (1);
}
else if (data->parser.state == SUCCESS)
return (1);
return (2);
return (0);
}