From 7f08c8ba80240ece1f34caa4fb15e240301fff5e Mon Sep 17 00:00:00 2001 From: nass1pro Date: Mon, 14 Sep 2020 16:21:24 +0200 Subject: test error lexer quote --- src/lexer/lexer.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/lexer/lexer.c') 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 +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* 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 // 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) */ -- cgit