feat: implement extern block analyzer

This commit is contained in:
samsonium
2026-10-31 01:58:10 +03:00
parent 5c96f96220
commit a4aa220cfa
16 changed files with 197 additions and 27 deletions
+10 -1
View File
@@ -4,6 +4,7 @@
#include <compiler/fzl_token.h>
#include <compiler/internals/analyzer.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
// Analyzer main function
@@ -15,6 +16,14 @@ fzl_an_res_t analyze_common(fzl_analyzer_t *analyzer, fzl_node_t *node)
fzl_an_res_t res = {.error = false, .type = FZL_TYPE_NULL, .classname = NULL};
switch (node->type)
{
case FZL_NODETYPE_EXTERN:
res = analyze_extern(analyzer, node);
break;
case FZL_NODETYPE_EXTERN_FN:
res = analyze_externfn(analyzer, node);
break;
case FZL_NODETYPE_REFERENCE:
res = analyze_ref(analyzer, node);
break;
@@ -24,7 +33,7 @@ fzl_an_res_t analyze_common(fzl_analyzer_t *analyzer, fzl_node_t *node)
break;
case FZL_NODETYPE_ALIAS:
res.type = an_toktotype(node->token);
res.type = an_toktotype(analyzer, node->token, NULL);
break;
case FZL_NODETYPE_HANDLE: