diff --git a/42sh/src/lexer/lexer_paren.c b/42sh/src/lexer/lexer_paren.c index 5abf4b69..03efd44e 100644 --- a/42sh/src/lexer/lexer_paren.c +++ b/42sh/src/lexer/lexer_paren.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/03/03 17:37:15 by jhalford #+# #+# */ -/* Updated: 2017/03/08 12:14:09 by jhalford ### ########.fr */ +/* Updated: 2017/03/22 17:16:17 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ @@ -24,10 +24,11 @@ int lexer_paren(t_list **alst, t_lexer *lexer) token->type = TK_PAREN_OPEN; push(&lexer->stack, PAREN); } - else if (get_lexer_stack(*lexer)) + else { token->type = TK_PAREN_CLOSE; - pop(&lexer->stack); + if (get_lexer_stack(*lexer) == PAREN) + pop(&lexer->stack); } lexer->pos++; lexer->state = DEFAULT; diff --git a/42sh/src/lexer/token_print.c b/42sh/src/lexer/token_print.c index be837ca1..2f0df7e5 100644 --- a/42sh/src/lexer/token_print.c +++ b/42sh/src/lexer/token_print.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/11/28 14:39:01 by jhalford #+# #+# */ -/* Updated: 2017/03/21 20:37:47 by ariard ### ########.fr */ +/* Updated: 2017/03/22 17:13:31 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ @@ -18,7 +18,6 @@ void token_print(t_list *lst) while (lst) { - DG("in token print"); if (lst->content) token = lst->content; if (token->type) diff --git a/42sh/src/main/main.c b/42sh/src/main/main.c index e90cc360..17a21519 100644 --- a/42sh/src/main/main.c +++ b/42sh/src/main/main.c @@ -6,7 +6,7 @@ /* By: gwojda +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/03/20 14:45:40 by gwojda #+# #+# */ -/* Updated: 2017/03/22 15:54:01 by jhalford ### ########.fr */ +/* Updated: 2017/03/22 17:13:06 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ @@ -43,7 +43,8 @@ static int handle_instruction(t_list **token, t_btree **ast) return (ret); if (do_lexer_routine(token, stream) > 0) continue ; - /* token_print(*token); */ + token_print(*token); + exit(1); if ((ret = do_parser_routine(token, ast)) == 1 && SH_NO_INTERACTIVE(data->opts)) return (ret);