aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2020-06-13 10:34:30 +0200
committernass1pro <nass1pro@gmail.com>2020-06-13 11:46:02 +0200
commit72ec3b700e8e3142eb9e79098a357f01a6085589 (patch)
treed866162477544c8ff96c33c57ae119b458432d17
parentd971bd8d16608f316396aba7a579d0b1f1af5aeb (diff)
downloadminishell-72ec3b700e8e3142eb9e79098a357f01a6085589.tar.gz
minishell-72ec3b700e8e3142eb9e79098a357f01a6085589.tar.bz2
minishell-72ec3b700e8e3142eb9e79098a357f01a6085589.zip
Fixing multiple definition of lexer
-rw-r--r--include/ms_glob.h1
m---------libft0
-rw-r--r--src/glob.c1
-rw-r--r--src/lexer/lexer.c6
-rw-r--r--src/lexer/main.c29
-rw-r--r--src/parse/lexer.c16
-rw-r--r--src/parse/parse.c16
7 files changed, 34 insertions, 35 deletions
diff --git a/include/ms_glob.h b/include/ms_glob.h
index 774d3be..a5c21bd 100644
--- a/include/ms_glob.h
+++ b/include/ms_glob.h
@@ -19,6 +19,7 @@
# include "libft_str.h"
# include "libft_vec.h"
# include "utils.h"
+# include <limits.h>
struct s_glob_param
{
diff --git a/libft b/libft
-Subproject 1925805cc760061d5742f9d215998561fcd4521
+Subproject 4f4fa0d6ba8f42da8d72257b50517c222c06249
diff --git a/src/glob.c b/src/glob.c
index 2d544da..d1d1bdf 100644
--- a/src/glob.c
+++ b/src/glob.c
@@ -11,6 +11,7 @@
/* ************************************************************************** */
#include "ms_glob.h"
+#include <limits.h>
/*
** \brief Match vector start size
diff --git a/src/lexer/lexer.c b/src/lexer/lexer.c
index 994ea55..185ff83 100644
--- a/src/lexer/lexer.c
+++ b/src/lexer/lexer.c
@@ -163,8 +163,8 @@ static t_ftlst *create_token_list(char *input, t_ftlst **lst)
t_ftlst *lexer(char *input)
{
- t_ftlst **lst;
- int i;
+ t_ftlst **lst;
+ /* int i; */
if (!input)
return (0);
@@ -172,7 +172,7 @@ t_ftlst *lexer(char *input)
if (!lst)
return(0);
*lst = create_token_list(input, lst);
- i = ft_lstsize(*lst);
+ /* i = ft_lstsize(*lst); */
free(lst);
return (0);
}
diff --git a/src/lexer/main.c b/src/lexer/main.c
new file mode 100644
index 0000000..753969d
--- /dev/null
+++ b/src/lexer/main.c
@@ -0,0 +1,29 @@
+
+#include "lexer.h"
+
+/*int main(int argc, char **argv)
+{
+ char *input;
+
+ if (!(input = malloc(sizeof(char) * ft_strlen(argv[1]) + 1)))
+ return(0);
+ ft_strlcpy(input, argv[1], ft_strlen(argv[1]) + 1);
+
+ lexer(input);
+ free(input);
+ exit(0);
+ return (0);
+}*/
+/*
+#include <stdio.h>
+int main(int argc, char **argv, char **envp)
+{
+ 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;
+}
+*/
diff --git a/src/parse/lexer.c b/src/parse/lexer.c
deleted file mode 100644
index 74a3bd4..0000000
--- a/src/parse/lexer.c
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
-** \file lexer.c
-** \brief Lexer
-*/
-
-#include "minishell.h"
-
-char **lexer(char *input)
-{
- char **out_lex;
-
- (void)out_lex;
- if (!input)
- return (NULL);
- return (NULL);
-}
diff --git a/src/parse/parse.c b/src/parse/parse.c
deleted file mode 100644
index ed1aa28..0000000
--- a/src/parse/parse.c
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
-** \file parse.c
-** \brief Parser
-*/
-
-#include "parse.h"
-
-t_ast *parse(char *input)
-{
-/* char **out_lex; */
-/* if (!(out_lex = lexer(input))) */
-/* return (NULL); */
-
- (void)input;
- return (NULL);
-}