Add is_token_type function
authorLukas Jiriste <ljiriste@student.42prague.com>
Sun, 21 Jul 2024 16:19:51 +0000 (18:19 +0200)
committerLukas Jiriste <ljiriste@student.42prague.com>
Sun, 21 Jul 2024 16:19:51 +0000 (18:19 +0200)
src/execution.c

index 004da7d114768e65d3b938706c52fcb232d1f308..0ba69df5aef2472f9214e1c5329aa3dc6ef2e5e4 100644 (file)
@@ -6,7 +6,7 @@
 /*   By: ljiriste <ljiriste@student.42prague.com>   +#+  +:+       +#+        */
 /*                                                +#+#+#+#+#+   +#+           */
 /*   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;