Closed Giromi closed 2 years ago
t_lx_token *pop_node(t_lx_token **cur_node, \
t_lx_token *start_node, t_lx_token *end_node)
{
if (_is_first_node(start_node))
{
*cur_node = end_node->next;
if (*cur_node == NULL)
return (start_node);
return (cut_front_node(*cur_node));
}
else if (_is_last_node(end_node))
{
*cur_node = start_node->prev;
return (cut_back_node(*cur_node));
}
else
{
// if (*cur_node == start_node || *cur_node == end_node)
// *cur_node = start_node->prev;
if (*cur_node == start_node || *cur_node == end_node)
*cur_node = end_node->next;
start_node->prev->next = end_node->next;
end_node->next->prev = start_node->prev;
start_node->prev = end_node;
end_node->next = NULL;
}
return (start_node);
}
pop_node else부분 수정 요망 end_prev를 가리켜야?
잘되는 상황
안되는 상황