#include "exec/ast_eval.h" #include "exec/ast_exec_functions.h" static const exec_f exec_node_ltable[] = { [AST_LIST] = exec_ast_list, [AST_IF] = exec_ast_if, [AST_COMMAND] = exec_ast_command, [AST_LOGICAL] = exec_ast_logical, [AST_PIPELINE] = exec_ast_pipe, [AST_REDIRECTION] = exec_ast_redirection, [AST_WHILE] = exec_ast_while, [AST_ASSIGN] = exec_ast_assign, [AST_FOR] = exec_ast_for, [AST_SUBSHELL] = exec_ast_subshell }; int eval_ast(struct ast *ast) { if (!ast) { return SHELL_TRUE; } return exec_node_ltable[ast->type](ast); }