From b6c235dd776ef8c873be1bb0d578dfa58d92f264 Mon Sep 17 00:00:00 2001 From: nass1pro Date: Thu, 10 Sep 2020 05:15:43 +0200 Subject: update escape --- src/lexer/lexer.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/lexer/lexer.c') diff --git a/src/lexer/lexer.c b/src/lexer/lexer.c index 3c7328e..60e77a3 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/08/28 10:43:42 by charles ### ########.fr */ +/* Updated: 2020/09/10 05:06:11 by nahaddac ### ########.fr */ /* */ /* ************************************************************************** */ #include "lexer.h" +#include int len_until_sep(char *input) { @@ -24,6 +25,8 @@ int len_until_sep(char *input) i +=2; if (input[i] == '\\') i += len_until_sep(&input[i]); + i += lexer_space(&input[i]); + return i; } if (lexer_sep(input[i])) return(i); @@ -47,7 +50,10 @@ int check_input(char *input) i = 0; op = 1; if (input[i] == '\\' && lexer_sep(input[i + 1])) + { i += 2; + return (i + lexer_space(&input[i])); + } if (input[i] == '(' || input[i] == ')') { i +=1; @@ -58,12 +64,8 @@ int check_input(char *input) } if (lexer_sep(input[i])) { - /* src/lexer/lexer.c:62:12: warning: Although the value stored to 'i' is used in the enclosing expression, the value is never actually read from 'i' */ - /* return (i += lexer_space(&input[i + 1]) + 1); */ - /* ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ - if (input[i] == ';') - return (i += lexer_space(&input[i + 1]) + 1); + return (i + lexer_space(&input[i + 1]) + 1); while(input[i] == input[i + 1] && op < 2) { i++; -- cgit