diff options
Diffstat (limited to 'src/lexer/tok_lst.c')
| -rw-r--r-- | src/lexer/tok_lst.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/lexer/tok_lst.c b/src/lexer/tok_lst.c index 8d29bb5..a620aa5 100644 --- a/src/lexer/tok_lst.c +++ b/src/lexer/tok_lst.c @@ -6,7 +6,7 @@ /* By: charles <me@cacharle.xyz> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/08/27 09:32:58 by charles #+# #+# */ -/* Updated: 2020/08/27 18:40:05 by charles ### ########.fr */ +/* Updated: 2020/08/27 20:54:35 by charles ### ########.fr */ /* */ /* ************************************************************************** */ @@ -31,6 +31,7 @@ t_tok_lst *tok_lst_new_until(enum e_tok tag, char *content, size_t n) return (NULL); } ret->tag = tag; + ret->next = NULL; return (ret); } @@ -57,3 +58,15 @@ t_tok_lst *tok_lst_last(t_tok_lst *tokens) { return ((t_tok_lst*)ft_lstlast((t_ftlst*)tokens)); } + +t_tok_lst *tok_lst_pop_front(t_tok_lst **tokens) +{ + t_tok_lst *poped; + + if (tokens == NULL || *tokens == NULL) + return (NULL); + poped = *tokens; + *tokens = poped->next; + poped->next = NULL; + return (poped); +} |
