From 82c2d94a6513256f9173ff62439e70d3a0b25582 Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Thu, 17 Sep 2020 11:21:54 +0200 Subject: Added lexer spliting ';;', separator string lookup table in parser for error message --- src/lexer/lexer.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'src/lexer') diff --git a/src/lexer/lexer.c b/src/lexer/lexer.c index 7a39373..4d5e3b1 100644 --- a/src/lexer/lexer.c +++ b/src/lexer/lexer.c @@ -6,7 +6,7 @@ /* By: nahaddac +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/07/16 08:18:25 by nahaddac #+# #+# */ -/* Updated: 2020/09/16 20:17:10 by charles ### ########.fr */ +/* Updated: 2020/09/17 10:59:13 by charles ### ########.fr */ /* */ /* ************************************************************************** */ @@ -55,7 +55,7 @@ int tok_len(char *input) return (i + 1); if (lexer_sep(input[i])) { - if (input[i] == input[i + 1]) + if (input[i] != ';' && input[i] == input[i + 1]) i++; return (i + 1 + lexer_space(&input[i + 1])); } @@ -105,22 +105,22 @@ t_tok_lst *create_token_list(char *input, t_tok_lst **lst) int lexer(char *input, t_tok_lst **out) { int status; - t_tok_lst *curr; + /* t_tok_lst *curr; */ if (!input) return (2); *out = NULL; *out = create_token_list(input, out); status = lexer_trim(*out); - curr = *out; - while (curr != NULL) - { - if (!(curr->tag & TAG_IS_STR)) - { - free(curr->content); - curr->content = NULL; - } - curr = curr->next; - } + /* curr = *out; */ + /* while (curr != NULL) */ + /* { */ + /* if (!(curr->tag & TAG_IS_STR)) */ + /* { */ + /* free(curr->content); */ + /* curr->content = NULL; */ + /* } */ + /* curr = curr->next; */ + /* } */ return (status); } -- cgit