aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2020-06-14 10:36:53 +0200
committerCharles <sircharlesaze@gmail.com>2020-06-14 10:36:53 +0200
commit26ddbd7146f65a2cf100713f422a9ab5b1890620 (patch)
tree76daa703ee5ea4c3eafcbce0f8127ab5c92983ab /src
parentab1e32c348c649c1c7c8dad5922cfe1c0f11ac5d (diff)
downloadminishell-26ddbd7146f65a2cf100713f422a9ab5b1890620.tar.gz
minishell-26ddbd7146f65a2cf100713f422a9ab5b1890620.tar.bz2
minishell-26ddbd7146f65a2cf100713f422a9ab5b1890620.zip
Changing ast related struct and fixing functions accordingly
Diffstat (limited to 'src')
-rw-r--r--src/ast.c29
-rw-r--r--src/eval/eval.c300
-rw-r--r--src/eval/pipe.c60
-rw-r--r--src/main.c109
-rw-r--r--src/parse/parse.c10
-rw-r--r--src/preprocess.c14
6 files changed, 271 insertions, 251 deletions
diff --git a/src/ast.c b/src/ast.c
index 4c66fa7..98ca4ac 100644
--- a/src/ast.c
+++ b/src/ast.c
@@ -6,7 +6,7 @@
/* By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/04/01 17:05:42 by charles #+# #+# */
-/* Updated: 2020/05/04 12:00:20 by charles ### ########.fr */
+/* Updated: 2020/06/14 10:29:21 by charles ### ########.fr */
/* */
/* ************************************************************************** */
@@ -20,25 +20,22 @@
/*
** \brief Create a new AST node according to `tag`
** \param tag Tag of node
-** \param data Pointer to node data (t_cmd or t_line)
-** which will be copied in ast::data union
** \return Created node or NULL on error
*/
-t_ast *ast_new(t_ast_tag tag, void *data)
+t_ast *ast_new(enum e_ast_tag tag)
{
t_ast *ast;
- if (data == NULL)
- return (NULL);
if ((ast = (t_ast*)malloc(sizeof(t_ast))) == NULL)
return (NULL);
- ft_bzero(ast, sizeof(t_ast));
ast->tag = tag;
- if (tag == TAG_CMD)
- ft_memcpy(&ast->cmd, (t_cmd*)data, sizeof(t_cmd));
- else if (tag == TAG_LINE)
- ft_memcpy(&ast->line, (t_line*)data, sizeof(t_line));
+ ast->in = NULL;
+ ast->out = NULL;
+ ast->is_append = false;
+ ast->line.left = NULL;
+ ast->line.right = NULL;
+ ast->cmd_argv = NULL;
return (ast);
}
@@ -51,13 +48,13 @@ void ast_destroy(t_ast *ast)
{
if (ast == NULL)
return ;
- if (ast->tag == TAG_CMD)
+ if (ast->tag == AST_CMD)
{
- ft_split_destroy(ast->cmd.argv);
- free(ast->cmd.in);
- free(ast->cmd.out);
+ ft_lstdestroy(&ast->cmd_argv, (void (*)(void*))token_destroy);
+ ft_lstdestroy(&ast->in, (void (*)(void*))token_destroy);
+ ft_lstdestroy(&ast->out, (void (*)(void*))token_destroy);
}
- else if (ast->tag == TAG_LINE)
+ else if (ast->tag == AST_LINE)
{
ast_destroy(ast->line.left);
ast_destroy(ast->line.right);
diff --git a/src/eval/eval.c b/src/eval/eval.c
index c4df1c9..1e0a8d7 100644
--- a/src/eval/eval.c
+++ b/src/eval/eval.c
@@ -6,156 +6,156 @@
/* By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/04/01 17:05:21 by charles #+# #+# */
-/* Updated: 2020/05/15 00:12:51 by charles ### ########.fr */
+/* Updated: 2020/06/14 10:34:11 by charles ### ########.fr */
/* */
/* ************************************************************************** */
-/*
-** \file eval.c
-** \brief Evaluation of an AST
-*/
-
-#include "eval.h"
-
-/*
-** \brief Wrap a function in a fork
-** \param fd_in fork input file descriptor
-** \param fd_out fork output file descriptor
-** \param passed param of the wrapped function
-** \param wrapped function to wrap
-*/
-
-int fork_wrap(
- int fd_in,
- int fd_out,
- void *passed,
- int (*wrapped)(void *param))
-{
- int status;
- pid_t child_pid;
-
- if ((child_pid = fork()) == -1)
- return (-1);
- if (child_pid == 0)
- {
- if (dup2(STDIN_FILENO, fd_in) == -1 ||
- dup2(STDOUT_FILENO, fd_out) == -1)
- exit(EXIT_FAILURE);
- if ((status = wrapped(passed)) == -1)
- exit(EXIT_FAILURE);
- exit(status);
- }
- wait(&child_pid);
- return (WEXITSTATUS(child_pid));
-}
-
-int run_builtin(t_eval_state *state, char **argv)
-{
- return (builtin_dispatch_run(argv, state->env));
-}
-
-/*
-** \brief execve syscall wrapper passed it to fork_wrap
-** \param param function params
-** \return execve return value
-*/
-
-int execve_wrapper(void *param)
-{
- return (execve(
- ((t_fork_param_execve*)param)->exec_path,
- ((t_fork_param_execve*)param)->argv,
- ((t_fork_param_execve*)param)->envp
- ));
-}
-
-/*
-** \brief Evaluate a command
-** \param state Evaluation state
-** \param cmd Command to evaluate
-** \return Executable status or -1 on error
-*/
-
-static int eval_cmd(int fd_in, int fd_out, t_eval_state *state, t_cmd *cmd)
-{
- t_fork_param_execve param;
-
- if (builtin_check_exec_name(cmd->argv[0]))
- return (run_builtin(state, cmd->argv));
- param.exec_path = exec_search_path(
- state->path, env_search(state->env, "PATH"), cmd->argv[0]);
- if (param.exec_path == NULL)
- return (-1);
- if (cmd->in != NULL && (fd_in = open(cmd->in, O_RDONLY)) == -1)
- return (-1);
- if (cmd->out != NULL && (fd_out = open(cmd->out,
- (cmd->is_append ? O_APPEND : O_WRONLY) | O_CREAT)) == -1)
- return (-1);
- param.argv = cmd->argv;
- param.envp = (char**)state->env->data;
- return (fork_wrap(fd_in, fd_out, &param, &execve_wrapper));
-}
-
-/*
-** \brief Evaluate a line
-** \param state State of the evaluation
-** \param line Line to evaluate
-** \return Last Executed command status or -1 on error
-*/
-
-static int eval_line(void *param)
-{
- int status;
- t_eval_state *state;
- t_line *line;
- int fd_in;
- int fd_out;
-
- state = ((t_fork_param_line*)param)->state;
- line = ((t_fork_param_line*)param)->line;
- fd_in = ((t_fork_param_line*)param)->fd_in;
- fd_out = ((t_fork_param_line*)param)->fd_out;
-
- /* if (line->right == NULL) */
- /* return (eval(state, line->left)); */
-
- /* if (line->sep == SEP_PIPE) */
- /* pipe(state->p); */
-
- if (line->left->tag == TAG_LINE)
- {
- return (fork_wrap(fd_in, fd_out, param, &eval_line));
- }
- if ((status = eval(fd_in, fd_out, state, line->left)) == -1)
- return (-1);
- if ((line->sep == SEP_AND && status != 0) ||
- (line->sep == SEP_OR && status == 0))
- return (status);
-
- return (eval(fd_in, fd_out, state, line->right));
-}
-
-/*
-** \brief Evaluate an AST
-** \param state State of the evaluation
-** \param ast Abstract syntax tree to evaluate
-** \return Last command status or -1 on error
-*/
-
-int eval(int fd_in, int fd_out, t_eval_state *state, t_ast *ast)
-{
- t_fork_param_line param;
-
- errno = 0;
- if (ast->tag == TAG_LINE)
- {
- param.state = state;
- param.line = &ast->line;
- param.fd_in = fd_in;
- param.fd_out = fd_out;
- return (eval_line(&param));
- }
- if (ast->tag == TAG_CMD)
- return (eval_cmd(fd_in, fd_out, state, &ast->cmd));
- return (-1);
-}
+/* #<{(| */
+/* ** \file eval.c */
+/* ** \brief Evaluation of an AST */
+/* |)}># */
+/* */
+/* #include "eval.h" */
+/* */
+/* #<{(| */
+/* ** \brief Wrap a function in a fork */
+/* ** \param fd_in fork input file descriptor */
+/* ** \param fd_out fork output file descriptor */
+/* ** \param passed param of the wrapped function */
+/* ** \param wrapped function to wrap */
+/* |)}># */
+/* */
+/* int fork_wrap( */
+/* int fd_in, */
+/* int fd_out, */
+/* void *passed, */
+/* int (*wrapped)(void *param)) */
+/* { */
+/* int status; */
+/* pid_t child_pid; */
+/* */
+/* if ((child_pid = fork()) == -1) */
+/* return (-1); */
+/* if (child_pid == 0) */
+/* { */
+/* if (dup2(STDIN_FILENO, fd_in) == -1 || */
+/* dup2(STDOUT_FILENO, fd_out) == -1) */
+/* exit(EXIT_FAILURE); */
+/* if ((status = wrapped(passed)) == -1) */
+/* exit(EXIT_FAILURE); */
+/* exit(status); */
+/* } */
+/* wait(&child_pid); */
+/* return (WEXITSTATUS(child_pid)); */
+/* } */
+/* */
+/* int run_builtin(t_eval_state *state, char **argv) */
+/* { */
+/* return (builtin_dispatch_run(argv, state->env)); */
+/* } */
+/* */
+/* #<{(| */
+/* ** \brief execve syscall wrapper passed it to fork_wrap */
+/* ** \param param function params */
+/* ** \return execve return value */
+/* |)}># */
+/* */
+/* int execve_wrapper(void *param) */
+/* { */
+/* return (execve( */
+/* ((t_fork_param_execve*)param)->exec_path, */
+/* ((t_fork_param_execve*)param)->argv, */
+/* ((t_fork_param_execve*)param)->envp */
+/* )); */
+/* } */
+/* */
+/* #<{(| */
+/* ** \brief Evaluate a command */
+/* ** \param state Evaluation state */
+/* ** \param cmd Command to evaluate */
+/* ** \return Executable status or -1 on error */
+/* |)}># */
+/* */
+/* static int eval_cmd(int fd_in, int fd_out, t_eval_state *state, t_cmd *cmd) */
+/* { */
+/* t_fork_param_execve param; */
+/* */
+/* if (builtin_check_exec_name(cmd->argv[0])) */
+/* return (run_builtin(state, cmd->argv)); */
+/* param.exec_path = exec_search_path( */
+/* state->path, env_search(state->env, "PATH"), cmd->argv[0]); */
+/* if (param.exec_path == NULL) */
+/* return (-1); */
+/* if (cmd->in != NULL && (fd_in = open(cmd->in, O_RDONLY)) == -1) */
+/* return (-1); */
+/* if (cmd->out != NULL && (fd_out = open(cmd->out, */
+/* (cmd->is_append ? O_APPEND : O_WRONLY) | O_CREAT)) == -1) */
+/* return (-1); */
+/* param.argv = cmd->argv; */
+/* param.envp = (char**)state->env->data; */
+/* return (fork_wrap(fd_in, fd_out, &param, &execve_wrapper)); */
+/* } */
+/* */
+/* #<{(| */
+/* ** \brief Evaluate a line */
+/* ** \param state State of the evaluation */
+/* ** \param line Line to evaluate */
+/* ** \return Last Executed command status or -1 on error */
+/* |)}># */
+/* */
+/* static int eval_line(void *param) */
+/* { */
+/* int status; */
+/* t_eval_state *state; */
+/* t_line *line; */
+/* int fd_in; */
+/* int fd_out; */
+/* */
+/* state = ((t_fork_param_line*)param)->state; */
+/* line = ((t_fork_param_line*)param)->line; */
+/* fd_in = ((t_fork_param_line*)param)->fd_in; */
+/* fd_out = ((t_fork_param_line*)param)->fd_out; */
+/* */
+/* #<{(| if (line->right == NULL) |)}># */
+/* #<{(| return (eval(state, line->left)); |)}># */
+/* */
+/* #<{(| if (line->sep == SEP_PIPE) |)}># */
+/* #<{(| pipe(state->p); |)}># */
+/* */
+/* if (line->left->tag == AST_LINE) */
+/* { */
+/* return (fork_wrap(fd_in, fd_out, param, &eval_line)); */
+/* } */
+/* if ((status = eval(fd_in, fd_out, state, line->left)) == -1) */
+/* return (-1); */
+/* if ((line->sep == SEP_AND && status != 0) || */
+/* (line->sep == SEP_OR && status == 0)) */
+/* return (status); */
+/* */
+/* return (eval(fd_in, fd_out, state, line->right)); */
+/* } */
+/* */
+/* #<{(| */
+/* ** \brief Evaluate an AST */
+/* ** \param state State of the evaluation */
+/* ** \param ast Abstract syntax tree to evaluate */
+/* ** \return Last command status or -1 on error */
+/* |)}># */
+/* */
+/* int eval(int fd_in, int fd_out, t_eval_state *state, t_ast *ast) */
+/* { */
+/* t_fork_param_line param; */
+/* */
+/* errno = 0; */
+/* if (ast->tag == TAG_LINE) */
+/* { */
+/* param.state = state; */
+/* param.line = &ast->line; */
+/* param.fd_in = fd_in; */
+/* param.fd_out = fd_out; */
+/* return (eval_line(&param)); */
+/* } */
+/* if (ast->tag == TAG_CMD) */
+/* return (eval_cmd(fd_in, fd_out, state, &ast->cmd)); */
+/* return (-1); */
+/* } */
diff --git a/src/eval/pipe.c b/src/eval/pipe.c
deleted file mode 100644
index 125c013..0000000
--- a/src/eval/pipe.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* pipe.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2020/04/01 17:05:58 by charles #+# #+# */
-/* Updated: 2020/04/01 17:05:59 by charles ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-/*
-** \file pipe.c
-** \brief Pipes setup
-*/
-
-#include "eval.h"
-
-/*
-** \brief Setup STDIN and STDOUT pipe in the parent process
-** \param cmd Command to setup
-** \param pipe_in STDIN pipe
-** \param pipe_out STDOUT pipe
-** \return -1 on error, 0 otherwise
-*/
-
-int pipe_setup_parent(t_cmd *cmd, int pipe_in[2], int pipe_out[2])
-{
- if (cmd->in != NULL)
- {
- if ((pipe_in[PIPE_WRITE] = open(cmd->in, O_RDONLY)) < 0)
- return (-1);
- }
- if (cmd->out != NULL)
- {
- if ((pipe_out[PIPE_READ] = open(cmd->out,
- (cmd->is_append ? O_WRONLY : O_APPEND) | O_CREAT)) < 0)
- return (-1);
- }
- return (0);
-}
-
-/*
-** \brief Setup STDIN and STDOUT pipe in the child process
-** \param pipe_in STDIN pipe
-** \param pipe_out STDOUT pipe
-** \return -1 on error, 0 otherwise
-*/
-
-int pipe_setup_child(int pipe_in[2], int pipe_out[2])
-{
- if (pipe_in[PIPE_READ] != PIPE_CLOSED)
- if (dup2(STDIN_FILENO, pipe_in[PIPE_READ]) == -1)
- return (-1);
- if (pipe_out[PIPE_WRITE] != PIPE_CLOSED)
- if (dup2(STDOUT_FILENO, pipe_out[PIPE_WRITE]) == -1)
- return (-1);
- return (0);
-}
diff --git a/src/main.c b/src/main.c
index c426f74..5d3e9d8 100644
--- a/src/main.c
+++ b/src/main.c
@@ -6,7 +6,7 @@
/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/02/28 11:45:44 by cacharle #+# #+# */
-/* Updated: 2020/06/13 11:56:27 by charles ### ########.fr */
+/* Updated: 2020/06/14 10:36:06 by charles ### ########.fr */
/* */
/* ************************************************************************** */
@@ -20,20 +20,103 @@
#include "lexer.h"
#include "parser.h"
+int main(int argc, char **argv, char **envp)
+{
+ (void)argc;
+ (void)argv;
+ /* (void)envp; */
+ /* t_path path; */
+ t_env env;
+ /* char *line; */
+ /* int ret; */
+ env = env_from_array(envp);
+ /* path = path_update(NULL, env_search(env, "PATH")); */
+ /* */
+ /* t_ast *ast; */
+ /* t_line line; */
+ /* t_cmd cmd; */
+ /* t_eval_state state; */
+ /* */
+ /* cmd.argv = ft_split("ls -l", ' '); */
+ /* cmd.in = NULL; */
+ /* cmd.out = NULL; */
+ /* cmd.is_append = false; */
+ /* */
+ /* line.left = ast_new(TAG_CMD, &cmd); */
+ /* line.right = NULL; */
+ /* line.sep = SEP_END; */
+ /* ast = ast_new(TAG_LINE, &line); */
+ /* printf("%p\n", ast); */
+ /* printf("%d\n", ast->tag); */
+ /* printf("%p\n", ast->data.line.left); */
+ /* printf("%p\n", ast->data.line.right); */
+ /* printf("%d\n", ast->data.line.left->tag); */
+ /* printf("%p\n", ast->data.line.left->data.cmd.argv); */
+ /* printf("%s\n", ast->data.line.left->data.cmd.argv[0]); */
+ /* printf("%s\n", ast->data.line.left->data.cmd.argv[1]); */
+ /* state.pipe_in[0] = -1; */
+ /* state.pipe_in[1] = -1; */
+ /* state.pipe_out[0] = -1; */
+ /* state.pipe_out[1] = -1; */
+ /* state.path = path; */
+ /* state.env = env; */
+ /* t_io_frame frame; */
+ /* io_frame_init(&frame); */
+ /* printf("ret: %d %s\n", eval(&frame,&state, ast), strerror(errno)); */
+ /* char buf[2048]; */
+ /* printf("%s\n", getcwd(buf, 2048)); */
+ /* builtin_env(NULL, state.env); */
+ /* ast_destroy(ast); */
+ /* while ((ret = ft_next_line(STDIN_FILENO, &line)) == 1) */
+ /* { */
+ /* if (eval(parse(line)) == -1) */
+ /* continue ; // and display error */
+ /* free(line); */
+ /* } */
+ /* free(line); */
+ /* ft_htdestroy(path, free); */
+ /* ms_glob("src#<{(|"); */
+ /* char *j = ms_glob("|)}>#*.c"); */
+ /* printf("%s\n", j); */
+ /* free(j); */
+ t_ftvec *v = ft_vecnew(32);
+ ft_vecpush(v, token_new(TAG_STR, "$TERM$LFS$TERM$TERM."));
+ ft_vecpush(v, token_new(TAG_STR, "$$LFS$TERM$TERM."));
+ ft_vecpush(v, token_new(TAG_STR, "*/*.c$TERM"));
+ ft_vecpush(v, token_new(TAG_STR, "src/*.c include/*.h"));
+ ft_vecpush(v, token_new(TAG_STR, "$A$B"));
+ ft_vecpush(v, token_new(TAG_STR, "\\$TERM"));
+ ft_vecpush(v, token_new(TAG_STR, "$TER\\M"));
+ ft_vecpush(v, token_new(TAG_STR, "\\\\"));
+ ft_vecpush(v, token_new(TAG_STR_SINGLE, "''''$TEST\\TEST"));
+ ft_vecpush(v, token_new(TAG_STR_DOUBLE, ",$TEST,$B,"));
+ ft_vecpush(v, token_new(TAG_STR_DOUBLE | TAG_STICK, "$TEST"));
+ ft_vecpush(v, token_new(TAG_STR_DOUBLE | TAG_STICK, "$TEST"));
+ ft_vecpush(v, token_new(TAG_STR_DOUBLE , "$TEST"));
+ ft_vecpush(v, token_new(TAG_STR_DOUBLE | TAG_STICK, "$TEST"));
+ ft_vecpush(v, token_new(TAG_STR_SINGLE, "$TEST"));
+ char **as = preprocess(v, env);
+ char **tmp = as;
+ while (*as != NULL)
+ puts(*as++);
+ ft_split_destroy(tmp);
+ ft_vecdestroy(env, free);
+ return (0);
+}
/////////////////////////////////////////////////////////////////////////////////////////
// lexer main
/////////////////////////////////////////////////////////////////////////////////////////
- int main(void)
- {
- char *input;
-
- if (!(input = malloc(sizeof(char) * ft_strlen(argv[1]) + 1)))
- return(0);
- ft_strlcpy(input, argv[1], ft_strlen(argv[1]) + 1);
-
- lexer(input);
- exit(0);
- return (0);
- } */
+/* int main(void) */
+/* { */
+/* char *input; */
+/* */
+/* if (!(input = malloc(sizeof(char) * ft_strlen(argv[1]) + 1))) */
+/* return(0); */
+/* ft_strlcpy(input, argv[1], ft_strlen(argv[1]) + 1); */
+/* */
+/* lexer(input); */
+/* exit(0); */
+/* return (0); */
+/* } */
diff --git a/src/parse/parse.c b/src/parse/parse.c
index a240377..92797c8 100644
--- a/src/parse/parse.c
+++ b/src/parse/parse.c
@@ -3,17 +3,17 @@
** \brief Parser
*/
-#include "parse.h"
-#include <stdio.h>
+#include "parser.h"
+// stdio.h est deja include dans minishell.h temporairement
+// (comme ca on doit le retirer a un seul endroit a la fin)
-
-t_ret *parse(t_ftlst *lst)
+t_ret *parse(t_ftlst *input)
{
t_ret *ret;
if(!(ret = malloc(sizeof(t_ret) * 1)))
return(NULL);
- ret->rest = lst;
+ ret->rest = input;
return NULL;
}
diff --git a/src/preprocess.c b/src/preprocess.c
index 1034068..badf3cf 100644
--- a/src/preprocess.c
+++ b/src/preprocess.c
@@ -6,7 +6,7 @@
/* By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/04/03 08:58:49 by charles #+# #+# */
-/* Updated: 2020/06/12 11:57:17 by charles ### ########.fr */
+/* Updated: 2020/06/14 10:33:17 by charles ### ########.fr */
/* */
/* ************************************************************************** */
@@ -16,9 +16,9 @@
static bool st_escapable(char c, enum e_token_tag tag)
{
- if (tag & LTAG_STR)
+ if (tag & TAG_STR)
return (true);
- if ((tag & LTAG_STR_DOUBLE) && (c == '\\' || c == '"' || c == '$'))
+ if ((tag & TAG_STR_DOUBLE) && (c == '\\' || c == '"' || c == '$'))
return (true);
return (false);
}
@@ -91,7 +91,7 @@ static int st_splat_arg(t_ftvec *argv, int i)
j = 0;
while (strs[j] != NULL)
{
- if (ft_vecinsert_safe(argv, i + j, token_new(LTAG_STR, strs[j])) == NULL)
+ if (ft_vecinsert_safe(argv, i + j, token_new(TAG_STR, strs[j])) == NULL)
{
token_destroy(splated);
ft_split_destroy(strs);
@@ -122,10 +122,10 @@ char **preprocess(t_ftvec *argv, t_env env)
while (++i < argv->size)
{
token = argv->data[i];
- if (token->tag & LTAG_STR_SINGLE)
+ if (token->tag & TAG_STR_SINGLE)
continue ;
token->content = st_iterpolate_env(token->content, token->tag, env);
- if (token->tag & LTAG_STR)
+ if (token->tag & TAG_STR)
{
if (ft_strchr(token->content, '*') != NULL)
token->content = st_iterpolate_globs(token->content);
@@ -139,7 +139,7 @@ char **preprocess(t_ftvec *argv, t_env env)
while (++i < argv->size - 1)
{
token = argv->data[i];
- while (token->tag & LTAG_STICK && i + 1 < argv->size)
+ while (token->tag & TAG_STICK && i + 1 < argv->size)
{
next = argv->data[i + 1];
token->content = ft_strjoinf_fst(token->content, next->content);