aboutsummaryrefslogtreecommitdiff
path: root/src/lexer/lexer.c
diff options
context:
space:
mode:
authornass1pro <nass1pro@gmail.com>2020-07-17 13:10:18 +0200
committerCharles <sircharlesaze@gmail.com>2020-07-18 08:59:42 +0200
commit6e97753fa7307cfc0a2ea426edaac6c683e916f7 (patch)
treed8f63e7df8f962f714ac13ac3c7a2a8bb62341a2 /src/lexer/lexer.c
parentbd8f652de51395fb26659f7a634e55bd46917b2e (diff)
downloadminishell-6e97753fa7307cfc0a2ea426edaac6c683e916f7.tar.gz
minishell-6e97753fa7307cfc0a2ea426edaac6c683e916f7.tar.bz2
minishell-6e97753fa7307cfc0a2ea426edaac6c683e916f7.zip
Added parser syntax error
Diffstat (limited to 'src/lexer/lexer.c')
-rw-r--r--src/lexer/lexer.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/lexer/lexer.c b/src/lexer/lexer.c
index a6a2755..7c6d527 100644
--- a/src/lexer/lexer.c
+++ b/src/lexer/lexer.c
@@ -6,7 +6,7 @@
/* By: nahaddac <nahaddac@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/07/16 08:18:25 by nahaddac #+# #+# */
-/* Updated: 2020/07/17 13:08:08 by charles ### ########.fr */
+/* Updated: 2020/07/18 08:58:42 by charles ### ########.fr */
/* */
/* ************************************************************************** */
@@ -24,7 +24,6 @@ int len_is_not_sep(char *input)
i +=2;
if (input[i] == '\\')
i += len_is_not_sep(&input[i]);
-
}
if (lexer_sep(input[i]))
return(i);
@@ -50,9 +49,17 @@ int check_input(char *input)
if (input[i] == '\\' && lexer_sep(input[i + 1]))
i += 2;
if (input[i] == '(' || input[i] == ')')
- return (i + 1);
+ {
+ i +=1;
+ if(input[i] == ' ')
+ while(input[i++] != ' ')
+ ;
+ return (i);
+ }
if (lexer_sep(input[i]))
{
+ if (input[i] == ';')
+ return (i += lexe_space(&input[i + 1]) + 1);
while(input[i] == input[i + 1] && op < 2)
{
i++;