blob: 15a505440c8bad4f492a25cec802da859f0d8199 (
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
28
|
#include "parser.h"
int parse_cmd_str_true_false(enum e_token_tag tag)
{
if (tag & TAG_STR || tag & TAG_STR_DOUBLE || tag & TAG_STR_SINGLE)
return (1);
return(0);
}
t_ast *push_cmd(t_ast *ast, t_ftlst *rest)
{
t_ftlst *new;
if (ast == NULL)
{
ast = ast_new(AST_CMD);
ast->cmd_argv = ft_lstnew((t_token *)rest->data);
}
else
{
new = ft_lstnew((t_token *)rest->data);
ft_lstpush_back(&ast->cmd_argv, new);
}
return (ast);
}
|