diff options
Diffstat (limited to 'src/analyze.c')
-rw-r--r-- | src/analyze.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/analyze.c b/src/analyze.c new file mode 100644 index 0000000..6efd60f --- /dev/null +++ b/src/analyze.c @@ -0,0 +1,15 @@ +/* SPDX-License-Identifier: copyleft-next-0.3.1 */ +/* Copyright 2024 Kim Kuparinen < kimi.h.kuparinen@gmail.com > */ + +#include <fwd/analyze.h> +#include <assert.h> + +int analyze_root(struct scope *scope, struct ast *root) +{ + foreach_node(node, root) { + assert(node->k == AST_PROC_DEF); + scope_add_proc(scope, node); + } + + return 0; +} |