From 402a1c7b076f514a6c46a80e71179ddd9e48c7e4 Mon Sep 17 00:00:00 2001 From: nass1pro Date: Thu, 16 Jul 2020 07:17:54 +0200 Subject: uptade lexer.c '\\' --- include/lexer.h | 2 +- src/lexer/lexer.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/include/lexer.h b/include/lexer.h index c9e1b4b..ab2a448 100644 --- a/include/lexer.h +++ b/include/lexer.h @@ -6,7 +6,7 @@ /* By: nahaddac +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/06/19 10:51:26 by nahaddac #+# #+# */ -/* Updated: 2020/07/13 14:10:15 by nahaddac ### ########.fr */ +/* Updated: 2020/07/16 07:10:58 by nahaddac ### ########.fr */ /* */ /* ************************************************************************** */ diff --git a/src/lexer/lexer.c b/src/lexer/lexer.c index 400c161..4640d5a 100644 --- a/src/lexer/lexer.c +++ b/src/lexer/lexer.c @@ -7,6 +7,8 @@ int len_is_not_sep(char *input) i = -1; while(input[++i]) { + if (input[i] == '\\') + i += 1; if (lexer_sep(input[i])) return(i); if (input[i] == '\'' || input[i] == '"') @@ -28,6 +30,8 @@ int check_input(char *input) i = 0; op = 1; + if (input[i] == '\\' && lexer_sep(input[i + 1])) + i += 2; if (input[i] == '(' || input[i] == ')') return (i + 1); if (lexer_sep(input[i])) -- cgit