diff --git a/42sh/.gitignore b/42sh/.gitignore index c762ce48..cfd0396b 100644 --- a/42sh/.gitignore +++ b/42sh/.gitignore @@ -11,3 +11,5 @@ debug *.swo *.o *.swn +STDBUG +STDEBUG diff --git a/42sh/STDEBUG b/42sh/STDEBUG deleted file mode 100644 index 4f628983..00000000 --- a/42sh/STDEBUG +++ /dev/null @@ -1,21 +0,0 @@ - shell_init.c 28 interactive shell settings - ft_parse.c 34 new sym CMD_NAME - eval_sym.c 637eval head LINEBREAK && sym CMD_NAME - eval_sym.c 637eval head LINEBREAK && sym CMD_SUPERIOR - build_tree.c 60 func TK : 'TK_WORD' TK : 'TK_WORD' - add_cmd.c 21 add cmd - ft_parse.c 34 new sym LINEBREAK - eval_sym.c 637eval head CMD_SUPERIOR && sym LINEBREAK - eval_sym.c 637eval head CMD_SUPERIOR && sym SEPARATOR_OP - eval_sym.c 637eval head CMD_SUPERIOR && sym SEPARATOR - eval_sym.c 637eval head LINEBREAK && sym END_COMMAND - eval_sym.c 637eval head LINEBREAK && sym PIPE_SEQUENCE - eval_sym.c 637eval head LINEBREAK && sym PIPELINE - eval_sym.c 637eval head LINEBREAK && sym AND_OR - eval_sym.c 637eval head LINEBREAK && sym LIST - eval_sym.c 637eval head LINEBREAK && sym COMPLETE_COMMAND - eval_sym.c 637eval head LINEBREAK && sym COMPLETE_COMMANDS - eval_sym.c 637eval head NULL && sym PROGRAM - ft_parse.c 34 new sym LINEBREAK - eval_sym.c 637eval head PROGRAM && sym LINEBREAK - ft_exec.c 53 match : TK_WORD and TK_WORD diff --git a/42sh/src/exec/ft_exec.c b/42sh/src/exec/ft_exec.c index 9a4888c1..d2916952 100644 --- a/42sh/src/exec/ft_exec.c +++ b/42sh/src/exec/ft_exec.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/11/27 20:30:32 by jhalford #+# #+# */ -/* Updated: 2017/02/21 18:11:01 by ariard ### ########.fr */ +/* Updated: 2017/02/21 18:15:31 by ariard ### ########.fr */ /* */ /* ************************************************************************** */ diff --git a/42sh/src/main/main.c b/42sh/src/main/main.c index ee5d90b3..785ed302 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/21 18:13:49 by ariard ### ########.fr */ +/* Updated: 2017/02/21 18:33:24 by ariard ### ########.fr */ /* */ /* ************************************************************************** */ @@ -40,12 +40,9 @@ int handle_instruction(int fd) return (1); //token_print(token); if (get_lexer_stack(lexer)) - return (1); - if (!token) - return (0); - ft_add_str_in_history(lexer.str); + continue; if (ft_parse(&ast, &token, &parser)) - return (1); + continue; if (parser.state == SUCCESS) break; if (parser.state == ERROR) @@ -54,7 +51,7 @@ int handle_instruction(int fd) btree_print(STDBUG, ast, &ft_putast); if (ft_exec(&ast)) return (1); - ft_strdel(&lexer.str); + ft_add_str_in_history(lexer.str); return (1); } @@ -69,9 +66,7 @@ int get_input_fd() /* { */ /* } */ else - { return (open(shell_get_avdata(), O_RDONLY)); - } } int main(int ac, char **av) @@ -84,6 +79,8 @@ int main(int ac, char **av) fd = get_input_fd(); while (handle_instruction(fd)) { +// lexer_clean; +// parser_clean; ; } return (0);