summaryrefslogtreecommitdiff
path: root/42sh/src/exec/ast_eval.h
blob: 785df5add7f2df47068d9317e108db085f67f4e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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 */