syntax analysis with simplified shell grammar
+ TODO : bug to fix in lexer.c
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
/* By: lperrey <lperrey@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2021/10/19 08:38:55 by lperrey #+# #+# */
|
||||
/* Updated: 2021/10/19 20:11:31 by lperrey ### ########.fr */
|
||||
/* Updated: 2021/10/24 19:53:40 by lperrey ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -43,6 +43,8 @@ t_token *input_to_tokens(char *input)
|
||||
return (t_head);
|
||||
}
|
||||
|
||||
// TODO : Fix final space saved after a pipe like in "cmd | "
|
||||
// "cmd | " should behave like "cmd |"
|
||||
static int tokenize_input(t_token *t, char *input, size_t input_len)
|
||||
{
|
||||
int i;
|
||||
@@ -63,8 +65,10 @@ static int tokenize_input(t_token *t, char *input, size_t input_len)
|
||||
t_i = 0;
|
||||
}
|
||||
}
|
||||
if (!t->id)
|
||||
if (!t->id && t_i) // Fix parser syntax, but last elem must still be free
|
||||
t->id = T_WORD;
|
||||
/* if (!t->id)
|
||||
t->id = T_WORD; */
|
||||
return (1);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user