aboutsummaryrefslogtreecommitdiff
path: root/src/lexer
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2020-09-17 11:21:54 +0200
committerCharles Cabergs <me@cacharle.xyz>2020-09-17 11:21:54 +0200
commit82c2d94a6513256f9173ff62439e70d3a0b25582 (patch)
tree7ba447e2438777ac00610d04b3cbd0ba3b4e804a /src/lexer
parent46c7f91cdceef0d5dd801ac569fb5d0c76b711aa (diff)
downloadminishell-82c2d94a6513256f9173ff62439e70d3a0b25582.tar.gz
minishell-82c2d94a6513256f9173ff62439e70d3a0b25582.tar.bz2
minishell-82c2d94a6513256f9173ff62439e70d3a0b25582.zip
Added lexer spliting ';;', separator string lookup table in parser for error message
Diffstat (limited to 'src/lexer')
-rw-r--r--src/lexer/lexer.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/lexer/lexer.c b/src/lexer/lexer.c
index 7a39373..4d5e3b1 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/09/16 20:17:10 by charles ### ########.fr */
+/* Updated: 2020/09/17 10:59:13 by charles ### ########.fr */
/* */
/* ************************************************************************** */
@@ -55,7 +55,7 @@ int tok_len(char *input)
return (i + 1);
if (lexer_sep(input[i]))
{
- if (input[i] == input[i + 1])
+ if (input[i] != ';' && input[i] == input[i + 1])
i++;
return (i + 1 + lexer_space(&input[i + 1]));
}
@@ -105,22 +105,22 @@ t_tok_lst *create_token_list(char *input, t_tok_lst **lst)
int lexer(char *input, t_tok_lst **out)
{
int status;
- t_tok_lst *curr;
+ /* t_tok_lst *curr; */
if (!input)
return (2);
*out = NULL;
*out = create_token_list(input, out);
status = lexer_trim(*out);
- curr = *out;
- while (curr != NULL)
- {
- if (!(curr->tag & TAG_IS_STR))
- {
- free(curr->content);
- curr->content = NULL;
- }
- curr = curr->next;
- }
+ /* curr = *out; */
+ /* while (curr != NULL) */
+ /* { */
+ /* if (!(curr->tag & TAG_IS_STR)) */
+ /* { */
+ /* free(curr->content); */
+ /* curr->content = NULL; */
+ /* } */
+ /* curr = curr->next; */
+ /* } */
return (status);
}