42-archive/42sh/src/parser/get_instruction2.c
2017-02-05 00:15:12 +01:00

25 lines
1.2 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* get_instruction2.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ariard <ariard@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/02/04 18:20:53 by ariard #+# #+# */
/* Updated: 2017/02/04 19:00:55 by ariard ### ########.fr */
/* */
/* ************************************************************************** */
#include "parser.h"
int get_instruction2(t_btree **ast, t_list **start, t_list **lst)
{
t_token *token;
token = (*lst)->content;
if (token->type == TK_NEWLINE)
return (parse_newline(ast, start, lst));
else if (token->type == TK_WHILE)
return (parse_while(ast, start, lst));
return (0);
}