diff --git a/42sh/src/lexer/ft_post_tokenize.c b/42sh/src/lexer/ft_post_tokenize.c index 619289ae..a0b4941f 100644 --- a/42sh/src/lexer/ft_post_tokenize.c +++ b/42sh/src/lexer/ft_post_tokenize.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/01/11 16:11:11 by jhalford #+# #+# */ -/* Updated: 2017/02/03 15:46:19 by jhalford ### ########.fr */ +/* Updated: 2017/02/06 14:33:34 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ diff --git a/42sh/src/lexer/reduce_parens.c b/42sh/src/lexer/reduce_parens.c index 7f4f3c39..b189bd05 100644 --- a/42sh/src/lexer/reduce_parens.c +++ b/42sh/src/lexer/reduce_parens.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/01/11 16:13:31 by jhalford #+# #+# */ -/* Updated: 2017/02/02 15:19:02 by jhalford ### ########.fr */ +/* Updated: 2017/02/06 14:36:54 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ diff --git a/42sh/src/lexer/token_expand_var.c b/42sh/src/lexer/token_expand_var.c index f252a29d..8d271ed4 100644 --- a/42sh/src/lexer/token_expand_var.c +++ b/42sh/src/lexer/token_expand_var.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/01/10 14:57:53 by jhalford #+# #+# */ -/* Updated: 2017/02/06 14:05:25 by jhalford ### ########.fr */ +/* Updated: 2017/02/06 14:32:16 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ diff --git a/42sh/src/main/main.c b/42sh/src/main/main.c index 425c5223..377ad610 100644 --- a/42sh/src/main/main.c +++ b/42sh/src/main/main.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/12/06 18:40:58 by jhalford #+# #+# */ -/* Updated: 2017/02/06 13:26:34 by jhalford ### ########.fr */ +/* Updated: 2017/02/06 14:38:45 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ diff --git a/42sh/src/parser/ft_parse.c b/42sh/src/parser/ft_parse.c index ea512479..24eebe40 100644 --- a/42sh/src/parser/ft_parse.c +++ b/42sh/src/parser/ft_parse.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/11/30 17:14:58 by jhalford #+# #+# */ -/* Updated: 2017/02/03 13:43:00 by jhalford ### ########.fr */ +/* Updated: 2017/02/06 14:38:56 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ @@ -41,10 +41,7 @@ int ft_parse(t_btree **ast, t_list **start) while (g_parser[i].type) { if ((lst = ft_lst_find(*start, &g_parser[i].type, &token_cmp_type))) - { - if (g_parser[i].f) - return ((*g_parser[i].f)(ast, start, &lst)); - } + return ((*g_parser[i].f)(ast, start, &lst)); i++; } return (0); diff --git a/42sh/src/parser/parse_subshell.c b/42sh/src/parser/parse_subshell.c index 213fec47..8f8aef17 100644 --- a/42sh/src/parser/parse_subshell.c +++ b/42sh/src/parser/parse_subshell.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/01/11 16:52:44 by jhalford #+# #+# */ -/* Updated: 2017/02/02 14:11:09 by jhalford ### ########.fr */ +/* Updated: 2017/02/06 14:42:08 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ @@ -19,6 +19,12 @@ int parse_subshell(t_btree **ast, t_list **start, t_list **lst) (void)start; token = (*lst)->content; + DG("parsing subshell"); + if ((*lst)->next && ((t_token*)(*lst)->next->content)->type & TK_WORD) + { + ft_dprintf(2, "{red}%s: parse error near ')'{eoc}\n", SHELL_NAME); + return (-1); + } node = (*ast)->item; node->type = TK_SUBSHELL; node->data.sstr = malloc(4 * sizeof(char *));