aboutsummaryrefslogtreecommitdiff
path: root/src/ast.c
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2025-01-21 20:32:39 +0200
committerKimplul <kimi.h.kuparinen@gmail.com>2025-01-21 20:32:39 +0200
commite8f78907830c525dccf1f4a5e6f97a15780c54ef (patch)
tree616bf72243e22cfb034cf2fab4bb99a927db61da /src/ast.c
parent284be00c81407735cc8ddec1f1353b867b2deffd (diff)
downloadek-e8f78907830c525dccf1f4a5e6f97a15780c54ef.tar.gz
ek-e8f78907830c525dccf1f4a5e6f97a15780c54ef.zip
add type visibility checks
+ Essentially require that each type used in a public symbol only use types that are exported out of the file as well
Diffstat (limited to 'src/ast.c')
-rw-r--r--src/ast.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/ast.c b/src/ast.c
index c7f32a0..5561745 100644
--- a/src/ast.c
+++ b/src/ast.c
@@ -149,6 +149,17 @@ void ast_set_flags(struct ast *node, enum ast_flags flags)
node->f |= flags;
}
+static int _ast_set_flags(struct ast *node, enum ast_flags *flags)
+{
+ ast_set_flags(node, *flags);
+ return 0;
+}
+
+void ast_set_flags_recurse(struct ast *node, enum ast_flags flags)
+{
+ ast_visit((ast_callback_t)_ast_set_flags, NULL, node, &flags);
+}
+
void ast_clear_flags(struct ast *node, enum ast_flags flags)
{
node->f &= ~(flags);