tokenizer_v3
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user