fix: ast_redir and ast_assignment accorded for every part
This commit is contained in:
parent
e0032dd991
commit
98d18eef7d
8 changed files with 39 additions and 22 deletions
|
|
@ -87,8 +87,8 @@ static void update_flags(char *stream, ssize_t i, struct token_info *info)
|
|||
{
|
||||
if (i == 0)
|
||||
{
|
||||
perror("Syntax error: word start with a '='");
|
||||
return;
|
||||
perror("Syntax error: word start with a '='");
|
||||
return;
|
||||
}
|
||||
else
|
||||
info->has_equal = true;
|
||||
|
|
@ -105,7 +105,7 @@ struct token *peek_token(struct lexer_context *ctx)
|
|||
|
||||
// Usefull to know if we are inside a quote or double quote
|
||||
enum lexing_mode lexing_mode = LEXER_NORMAL;
|
||||
struct token_info info = {true, 0};
|
||||
struct token_info info = { true, 0 };
|
||||
char *stream = ctx->end_previous_token;
|
||||
ssize_t i = 0;
|
||||
|
||||
|
|
@ -165,11 +165,10 @@ struct token *pop_token(struct lexer_context *ctx)
|
|||
|
||||
// Usefull to know if we are inside a quote or double quote
|
||||
enum lexing_mode lexing_mode = LEXER_NORMAL;
|
||||
struct token_info info = {true, 0};
|
||||
struct token_info info = { true, 0 };
|
||||
char *stream = ctx->end_previous_token;
|
||||
ssize_t i = 0;
|
||||
|
||||
|
||||
if (ctx->current_token != NULL && ctx->current_token->type == TOKEN_EOF)
|
||||
{
|
||||
// we reached end of input, frees all the token still allocated.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue