fix: review problems
This commit is contained in:
@@ -4,8 +4,6 @@
|
||||
#include <compiler/utils/fzl_symtable.h>
|
||||
#include <stdio.h>
|
||||
|
||||
char class_problem[256];
|
||||
|
||||
// Analyze class declaration
|
||||
fzl_an_res_t analyze_class(fzl_analyzer_t *analyzer, fzl_node_t *class_node)
|
||||
{
|
||||
@@ -14,7 +12,7 @@ fzl_an_res_t analyze_class(fzl_analyzer_t *analyzer, fzl_node_t *class_node)
|
||||
|
||||
if (!class_node || class_node->type != FZL_NODETYPE_CLASS)
|
||||
{
|
||||
an_push_error(analyzer, NULL, "node is not typeof CLASS");
|
||||
an_push_error(analyzer, NULL, "node is not class");
|
||||
return (fzl_an_res_t){.error = true};
|
||||
}
|
||||
|
||||
@@ -38,15 +36,15 @@ fzl_an_res_t analyze_class(fzl_analyzer_t *analyzer, fzl_node_t *class_node)
|
||||
{
|
||||
if (res == FZL_SYMTABLE_RESULT_EXISTS)
|
||||
{
|
||||
snprintf(class_problem, sizeof(class_problem),
|
||||
snprintf(an_problem, sizeof(an_problem),
|
||||
"name '%s' already has been declared", classname);
|
||||
an_push_error(analyzer, class_node->token, class_problem);
|
||||
an_push_error(analyzer, class_node->token, an_problem);
|
||||
}
|
||||
else
|
||||
{
|
||||
snprintf(class_problem, sizeof(class_problem), "cannot store name '%s'",
|
||||
snprintf(an_problem, sizeof(an_problem), "cannot store name '%s'",
|
||||
classname);
|
||||
an_push_error(analyzer, class_node->token, class_problem);
|
||||
an_push_error(analyzer, class_node->token, an_problem);
|
||||
}
|
||||
|
||||
an_fin_ctx(analyzer);
|
||||
|
||||
Reference in New Issue
Block a user