diff options
| author | Charles <sircharlesaze@gmail.com> | 2020-06-19 12:19:50 +0200 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2020-06-19 12:19:50 +0200 |
| commit | a2ebd4ad078d7056a4c28ea697cfd3ebbf09d0f6 (patch) | |
| tree | b021f962e60e614ce0baabbd4cbf1a933a001def /include | |
| parent | bf97035e8d444c141725c0cf91aaaa285ae712af (diff) | |
| download | minishell-a2ebd4ad078d7056a4c28ea697cfd3ebbf09d0f6.tar.gz minishell-a2ebd4ad078d7056a4c28ea697cfd3ebbf09d0f6.tar.bz2 minishell-a2ebd4ad078d7056a4c28ea697cfd3ebbf09d0f6.zip | |
Added parenthesis handling in eval (not tested)
Diffstat (limited to 'include')
| -rw-r--r-- | include/ast.h | 8 | ||||
| -rw-r--r-- | include/eval.h | 30 |
2 files changed, 9 insertions, 29 deletions
diff --git a/include/ast.h b/include/ast.h index 53221fa..18f1d93 100644 --- a/include/ast.h +++ b/include/ast.h @@ -6,7 +6,7 @@ /* By: charles <charles@student.42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/04/01 17:05:38 by charles #+# #+# */ -/* Updated: 2020/06/18 13:35:38 by charles ### ########.fr */ +/* Updated: 2020/06/19 10:40:34 by charles ### ########.fr */ /* */ /* ************************************************************************** */ @@ -48,9 +48,9 @@ typedef struct s_op enum e_ast_tag { - AST_CMD, - AST_OP, - AST_OP_PARENT, + AST_CMD = 1 << 0, + AST_OP = 1 << 1, + AST_PARENT = 1 << 2, }; /* diff --git a/include/eval.h b/include/eval.h index 60d6f23..97c1ce8 100644 --- a/include/eval.h +++ b/include/eval.h @@ -6,7 +6,7 @@ /* By: charles <charles@student.42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/04/01 17:05:30 by charles #+# #+# */ -/* Updated: 2020/06/18 13:38:53 by charles ### ########.fr */ +/* Updated: 2020/06/19 12:18:42 by charles ### ########.fr */ /* */ /* ************************************************************************** */ @@ -22,33 +22,13 @@ # include "lexer.h" # include "ast.h" -/* -** \brief Evaluation state struct -*/ - typedef struct { t_path path; t_env env; -} t_eval_state; - -/* -** \brief Evaluation status struct -*/ - -typedef struct s_eval_status -{ - char *err; - int status; -} t_eval_status; - -typedef struct -{ - t_eval_state *state; - t_op *op; - int fd_in; - int fd_out; -} t_fork_param_op; + t_ast *ast; + int fds[2]; +} t_fork_param_parent; typedef struct { @@ -66,7 +46,7 @@ typedef struct ** op.c */ -int eval_op(int fds[2], t_env env, t_path path, t_op *op); +int eval_op(int fds[2], t_env env, t_path path, t_ast *ast); int eval(int fds[2], t_env env, t_path path, t_ast *ast); enum e_error |
