Compare commits
2
Commits
c7cce94119
...
73a2a50a0b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
73a2a50a0b | ||
|
|
4a366cb0ac |
@@ -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;
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
|
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),
|
snprintf(wlast_err, sizeof(wlast_err),
|
||||||
"'%s': cannot store '%s' at %ld:%ld", tok->filename,
|
"'%s': cannot store '%s' at %ld:%ld", tok->filename,
|
||||||
(char *)tok->value, tok->ln, tok->cn);
|
(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);
|
||||||
|
|||||||
Reference in New Issue
Block a user