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
// work with many things:
int signedInteger;
uint unsignedInteger
uint unsignedInteger;
str string;
bool boolean;
+15
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)
{
fzl_token_t *tok = node->var.identifier->token;
if (res == FZL_SYMTABLE_RESULT_EXISTS)
{
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};
}
@@ -1225,6 +1235,11 @@ int fzl_walk(fzl_walker_t *walker)
push_op(walker, FZL_OPCODE_RM_ENVTABLE);
fin_ctx(walker);
if (walker->ctx)
{
while (walker->ctx)
fin_ctx(walker);
}
if (result.error && !wlast_err[0])
snprintf(wlast_err, sizeof(wlast_err), "%s", result.error_msg);