diff options
| author | nass1pro <nass1pro@gmail.com> | 2020-06-12 10:12:03 +0200 |
|---|---|---|
| committer | nass1pro <nass1pro@gmail.com> | 2020-06-13 11:41:10 +0200 |
| commit | 3136f59540a8dd29e2f096be5a8943e2ddd28431 (patch) | |
| tree | a09705901c5a090f484845f157066f017c79a873 /test_mini/lexer_utils.c | |
| parent | c4c60ea0f74fc593b0181e1fc8c71c27f0497180 (diff) | |
| download | minishell-3136f59540a8dd29e2f096be5a8943e2ddd28431.tar.gz minishell-3136f59540a8dd29e2f096be5a8943e2ddd28431.tar.bz2 minishell-3136f59540a8dd29e2f096be5a8943e2ddd28431.zip | |
Finking quote resolved
Diffstat (limited to 'test_mini/lexer_utils.c')
| -rw-r--r-- | test_mini/lexer_utils.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/test_mini/lexer_utils.c b/test_mini/lexer_utils.c index d7fe8f4..19a6923 100644 --- a/test_mini/lexer_utils.c +++ b/test_mini/lexer_utils.c @@ -10,7 +10,7 @@ enum e_token_tag ret_token_sep_redir_append(char *input, int i) } -enum e_token_tag ret_token_sep(char *input, int i) +enum e_token_tag ret_token(char *input, int i) { if (input[i] == ';') return(LTAG_AND); @@ -24,7 +24,10 @@ enum e_token_tag ret_token_sep(char *input, int i) return(ret_token_sep_redir_append(input,i)); if (input[i] == '<') return(LTAG_REDIR_IN); - + if (input[i] == '(') + return(LTAG_PARENT_OPEN); + if (input[i] == ')') + return(LTAG_PARENT_CLOSE); return(0); } @@ -66,23 +69,20 @@ static int lex_verif_simple_cote(char *input, int i) break; } if (input[i + 1] == ' ') - while(input[i] == ' ') + while(input[i + 1] == ' ') i++; return(i + 1); } + int lexer_verif_entre_cote(char *input, int i) { if(input[i] == '\'') return(lex_verif_simple_cote(input, i)); i++; while(input[i] != '"' && (input[i] != '\0')) - { ++i; - if (input[i] == '\'') - break; - } if (input[i + 1] == ' ') - while(input[i] == ' ') + while(input[i + 1] == ' ') i++; return(i + 1); } |
