diff options
author | c | 2023-12-24 10:28:00 -0500 |
---|---|---|
committer | c | 2023-12-24 10:28:00 -0500 |
commit | e39267c83a8af189a624891813ebd6014543b01a (patch) | |
tree | c6ad5a39246e4560f6efd77b9d2e4383394bbbf9 /src/include/tree.h | |
parent | 1494ecaeba2307e489b1df210abb3c63415419ed (diff) |
Proper tests.
Diffstat (limited to 'src/include/tree.h')
-rw-r--r-- | src/include/tree.h | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/src/include/tree.h b/src/include/tree.h index 20d97be..8b8e14a 100644 --- a/src/include/tree.h +++ b/src/include/tree.h @@ -4,15 +4,15 @@ #include "util.h" typedef enum TREE_TYPE { - TREE_TYPE_BLOCK, - TREE_TYPE_EXPR, - TREE_TYPE_LINT, - TREE_TYPE_LSTR, - TREE_TYPE_TAG, - TREE_TYPE_DARG, - TREE_TYPE_CARG, - TREE_TYPE_DEF, - TREE_TYPE_CALL, + TREE_TYPE_BLOCK, + TREE_TYPE_EXPR, + TREE_TYPE_LINT, + TREE_TYPE_LSTR, + TREE_TYPE_TAG, + TREE_TYPE_DARG, + TREE_TYPE_CARG, + TREE_TYPE_DEF, + TREE_TYPE_CALL, } tree_type_t; /* The Abstract Syntax Tree (AST) structure. */ @@ -86,6 +86,12 @@ tree_t* tree_init(int type); /* Destroy the AST. */ void tree_destroy(tree_t* tree); +/* + Compare two trees. For testing. + Returns 1 if the same, otherwise 0. +*/ +int tree_cmp(tree_t* tree_0, tree_t* tree_1); + /* Print a tree. */ void tree_print(tree_t* tree, int nest); |