blob: bdcb3abe0b6cd5cb5edf9ff7f129e9b4eca37578 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
#include "parser.h"
int parse_redir_true_false(enum e_token_tag tag)
{
if (tag & TAG_IS_REDIR)
return (1);
return (0);
}
t_ast *parse_redir(t_ast *ast, t_ftlst *rest)
{
t_ftlst *new;
new = rest->data;
if (ast == NULL)
{
ast = ast_new(AST_CMD);
ast->redirs = ft_lstnew((t_token *)rest->data);
}
else
{
new = ft_lstnew((t_token *)rest->data);
ft_lstpush_back(&ast->redirs, (void *)new);
}
return (ast);
}
|