From 72ee131562574c4a6cb69800cdd81268b52ace84 Mon Sep 17 00:00:00 2001 From: nass1pro Date: Sun, 14 Jun 2020 17:31:01 +0200 Subject: Change file cmd --- src/parse/cmd_parse.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'src/parse/cmd_parse.c') 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); +} -- cgit