tokenizer_v3

This commit is contained in:
gazhonsepaskwa
2025-01-17 17:04:38 +01:00
parent 8c64e2c6f6
commit c36c1550d7
7 changed files with 190 additions and 244 deletions

View File

@@ -12,45 +12,34 @@
#include "tokenizer/tokenizer.h"
/*str_equal(char *original)*/
/*{*/
/**/
/*}*/
void truncate_comment(char *str)
{
int i;
/*void truncate_after_exit_word(char *str)*/
/*{*/
/* int i;*/
/* int depth;*/
/* int truncate_mode;*/
/**/
/* i = 0;*/
/* depth = 0;*/
/* truncate_mode = FALSE;*/
/* while (lst[i])*/
/* {*/
/**/
/* }*/
/*}*/
void print_linked_list(t_node *head) {
t_node *current = head;
while (current != NULL) {
printf("Node - Priority: %d, Depth: %d, TOKEN: |%s|\n", current->priority, current->depth, current->token);
current = current->next; // Move to the next node
}
i = 0;
while (str[i])
{
if (str[i] == '#')
{
str[i] = 0;
return ;
}
i++;
}
}
int main (int ac, char **av)
{
(void)ac;
char *str = ft_strtrim(av[1], " ");
t_node *lst;
if (str)
{
/*truncate_after_exit_word(str);*/
lst = tokenize(str);
print_linked_list(lst);
}
truncate_comment(av[1]);
lst = tokenize(av[1]);
if (!lst)
return (1);
// debug_linked_list(lst);
free_linked_list(lst);
// free la list wesh
}