aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c57
1 files changed, 53 insertions, 4 deletions
diff --git a/src/main.c b/src/main.c
index d9302ad..5dac612 100644
--- a/src/main.c
+++ b/src/main.c
@@ -6,7 +6,7 @@
/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/02/28 11:45:44 by cacharle #+# #+# */
-/* Updated: 2020/04/05 12:15:57 by charles ### ########.fr */
+/* Updated: 2020/06/13 11:56:27 by charles ### ########.fr */
/* */
/* ************************************************************************** */
@@ -19,6 +19,7 @@
#include "ast.h"
#include "eval.h"
#include "ms_glob.h"
+#include "lexer.h"
/*
** \brief Program entrypoint
@@ -88,9 +89,57 @@ int main(int argc, char **argv, char **envp)
/* free(line); */
/* ft_htdestroy(path, free); */
/* ms_glob("src#<{(|"); */
- char *j = ms_glob("*/*.c");
- printf("%s\n", j);
- free(j);
+
+ /* char *j = ms_glob("|)}>#*.c"); */
+ /* printf("%s\n", j); */
+ /* free(j); */
+
+ t_ftvec *v = ft_vecnew(32);
+ ft_vecpush(v, token_new(LTAG_STR, "$TERM$LFS$TERM$TERM."));
+ ft_vecpush(v, token_new(LTAG_STR, "$$LFS$TERM$TERM."));
+ ft_vecpush(v, token_new(LTAG_STR, "*/*.c$TERM"));
+ ft_vecpush(v, token_new(LTAG_STR, "src/*.c include/*.h"));
+ ft_vecpush(v, token_new(LTAG_STR, "$A$B"));
+
+ ft_vecpush(v, token_new(LTAG_STR, "\\$TERM"));
+ ft_vecpush(v, token_new(LTAG_STR, "$TER\\M"));
+ ft_vecpush(v, token_new(LTAG_STR, "\\\\"));
+ ft_vecpush(v, token_new(LTAG_STR_SINGLE, "''''$TEST\\TEST"));
+ ft_vecpush(v, token_new(LTAG_STR_DOUBLE, ",$TEST,$B,"));
+
+ ft_vecpush(v, token_new(LTAG_STR_DOUBLE | LTAG_STICK, "$TEST"));
+ ft_vecpush(v, token_new(LTAG_STR_DOUBLE | LTAG_STICK, "$TEST"));
+ ft_vecpush(v, token_new(LTAG_STR_DOUBLE , "$TEST"));
+ ft_vecpush(v, token_new(LTAG_STR_DOUBLE | LTAG_STICK, "$TEST"));
+ ft_vecpush(v, token_new(LTAG_STR_SINGLE, "$TEST"));
+
+ char **as = preprocess(v, env);
+ char **tmp = as;
+
+ while (*as != NULL)
+ puts(*as++);
+
+ ft_split_destroy(tmp);
ft_vecdestroy(env, free);
return (0);
}
+
+
+/////////////////////////////////////////////////////////////////////////////////////////
+// lexer main
+/////////////////////////////////////////////////////////////////////////////////////////
+
+#include "lexer.h"
+
+/* int main(void) */
+/* { */
+/* char **out; */
+/* int i = -1; */
+/* */
+/* out = lexer("\"echo\" \"* login_x\"<<AUTHORS; echo && ; salut;\"echo\"\"* login_x\""); */
+/* //out = lexer("echo * login_x << AUTHORS&&cd Desktop"); */
+/* while(out[++i]) */
+/* printf("%s\n", out[i]);; */
+/* exit(0); */
+/* return (0); */
+/* } */