2 Commits
2 changed files with 19 additions and 4 deletions
+1 -1
View File
@@ -16,7 +16,7 @@ printline(c);
// Also, there is many different types to help your program // Also, there is many different types to help your program
// work with many things: // work with many things:
int signedInteger; int signedInteger;
uint unsignedInteger uint unsignedInteger;
str string; str string;
bool boolean; bool boolean;
+18 -3
View File
@@ -1056,9 +1056,19 @@ fzl_walk_res_t walk(fzl_walker_t *walker, fzl_node_t *node)
if (res != FZL_SYMTABLE_RESULT_OK) if (res != FZL_SYMTABLE_RESULT_OK)
{ {
fzl_token_t *tok = node->var.identifier->token; fzl_token_t *tok = node->var.identifier->token;
snprintf(wlast_err, sizeof(wlast_err), if (res == FZL_SYMTABLE_RESULT_EXISTS)
"'%s': cannot store '%s' at %ld:%ld", tok->filename, {
(char *)tok->value, tok->ln, tok->cn); snprintf(wlast_err, sizeof(wlast_err),
"'%s': cannot redefine '%s' at %ld:%ld", tok->filename,
(char *)tok->value, tok->ln, tok->cn);
}
else
{
snprintf(wlast_err, sizeof(wlast_err),
"'%s': cannot store '%s' at %ld:%ld", tok->filename,
(char *)tok->value, tok->ln, tok->cn);
}
return (fzl_walk_res_t){.error = true, .error_msg = wlast_err}; return (fzl_walk_res_t){.error = true, .error_msg = wlast_err};
} }
@@ -1225,6 +1235,11 @@ int fzl_walk(fzl_walker_t *walker)
push_op(walker, FZL_OPCODE_RM_ENVTABLE); push_op(walker, FZL_OPCODE_RM_ENVTABLE);
fin_ctx(walker); fin_ctx(walker);
if (walker->ctx)
{
while (walker->ctx)
fin_ctx(walker);
}
if (result.error && !wlast_err[0]) if (result.error && !wlast_err[0])
snprintf(wlast_err, sizeof(wlast_err), "%s", result.error_msg); snprintf(wlast_err, sizeof(wlast_err), "%s", result.error_msg);