aboutsummaryrefslogtreecommitdiff
path: root/src/lexer/token.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lexer/token.c')
-rw-r--r--src/lexer/token.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/src/lexer/token.c b/src/lexer/token.c
index f7c1691..43971de 100644
--- a/src/lexer/token.c
+++ b/src/lexer/token.c
@@ -6,7 +6,7 @@
/* By: charles <charles@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/06/09 13:38:08 by charles #+# #+# */
-/* Updated: 2020/07/13 09:58:18 by nahaddac ### ########.fr */
+/* Updated: 2020/08/19 13:40:55 by charles ### ########.fr */
/* */
/* ************************************************************************** */
@@ -55,3 +55,29 @@ void token_destroy_lst2(t_ftlst *tokens1, t_ftlst *tokens2)
ft_lstdestroy(&tokens1, (void (*)(void*))token_destroy);
ft_lstdestroy(&tokens2, (void (*)(void*))token_destroy);
}
+
+enum e_token_tag token_tag(t_ftlst *token_lst)
+{
+ return (((t_token*)token_lst->data)->tag);
+}
+
+void token_set_tag(t_ftlst *token_lst, enum e_token_tag tag)
+{
+ ((t_token*)token_lst->data)->tag = tag;
+}
+
+char *token_content(t_ftlst *token_lst)
+{
+ return (((t_token*)token_lst->data)->content);
+}
+
+void token_set_content(t_ftlst *token_lst, char *content)
+{
+ ((t_token*)token_lst->data)->content = content;
+}
+
+void token_set_contentf(t_ftlst *token_lst, char *content)
+{
+ free(token_content(token_lst));
+ token_set_content(token_lst, content);
+}