diff options
Diffstat (limited to 'src/parse/cmd_parse.c')
| -rw-r--r-- | src/parse/cmd_parse.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/parse/cmd_parse.c b/src/parse/cmd_parse.c index 78ce593..07070a1 100644 --- a/src/parse/cmd_parse.c +++ b/src/parse/cmd_parse.c @@ -1,3 +1,30 @@ #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 *parse_cmd(t_ast *ast, t_ftlst *rest) +{ + t_ftlst *new; + + new = rest->data; + if (ast == NULL) + { + ast = ast_new(AST_CMD); + ast->cmd_argv = ft_lstnew((t_token *)rest->data); + } + else + { + new = ft_lstnew(rest->data); + ft_lstpush_back(&ast->cmd_argv, (void *)new); + } + return (ast); +} |
