fix: review problems

This commit is contained in:
samsonium
2026-10-27 15:40:25 +03:00
parent c61322718d
commit dc80de66e4
21 changed files with 197 additions and 179 deletions
+3 -5
View File
@@ -4,8 +4,6 @@
#include <compiler/fzl_token.h>
#include <stdio.h>
char cond_problem[256];
// Analyze conditional statement
fzl_an_res_t analyze_conditional(fzl_analyzer_t *analyzer, fzl_node_t *cond)
{
@@ -14,7 +12,7 @@ fzl_an_res_t analyze_conditional(fzl_analyzer_t *analyzer, fzl_node_t *cond)
if (!cond || cond->type != FZL_NODETYPE_CONDITIONAL)
{
an_push_error(analyzer, NULL, "provided node is not typeof CONDITIONAL");
an_push_error(analyzer, NULL, "provided node is a condition");
return (fzl_an_res_t){.error = true};
}
@@ -37,9 +35,9 @@ fzl_an_res_t analyze_conditional(fzl_analyzer_t *analyzer, fzl_node_t *cond)
if (cond->cond.condition->token->type == FZL_TOKTYPE_BOOL_LITERAL)
{
snprintf(cond_problem, sizeof(cond_problem), "condition is always %s",
snprintf(an_problem, sizeof(an_problem), "condition is always %s",
(char *)cond->cond.condition->token->value);
an_push_warning(analyzer, cond->cond.condition->token, cond_problem);
an_push_warning(analyzer, cond->cond.condition->token, an_problem);
}
return (fzl_an_res_t){.error = false, .type = FZL_TYPE_NULL};