1
0
mirror of git://projects.qi-hardware.com/eda-tools.git synced 2024-11-22 10:06:16 +02:00

b2/lang.y (parse_jump): improve diagnostic for code after end/ignore

Before, the error was a rather confusing "unknown keyword", suggesting
a typo.
This commit is contained in:
Werner Almesberger 2012-06-03 21:18:51 -03:00
parent ed8df3f94e
commit bca50f009f

View File

@ -77,6 +77,8 @@ static struct subst *parse_jump(const char *keyword, const char *target)
return subst_break(target);
if (!strcmp(keyword, "continue"))
return subst_continue(target);
if (!strcmp(keyword, "end") || !strcmp(keyword, "ignore"))
yyerror("unreachable code");
yyerrorf("unknown keyword \"%s\"", keyword);
}