aboutsummaryrefslogtreecommitdiff
path: root/src/lexer/lexer.c
diff options
context:
space:
mode:
authornass1pro <nass1pro@gmail.com>2020-09-14 16:21:24 +0200
committernass1pro <nass1pro@gmail.com>2020-09-14 16:21:24 +0200
commit7f08c8ba80240ece1f34caa4fb15e240301fff5e (patch)
tree92412156e94f69f0fd7240e7e5e131712a2c1a19 /src/lexer/lexer.c
parent5c5096d5c6d67686c1ad896cbb7a1b5386abf597 (diff)
downloadminishell-7f08c8ba80240ece1f34caa4fb15e240301fff5e.tar.gz
minishell-7f08c8ba80240ece1f34caa4fb15e240301fff5e.tar.bz2
minishell-7f08c8ba80240ece1f34caa4fb15e240301fff5e.zip
test error lexer quote
Diffstat (limited to 'src/lexer/lexer.c')
-rw-r--r--src/lexer/lexer.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/lexer/lexer.c b/src/lexer/lexer.c
index 79401f2..63e92db 100644
--- a/src/lexer/lexer.c
+++ b/src/lexer/lexer.c
@@ -6,11 +6,12 @@
/* By: nahaddac <nahaddac@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/07/16 08:18:25 by nahaddac #+# #+# */
-/* Updated: 2020/09/14 11:30:24 by nahaddac ### ########.fr */
+/* Updated: 2020/09/14 16:14:51 by nahaddac ### ########.fr */
/* */
/* ************************************************************************** */
#include "lexer.h"
+#include <stdio.h>
// len until meaningful character for non quoted str
int len_until_sep(char *input)
@@ -101,16 +102,20 @@ t_tok_lst *create_token_list(char *input, t_tok_lst **lst)
** \return The created tokens or NULL on error
*/
-t_tok_lst *lexer(char *input)
+int lexer(char *input, t_tok_lst **out)
{
t_tok_lst *lst;
+ int r;
+ r = 0;
if (!input)
- return (NULL);
+ return (1);
lst = NULL;
lst = create_token_list(input, &lst);
- lexer_trim(lst);
- return (lst);
+ r = lexer_trim(lst);
+ *out = lst;
+ return r;
+
}
/* int check_input_out(char *input) */