mirror of
git://projects.qi-hardware.com/eda-tools.git
synced 2024-11-16 18:51:53 +02:00
b2/: make the match name after "break" and "continue" optional
If the name is omitted, we jump back / out of the current block.
This commit is contained in:
parent
107280b6d5
commit
694d48b56a
2
b2/SUBST
2
b2/SUBST
@ -8,7 +8,7 @@ BAR=x /* BAR= wouldn't be syntactically correct. We need a non-empty value */
|
||||
FOO=(*)(?) {
|
||||
BAR=$BAR$2
|
||||
FOO=$1
|
||||
continue FOO
|
||||
continue
|
||||
}
|
||||
BAR=x(*) { $=$1 } /* remove the "x" */
|
||||
|
||||
|
@ -620,6 +620,10 @@ block:
|
||||
$$ = subst_end();
|
||||
else if (!strcmp($1, "ignore"))
|
||||
$$ = subst_ignore();
|
||||
else if (!strcmp($1, "break"))
|
||||
$$ = subst_break(NULL);
|
||||
else if (!strcmp($1, "continue"))
|
||||
$$ = subst_continue(NULL);
|
||||
else
|
||||
yyerrorf("unknown keyword \"%s\"", $1);
|
||||
}
|
||||
|
@ -284,6 +284,8 @@ struct parent {
|
||||
static const struct subst *resolve_jump(const char *name,
|
||||
const struct parent *parent)
|
||||
{
|
||||
if (!name)
|
||||
return parent->sub;
|
||||
while (parent) {
|
||||
assert(parent->sub->type == st_match);
|
||||
if (name == parent->sub->u.match.src)
|
||||
|
Loading…
Reference in New Issue
Block a user