diff --git a/42sh/src/lexer/lexer_dless.c b/42sh/src/lexer/lexer_dless.c index d3859b87..4ee8434c 100644 --- a/42sh/src/lexer/lexer_dless.c +++ b/42sh/src/lexer/lexer_dless.c @@ -10,20 +10,20 @@ int lexer_dless(t_list **alst, t_lexer *lexer) (void)lexer; heredoc_lst = *(t_list**)lexer->heredoc_stack->content; heredoc_tok = heredoc_lst->content; - if (!(heredoc_lst->next)) - { - ft_dprintf(2, "{red}%s: parse error near `\\n'{eoc}\n", SHELL_NAME); - return (1); - } - eof_tok = heredoc_lst->next->content; - if (!(eof_tok->type == TK_WORD)) - { - ft_dprintf(2, "{red}%s: expected word token after <<{eoc}\n", SHELL_NAME); - return (1); - } - DG("heredoc contains [%s]", heredoc_tok->data); - DG("heredoc ends at [%s]", eof_tok->data); - DG("input is [%s]", lexer->str + lexer->pos); + /* if (!(heredoc_lst->next)) */ + /* { */ + /* ft_dprintf(2, "{red}%s: parse error near `\\n'{eoc}\n", SHELL_NAME); */ + /* return (1); */ + /* } */ + /* eof_tok = heredoc_lst->next->content; */ + /* if (!(eof_tok->type == TK_WORD)) */ + /* { */ + /* ft_dprintf(2, "{red}%s: expected word token after <<{eoc}\n", SHELL_NAME); */ + /* return (1); */ + /* } */ + /* DG("heredoc contains [%s]", heredoc_tok->data); */ + /* DG("heredoc ends at [%s]", eof_tok->data); */ + /* DG("input is [%s]", lexer->str + lexer->pos); */ if (ft_strcmp(eof_tok->data, lexer->str + lexer->pos) == 0) { pop(&lexer->stack); diff --git a/42sh/src/lexer/lexer_less.c b/42sh/src/lexer/lexer_less.c index 02e1ee54..8b9e0b0d 100644 --- a/42sh/src/lexer/lexer_less.c +++ b/42sh/src/lexer/lexer_less.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/12/03 12:06:53 by jhalford #+# #+# */ -/* Updated: 2017/03/08 12:10:38 by jhalford ### ########.fr */ +/* Updated: 2017/03/08 13:27:33 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ @@ -17,7 +17,6 @@ int lexer_less(t_list **alst, t_lexer *lexer) t_token *token; token = (*alst)->content; - token_append(token, lexer, 0, 0); lexer->pos++; if (lexer->str[lexer->pos] == '&') { @@ -28,11 +27,9 @@ int lexer_less(t_list **alst, t_lexer *lexer) } if (lexer->str[lexer->pos] == '<') { - token_free(token, 0); - (*alst)->content = token_init(); token->type = TK_DLESS; - lexer->pos++; push(&lexer->stack, DLESS); + lexer->pos++; lexer->state = DEFAULT; ft_lsteadd(&lexer->heredoc_stack, ft_lstnew(alst, sizeof(alst))); return (lexer_lex(&(*alst)->next, lexer)); diff --git a/42sh/src/lexer/token_free.c b/42sh/src/lexer/token_free.c index 0727f7a5..148ff2b6 100644 --- a/42sh/src/lexer/token_free.c +++ b/42sh/src/lexer/token_free.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/12/03 12:07:30 by jhalford #+# #+# */ -/* Updated: 2017/03/03 18:57:46 by ariard ### ########.fr */ +/* Updated: 2017/03/08 13:22:19 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ diff --git a/42sh/src/lexer/token_init.c b/42sh/src/lexer/token_init.c index 4739d61b..3e58f078 100644 --- a/42sh/src/lexer/token_init.c +++ b/42sh/src/lexer/token_init.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/11/10 15:30:25 by jhalford #+# #+# */ -/* Updated: 2017/02/20 20:55:35 by ariard ### ########.fr */ +/* Updated: 2017/03/08 13:21:55 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ diff --git a/42sh/src/main/data_init.c b/42sh/src/main/data_init.c index e1155419..462e0902 100644 --- a/42sh/src/main/data_init.c +++ b/42sh/src/main/data_init.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/11/28 19:26:32 by jhalford #+# #+# */ -/* Updated: 2017/03/08 13:05:23 by jhalford ### ########.fr */ +/* Updated: 2017/03/08 13:48:27 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ diff --git a/42sh/src/main/main.c b/42sh/src/main/main.c index 22308690..1f7a6f58 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/03/08 12:59:55 by jhalford ### ########.fr */ +/* Updated: 2017/03/08 13:27:47 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */