WIP parsing expansions

This commit is contained in:
LuckyLaszlo
2021-11-07 04:41:17 +01:00
parent b9fc6a9bc4
commit 0a5c7545c1
18 changed files with 631 additions and 355 deletions

View File

@@ -6,7 +6,7 @@
/* By: lperrey <lperrey@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/10/19 08:38:55 by lperrey #+# #+# */
/* Updated: 2021/10/30 22:37:48 by lperrey ### ########.fr */
/* Updated: 2021/11/07 03:18:38 by lperrey ### ########.fr */
/* */
/* ************************************************************************** */
@@ -14,7 +14,7 @@
int fill_token(t_token *t, char *input, int *i, int *t_i);
static t_token *alloc_token(size_t content_len);
static t_token *alloc_token(size_t content_len); // TODO, a remplacer par ft_lstnew_generic()
static int tokenize_input(t_token *t, char *input, size_t input_len);
t_token *input_to_tokens(char *input)
@@ -30,7 +30,7 @@ t_token *input_to_tokens(char *input)
if (!tokenize_input(t_head, input, input_len))
return (ft_lstclear((t_list **)&t_head, free));
t_tmp = (t_token *)ft_lstbeforelast((t_list *)t_head);
if (t_tmp && !t_tmp->next->id)
if (t_tmp && t_tmp->next && !t_tmp->next->id)
{
ft_lstdelone((t_list *)t_tmp->next, free);
t_tmp->next = NULL;