diff options
| -rw-r--r-- | include/lexer.h | 2 | ||||
| -rw-r--r-- | src/lexer/lexer.c | 4 |
2 files changed, 5 insertions, 1 deletions
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 <nahaddac@student.42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* 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])) |
