diff --git a/b2/SUBST b/b2/SUBST index 164a636..2a7994f 100644 --- a/b2/SUBST +++ b/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" */ diff --git a/b2/lang.y b/b2/lang.y index d5dae62..042da19 100644 --- a/b2/lang.y +++ b/b2/lang.y @@ -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); } diff --git a/b2/subst.c b/b2/subst.c index 2f14df5..8003ca3 100644 --- a/b2/subst.c +++ b/b2/subst.c @@ -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)