From 107280b6d5c7c9e3bf7182b4a2d68aa190c1771d Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Tue, 22 May 2012 15:33:22 -0300 Subject: [PATCH] b2/: rename "again" to "continue" --- b2/SUBST | 4 ++-- b2/lang.y | 4 ++-- b2/subex.c | 4 ++-- b2/subst.c | 11 ++++++----- b2/subst.h | 4 ++-- 5 files changed, 14 insertions(+), 13 deletions(-) diff --git a/b2/SUBST b/b2/SUBST index 3d7dc28..164a636 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 - again FOO + continue FOO } BAR=x(*) { $=$1 } /* remove the "x" */ @@ -18,7 +18,7 @@ REF=R[0-9]* { TOL <= 5% FN=*% { TOL<=$$ } break REF -// end break again ignore +// end break continue ignore } /* diff --git a/b2/lang.y b/b2/lang.y index ce14400..d5dae62 100644 --- a/b2/lang.y +++ b/b2/lang.y @@ -609,8 +609,8 @@ block: { if (!strcmp($1, "break")) $$ = subst_break($2); - else if (!strcmp($1, "again")) - $$ = subst_again($2); + else if (!strcmp($1, "continue")) + $$ = subst_continue($2); else yyerrorf("unknown keyword \"%s\"", $1); } diff --git a/b2/subex.c b/b2/subex.c index bb4005f..77b8cbd 100644 --- a/b2/subex.c +++ b/b2/subex.c @@ -205,7 +205,7 @@ static const struct subst *recurse_sub(const struct subst *sub, if (jump) { if (jump != sub) return jump; - if (*cause == st_again) + if (*cause == st_continue) continue; } break; @@ -222,7 +222,7 @@ static const struct subst *recurse_sub(const struct subst *sub, case st_ignore: return &jump_ignore; case st_break: - case st_again: + case st_continue: *cause = sub->type; return sub->u.jump; default: diff --git a/b2/subst.c b/b2/subst.c index 6938257..2f14df5 100644 --- a/b2/subst.c +++ b/b2/subst.c @@ -262,11 +262,11 @@ struct subst *subst_break(const char *block) } -struct subst *subst_again(const char *block) +struct subst *subst_continue(const char *block) { struct subst *sub; - sub = alloc_subst(st_again); + sub = alloc_subst(st_continue); sub->u.tmp = block; return sub; } @@ -372,7 +372,7 @@ static void recurse_fin(struct subst *sub, const struct parent *parent) break; case st_break: /* fall through */ - case st_again: + case st_continue: sub->u.jump = resolve_jump(sub->u.tmp, parent); break; default: @@ -445,8 +445,9 @@ static void recurse_dump(FILE *file, const struct subst *sub, int level) case st_break: fprintf(file, "break %s\n", sub->u.jump->u.match.src); break; - case st_again: - fprintf(file, "again %s\n", sub->u.jump->u.match.src); + case st_continue: + fprintf(file, "continue %s\n", + sub->u.jump->u.match.src); break; default: abort(); diff --git a/b2/subst.h b/b2/subst.h index 70b6a15..3a3efbb 100644 --- a/b2/subst.h +++ b/b2/subst.h @@ -45,7 +45,7 @@ enum subst_type { st_end, /* end the substitutions, accepting the part */ st_ignore, /* ignore the part */ st_break, /* jump to an outer block */ - st_again, /* repeat an outer block */ + st_continue, /* repeat an outer block */ }; struct subst { @@ -78,7 +78,7 @@ struct subst *subst_assign(const char *dst, enum relop op, const char *pat); struct subst *subst_end(void); struct subst *subst_ignore(void); struct subst *subst_break(const char *block); -struct subst *subst_again(const char *block); +struct subst *subst_continue(const char *block); void subst_finalize(struct subst *sub);