srcs/execution/var_declaration.c
void        parse_var_declaration(t_cmd *cmd, t_list **tk, t_env *env)
{
    t_list  *tkn;
    t_env   *new;

    tkn = cmd->token;
    new = NULL;
    while (tkn)
    {
        if (handle_logic(tkn, env, &new))
        {
            *tk = tkn;
            return ;
        }
        tkn = tkn->next;
    }
    ft_lstclear(&cmd->token, &free);
    cmd->token = NULL;
    *tk = NULL;
    env_add_back(&env, new);
}
/*
** If var is already in env list the value is always changed
*/
If var is already in env list the value is always changed
If var is already in env list the value is always changed
void        parse_var_declaration(t_cmd *cmd, t_list **tk, t_env *env)
{
    t_list  *tkn;
    t_env   *new;
    tkn = cmd->token;
    new = NULL;
    while (tkn)
    {
        if (handle_logic(tkn, env, &new))
        {
            *tk = tkn;
            return ;
        }
        tkn = tkn->next;
    }
    ft_lstclear(&cmd->token, &free);
    cmd->token = NULL;
    *tk = NULL;
    env_add_back(&env, new);
}
void parse_var_declaration ( t_cmd * cmd , t_list * * tk , t_env * env ) { t_list * tkn ; t_env * new ; tkn = cmd -> token ; new = NULL ; while ( tkn ) { if ( handle_logic ( tkn , env , & new ) ) { * tk = tkn ; return ; } tkn = tkn -> next ; } ft_lstclear ( & cmd -> token , & free ) ; cmd -> token = NULL ; * tk = NULL ; env_add_back ( & env , new ) ; }
If var is already in env list the value is always changed
If var is already in env list the value is always changed