diff options
Diffstat (limited to '42sh/src/exec/ast_eval.h')
| -rw-r--r-- | 42sh/src/exec/ast_eval.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/42sh/src/exec/ast_eval.h b/42sh/src/exec/ast_eval.h new file mode 100644 index 0000000..785df5a --- /dev/null +++ b/42sh/src/exec/ast_eval.h @@ -0,0 +1,24 @@ +#ifndef AST_EVAL_H +#define AST_EVAL_H + +#include "ast/ast.h" + +/** + * @brief Shell true value, this is not the builtin true. + */ +#define SHELL_TRUE 0 + +/** + * @brief Shell false value, this is not the builtin false. + */ +#define SHELL_FALSE 1 + +/** + * @brief Returns the exit code of the given AST. + * @param ast The AST to evaluate. It is given as a `struct ast*` + * and uses an inheritance-like principle. + * An AST can be of any type from the `enum ast_node`. + */ +int eval_ast(struct ast *ast); + +#endif /* ! AST_EVAL_H */ |
