Skip to content

Commit

Permalink
impl validator scopes
Browse files Browse the repository at this point in the history
  • Loading branch information
omdxp committed Sep 9, 2024
1 parent 6c8b277 commit a1cf0f4
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions validator.c
Original file line number Diff line number Diff line change
@@ -1,11 +1,31 @@
#include "compiler.h"
#include "helpers/vector.h"

static struct compile_process *validator_current_compile_process;
static struct node *current_function;

void validation_new_scope(int flags) {
resolver_default_new_scope(validator_current_compile_process->resolver,
flags);
}

void validation_finish_scope() {
resolver_default_finish_scope(validator_current_compile_process->resolver);
}

struct node *validation_next_tree_node() {
return vector_peek_ptr(validator_current_compile_process->node_tree_vec);
}

void validate_init(struct compile_process *process) {
// TODO: Implement
validator_current_compile_process = process;
vector_set_peek_pointer(process->node_tree_vec, 0);
symresolver_new_table(process);
}

void validate_destroy(struct compile_process *process) {
// TODO: Implement
symresolver_end_table(process);
vector_set_peek_pointer(process->node_tree_vec, 0);
}

int validate_tree() { return VALIDATION_ALL_OK; }
Expand Down

0 comments on commit a1cf0f4

Please sign in to comment.