diff --git a/42sh/src/parser/add_bang.c b/42sh/src/parser/add_bang.c index a4ca0eb6..6cc0da66 100644 --- a/42sh/src/parser/add_bang.c +++ b/42sh/src/parser/add_bang.c @@ -6,7 +6,7 @@ /* By: ariard +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/03/10 14:57:45 by ariard #+# #+# */ -/* Updated: 2017/03/20 18:11:11 by gwojda ### ########.fr */ +/* Updated: 2017/03/22 15:34:25 by ariard ### ########.fr */ /* */ /* ************************************************************************** */ @@ -22,7 +22,9 @@ int isbang(t_btree **ast, t_list **lst) { node = (*ast)->item; if ((node->type == TK_NEWLINE || node->type == TK_SEMI - || node->type == TK_AMP) && isbang(&(*ast)->right, lst) == 1) + || node->type == TK_AMP || node->type == TK_AND_IF + || node->type == TK_OR_IF || node->type == TK_PIPE) + && isbang(&(*ast)->right, lst) == 1) return (1); if (node->type == TK_BANG && node->full == 0) return (1); @@ -44,7 +46,8 @@ int isbang_sep(t_btree **ast, t_list **lst) || token->type == TK_OR_IF) && node->type == TK_BANG && node->nest == 0) node->full = 1; - if (token->type == TK_PIPE && node->type == TK_BANG && node->full == 0) + if (token->type == TK_PIPE && node->type == TK_BANG + && node->full == 0) return (1); } return (0); diff --git a/42sh/src/parser/add_case.c b/42sh/src/parser/add_case.c index 1ea216dc..42e864da 100644 --- a/42sh/src/parser/add_case.c +++ b/42sh/src/parser/add_case.c @@ -6,7 +6,7 @@ /* By: ariard +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/03/04 20:42:13 by ariard #+# #+# */ -/* Updated: 2017/03/15 01:09:23 by ariard ### ########.fr */ +/* Updated: 2017/03/22 15:30:25 by ariard ### ########.fr */ /* */ /* ************************************************************************** */ @@ -22,7 +22,8 @@ int iscase(t_btree **ast, t_list **lst) { node = (*ast)->item; if ((node->type == TK_NEWLINE || node->type == TK_SEMI - || node->type == TK_AMP || node->type == TK_PIPE) + || node->type == TK_AMP || node->type == TK_PIPE + || node->type == TK_AND_IF || node->type == TK_OR_IF) && iscase(&(*ast)->right, lst) == 1) return (1); if ((node->type == TK_CASE || node->type == TK_PAREN_OPEN) diff --git a/42sh/src/parser/add_condition.c b/42sh/src/parser/add_condition.c index 65f4e323..0a8f04d2 100644 --- a/42sh/src/parser/add_condition.c +++ b/42sh/src/parser/add_condition.c @@ -6,7 +6,7 @@ /* By: ariard +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/03/10 17:06:16 by ariard #+# #+# */ -/* Updated: 2017/03/20 18:11:18 by gwojda ### ########.fr */ +/* Updated: 2017/03/22 15:33:12 by ariard ### ########.fr */ /* */ /* ************************************************************************** */ @@ -21,7 +21,8 @@ int iscondition(t_btree **ast, t_list **lst) { node = (*ast)->item; if ((node->type == TK_NEWLINE || node->type == TK_SEMI - || node->type == TK_AMP || node->type == TK_PIPE) + || node->type == TK_AMP || node->type == TK_PIPE + || node->type == TK_AND_IF || node->type == TK_OR_IF) && iscondition(&(*ast)->right, lst) == 1) return (1); if ((node->type == TK_IF || node->type == TK_ELIF diff --git a/42sh/src/parser/add_loop.c b/42sh/src/parser/add_loop.c index b76a35c7..f58fee22 100644 --- a/42sh/src/parser/add_loop.c +++ b/42sh/src/parser/add_loop.c @@ -6,7 +6,7 @@ /* By: ariard +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/02/17 22:17:14 by ariard #+# #+# */ -/* Updated: 2017/03/17 17:45:41 by ariard ### ########.fr */ +/* Updated: 2017/03/22 15:29:37 by ariard ### ########.fr */ /* */ /* ************************************************************************** */ @@ -29,7 +29,8 @@ int isloop(t_btree **ast, t_list **lst) || token->type == TK_NAME) && node->pattern == 0) return (0); if ((node->type == TK_NEWLINE || node->type == TK_SEMI - || node->type == TK_AMP || node->type == TK_PIPE) + || node->type == TK_AMP || node->type == TK_PIPE + || node->type == TK_AND_IF || node->type == TK_OR_IF) && isloop(&(*ast)->right, lst) == 1) return (1); if ((node->type == TK_WHILE || node->type == TK_UNTIL diff --git a/42sh/src/parser/add_number.c b/42sh/src/parser/add_number.c index 8022dbfe..d685cd22 100644 --- a/42sh/src/parser/add_number.c +++ b/42sh/src/parser/add_number.c @@ -6,7 +6,7 @@ /* By: ariard +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/03/05 17:28:31 by ariard #+# #+# */ -/* Updated: 2017/03/20 15:39:36 by jhalford ### ########.fr */ +/* Updated: 2017/03/22 15:32:16 by ariard ### ########.fr */ /* */ /* ************************************************************************** */ diff --git a/42sh/src/parser/add_sep.c b/42sh/src/parser/add_sep.c index afb89bca..aef1597e 100644 --- a/42sh/src/parser/add_sep.c +++ b/42sh/src/parser/add_sep.c @@ -6,7 +6,7 @@ /* By: ariard +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/02/15 19:12:07 by ariard #+# #+# */ -/* Updated: 2017/03/15 18:57:13 by ariard ### ########.fr */ +/* Updated: 2017/03/22 15:30:32 by ariard ### ########.fr */ /* */ /* ************************************************************************** */ diff --git a/42sh/src/parser/add_subshell.c b/42sh/src/parser/add_subshell.c index 22bbb97e..c928ae0f 100644 --- a/42sh/src/parser/add_subshell.c +++ b/42sh/src/parser/add_subshell.c @@ -6,7 +6,7 @@ /* By: ariard +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/02/24 18:41:50 by ariard #+# #+# */ -/* Updated: 2017/03/20 14:57:34 by gwojda ### ########.fr */ +/* Updated: 2017/03/22 15:32:43 by ariard ### ########.fr */ /* */ /* ************************************************************************** */ @@ -22,7 +22,8 @@ int issubshell(t_btree **ast, t_list **lst) { node = (*ast)->item; if ((node->type == TK_NEWLINE || node->type == TK_SEMI - || node->type == TK_AMP || node->type == TK_PIPE) + || node->type == TK_AMP || node->type == TK_PIPE + || node->type == TK_AND_IF || node->type == TK_OR_IF) && issubshell(&(*ast)->right, lst) == 1) return (1); if (node->type == SUBSHELL && node->full == 0)