From: Lukas Jiriste Date: Sun, 21 Jul 2024 16:19:51 +0000 (+0200) Subject: Add is_token_type function X-Git-Url: https://git.ljiriste.work/?a=commitdiff_plain;h=f553597acdcc138b39ec745b746279e592ced04a;p=42%2Fminishell.git Add is_token_type function --- diff --git a/src/execution.c b/src/execution.c index 004da7d..0ba69df 100644 --- a/src/execution.c +++ b/src/execution.c @@ -6,7 +6,7 @@ /* By: ljiriste +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/07/21 08:57:54 by ljiriste #+# #+# */ -/* Updated: 2024/07/21 17:41:29 by ljiriste ### ########.fr */ +/* Updated: 2024/07/21 18:18:45 by ljiriste ### ########.fr */ /* */ /* ************************************************************************** */ @@ -30,6 +30,11 @@ int cmp_var_name(const char *a, const char *b) return (ft_strncmp(a, b, namelen)); } +int is_token_type(const t_parse_tree_node *node, const char *type) +{ + return (!ft_strcmp(node->token.type, type)); +} + void clear_old(t_vec *assignments, const char *new) { size_t i;