diff options
Diffstat (limited to 'src/lexer/trim.c')
| -rw-r--r-- | src/lexer/trim.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/lexer/trim.c b/src/lexer/trim.c index 6c435d5..f47aa6d 100644 --- a/src/lexer/trim.c +++ b/src/lexer/trim.c @@ -1,6 +1,25 @@ #include "lexer.h" +t_ftlst *stick_parent(t_ftlst *lst) +{ + t_ftlst *first; + t_token *tk; + + first = lst; + while (lst != NULL) + { + tk = lst->data; + if (tk->tag & TAG_PARENT_OPEN || tk->tag & TAG_PARENT_CLOSE) + { + if (ft_strlen(tk->content) >= 2) + tk->tag = tk->tag | TAG_STICK; + } + lst = lst->next; + } + return (first); +} + char *del_space(t_token *tk) { int i; @@ -64,5 +83,5 @@ t_ftlst *lexe_trim_out(t_ftlst *lst) } lst = lst->next; } - return (first); + return (stick_parent(first)); } |
