This commit is contained in:
@ -1822,7 +1822,9 @@ static int compile_break (hcl_t* hcl, hcl_cnode_t* src)
|
||||
}
|
||||
}
|
||||
|
||||
hcl_setsynerrbfmt (hcl, HCL_SYNERR_BREAK, HCL_CNODE_GET_LOC(src), HCL_NULL, "%.*js outside loop", HCL_CNODE_GET_TOKLEN(cmd), HCL_CNODE_GET_TOKPTR(cmd));
|
||||
hcl_setsynerrbfmt (
|
||||
hcl, HCL_SYNERR_BREAK, HCL_CNODE_GET_LOC(src), HCL_NULL,
|
||||
"%.*js outside loop", HCL_CNODE_GET_TOKLEN(cmd), HCL_CNODE_GET_TOKPTR(cmd));
|
||||
return -1;
|
||||
|
||||
inside_loop:
|
||||
@ -1860,7 +1862,9 @@ inside_loop:
|
||||
|
||||
/* this part must no be reached. if a loop control block is found,
|
||||
* there must exist a COP_POST_UNTIL_BODY or COP_POST_WHILE_BODY frame */
|
||||
hcl_setsynerrbfmt (hcl, HCL_SYNERR_INTERN, HCL_CNODE_GET_LOC(src), HCL_NULL, "internal error in compiling %.*js", HCL_CNODE_GET_TOKLEN(cmd), HCL_CNODE_GET_TOKPTR(cmd));
|
||||
hcl_setsynerrbfmt (
|
||||
hcl, HCL_SYNERR_INTERN, HCL_CNODE_GET_LOC(src), HCL_NULL,
|
||||
"internal error in compiling %.*js", HCL_CNODE_GET_TOKLEN(cmd), HCL_CNODE_GET_TOKPTR(cmd));
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
14
lib/read.c
14
lib/read.c
@ -1251,7 +1251,7 @@ static int feed_process_token (hcl_t* hcl)
|
||||
}
|
||||
|
||||
concode = LIST_FLAG_GET_CONCODE(rstl->flagv);
|
||||
if (concode != HCL_CONCODE_XLIST) /* TODO: handle MLIST as weel if the other part is implemented */
|
||||
if (concode != HCL_CONCODE_XLIST) /* TODO: handle MLIST as well if the other part is implemented */
|
||||
{
|
||||
hcl_setsynerr (hcl, HCL_SYNERR_UNBALPBB, TOKEN_LOC(hcl), HCL_NULL);
|
||||
goto oops;
|
||||
@ -1270,6 +1270,7 @@ static int feed_process_token (hcl_t* hcl)
|
||||
{
|
||||
int oldflagv;
|
||||
int concode;
|
||||
hcl_rstl_t* rstl;
|
||||
|
||||
if (frd->level <= 0)
|
||||
{
|
||||
@ -1277,6 +1278,17 @@ static int feed_process_token (hcl_t* hcl)
|
||||
goto oops;
|
||||
}
|
||||
|
||||
if (TOKEN_TYPE(hcl) == HCL_TOK_RBRACE)
|
||||
{
|
||||
rstl = hcl->c->r.st; /* check the parent, not the current */
|
||||
if (rstl && (rstl->flagv & AUTO_FORGED))
|
||||
{
|
||||
/* the auto-forged list has not been terminated. it must be terminated closed first */
|
||||
hcl_setsynerrbfmt (hcl, HCL_SYNERR_SEMICOLON, TOKEN_LOC(hcl), TOKEN_NAME(hcl), "semicolon expected");
|
||||
goto oops;
|
||||
}
|
||||
}
|
||||
|
||||
concode = LIST_FLAG_GET_CONCODE(frd->flagv);
|
||||
if (concode == HCL_CONCODE_XLIST && (frd->flagv & AUTO_FORGED))
|
||||
{
|
||||
|
Reference in New Issue
Block a user