diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lexer/lexer_count_nb_element.c | 31 | ||||
| -rw-r--r-- | src/lexer/lexer_len_element_and_mall.c | 58 |
2 files changed, 0 insertions, 89 deletions
diff --git a/src/lexer/lexer_count_nb_element.c b/src/lexer/lexer_count_nb_element.c deleted file mode 100644 index 1455d5e..0000000 --- a/src/lexer/lexer_count_nb_element.c +++ /dev/null @@ -1,31 +0,0 @@ - -#include "lexer.h" - -int lexer_count_nb_element(char *input) -{ - int i; - int j; - - i = 0; - j = 1; - while(input[i] != '\0') - { - if (lexer_sep(input[i]) || input[i] == '"' || input[i] == '\'') - { - if (input[i] == '"' || input[i] == '\'') - { - i = lexer_verif_entre_cote(input,i); - j++; - } - if (lexer_sep(input[i])) - { - while (lexer_sep(input[i]) || input[i] == ' ') - ++i; - j++; - } - j++; - } - i++; - } - return (j); -} diff --git a/src/lexer/lexer_len_element_and_mall.c b/src/lexer/lexer_len_element_and_mall.c deleted file mode 100644 index e0e1132..0000000 --- a/src/lexer/lexer_len_element_and_mall.c +++ /dev/null @@ -1,58 +0,0 @@ - -#include "lexer.h" - -int lexer_count_len_element(char *input, int i) -{ - int j = -1; - if (input[i] == '"' || input[i] == '\'') - { - return(j = lexer_verif_entre_cote(input,i)); - } - else if (lexer_sep(input[i]) || input[i] == ' ') - { - while(lexer_sep(input[i]) || input[i] == ' ') - { - if(input[j] == '\0') - return(j); - ++i; - ++j; - } - } - else - { - while (!lexer_sep(input[i]) && input[i] != ' ') - { - if(input[j] == '\0') - return(j); - ++i; - ++j; - } - } - ++j; - return(j); -} - -char **lexer_malloc_len_elem(char *input, int i, char **out) -{ - int j = 0; - int k = 0; - int temp = 0; - - (void)i; - j += lexer_count_len_element(&input[j], 0); - k = j; - out[temp] = malloc(sizeof(char) * k); - ft_strlcpy(out[temp], input, k + 1); - while (input[j] != '\0') - { - temp++; - j += lexer_count_len_element(&input[j], 0); - k -= j; - if (k < 0) - k *= -1; - out[temp] = malloc(sizeof(char) * j - k + 1); - ft_strlcpy(out[temp], &input[j - k], k + 1); - k = j; - } - return(out); -} |
