aboutsummaryrefslogtreecommitdiff
path: root/src/lexer/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lexer/utils.c')
-rw-r--r--src/lexer/utils.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/src/lexer/utils.c b/src/lexer/utils.c
index 624b460..0d8080c 100644
--- a/src/lexer/utils.c
+++ b/src/lexer/utils.c
@@ -6,13 +6,13 @@
/* By: nahaddac <nahaddac@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/07/16 08:18:15 by nahaddac #+# #+# */
-/* Updated: 2020/10/09 15:24:31 by cacharle ### ########.fr */
+/* Updated: 2020/10/10 08:38:46 by cacharle ### ########.fr */
/* */
/* ************************************************************************** */
#include "lexer.h"
-enum e_tok tok_assign_tag(char *content)
+enum e_tok tok_assign_tag(char *content)
{
if (content[0] == ';')
return (TAG_END);
@@ -41,9 +41,9 @@ enum e_tok tok_assign_tag(char *content)
** a la fin (char *)tk->tok ne figure pas d'espace.
*/
-enum e_tok tok_assign_stick(t_tok_lst *tok)
+static enum e_tok st_tok_assign_stick(t_tok_lst *tok)
{
- int i;
+ int i;
i = ft_strlen(tok->content);
if (i > 0 && ft_isblank(tok->content[i - 1]))
@@ -57,7 +57,7 @@ enum e_tok tok_assign_stick(t_tok_lst *tok)
** \note the loop after ft_strpbrk is to search again if the quote was escaped
*/
-enum e_tok tok_assign_str(t_tok_lst *tok)
+enum e_tok tok_assign_str(t_tok_lst *tok)
{
char *found;
@@ -70,20 +70,15 @@ enum e_tok tok_assign_str(t_tok_lst *tok)
tok->tag = TAG_STR_SINGLE;
else if (*found == '"')
tok->tag = TAG_STR_DOUBLE;
- return (tok_assign_stick(tok));
+ return (st_tok_assign_stick(tok));
}
-int lexer_sep(char c)
-{
- return (ft_strchr(";&|><()", c) != NULL);
-}
-
-int lexer_space(char *input)
+int lexer_space(char *input)
{
return (ft_strspn(input, " \t"));
}
-int quote_len(char *input, int i)
+int quote_len(char *input, int i)
{
char quote_type;