aboutsummaryrefslogtreecommitdiff
path: root/test_mini/speudo_code
diff options
context:
space:
mode:
authornass1pro <nass1pro@gmail.com>2020-06-10 18:02:58 +0200
committerCharles <sircharlesaze@gmail.com>2020-06-13 11:26:12 +0200
commitf4b7aaff1b397e31925e0701e1342583058178ba (patch)
tree2f6364a31a2814e71abb3fa69ea803fee85de912 /test_mini/speudo_code
parent19d83149feebaeb99430715242aac352890122cc (diff)
downloadminishell-f4b7aaff1b397e31925e0701e1342583058178ba.tar.gz
minishell-f4b7aaff1b397e31925e0701e1342583058178ba.tar.bz2
minishell-f4b7aaff1b397e31925e0701e1342583058178ba.zip
back_lexer_test00
lexer-split-ok lexer_split_ok
Diffstat (limited to 'test_mini/speudo_code')
-rw-r--r--test_mini/speudo_code55
1 files changed, 9 insertions, 46 deletions
diff --git a/test_mini/speudo_code b/test_mini/speudo_code
index c6ad4c1..ef776ce 100644
--- a/test_mini/speudo_code
+++ b/test_mini/speudo_code
@@ -2,51 +2,14 @@
is_space
-t_lex *lexer(char *input)
+#include <stdio.h>
+int main(int argc, char **argv, char **envp)
{
- char **out;
- int j;
- int i;
-
- i = 0;
- j = 0;
- if (!input)
- return (0);
- i = lexer_count_nb_element(input);
- if (!(out = malloc(sizeof(char *) * i + 1)))
- return (0);
- out[i + 1] = NULL;
- out = lexer_malloc_len_elem(input,i, out);
- return(out);
-
-}
-
-
-t_ftlst *lexer(char *input)
-{
- int i;
- int j;
- char *temp;
- enum e_token_tag token;
-
- i = -1;
- j = 0;
- if (!input)
- return (0);
- while(input[++i])
- {
- if(lexer_sep(input[i]))
- {
- printf("%d\n", i - j);
- token = ret_token_sep(input, i);
- temp = malloc(sizeof(char) * i - j + 1);
- ft_strlcpy(temp, &input[j], i - j);
- j = i;
- printf("%s\n", &input[i]);
- }
-
- }
- printf("%s\n", temp);
- free(temp);
- return (0);
+ printf("ARGV:\n");
+ for (int i = 0; i < argc; i++)
+ printf("[%d] %s\n", i, argv[i]);
+ printf("\nENV:\n");
+ for (int i = 0; envp[i] != NULL && i < 10; i++)
+ printf("[%d] %s\n", i, envp[i]);
+ return 0;
}