diff options
Diffstat (limited to 'src/parse/cmd_parse.c')
| -rwxr-xr-x | src/parse/cmd_parse.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/parse/cmd_parse.c b/src/parse/cmd_parse.c new file mode 100755 index 0000000..562cea3 --- /dev/null +++ b/src/parse/cmd_parse.c @@ -0,0 +1,31 @@ + + +#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((t_token *)rest->data); + ft_lstpush_back(&ast->cmd_argv, (void *)new); + } + return (ast); +} |
