mirror of
git://projects.qi-hardware.com/eda-tools.git
synced 2024-11-26 15:53:44 +02:00
b2/: rename "again" to "continue"
This commit is contained in:
parent
bb809b0d6c
commit
107280b6d5
4
b2/SUBST
4
b2/SUBST
@ -8,7 +8,7 @@ BAR=x /* BAR= wouldn't be syntactically correct. We need a non-empty value */
|
|||||||
FOO=(*)(?) {
|
FOO=(*)(?) {
|
||||||
BAR=$BAR$2
|
BAR=$BAR$2
|
||||||
FOO=$1
|
FOO=$1
|
||||||
again FOO
|
continue FOO
|
||||||
}
|
}
|
||||||
BAR=x(*) { $=$1 } /* remove the "x" */
|
BAR=x(*) { $=$1 } /* remove the "x" */
|
||||||
|
|
||||||
@ -18,7 +18,7 @@ REF=R[0-9]* {
|
|||||||
TOL <= 5%
|
TOL <= 5%
|
||||||
FN=*% { TOL<=$$ }
|
FN=*% { TOL<=$$ }
|
||||||
break REF
|
break REF
|
||||||
// end break again ignore
|
// end break continue ignore
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -609,8 +609,8 @@ block:
|
|||||||
{
|
{
|
||||||
if (!strcmp($1, "break"))
|
if (!strcmp($1, "break"))
|
||||||
$$ = subst_break($2);
|
$$ = subst_break($2);
|
||||||
else if (!strcmp($1, "again"))
|
else if (!strcmp($1, "continue"))
|
||||||
$$ = subst_again($2);
|
$$ = subst_continue($2);
|
||||||
else
|
else
|
||||||
yyerrorf("unknown keyword \"%s\"", $1);
|
yyerrorf("unknown keyword \"%s\"", $1);
|
||||||
}
|
}
|
||||||
|
@ -205,7 +205,7 @@ static const struct subst *recurse_sub(const struct subst *sub,
|
|||||||
if (jump) {
|
if (jump) {
|
||||||
if (jump != sub)
|
if (jump != sub)
|
||||||
return jump;
|
return jump;
|
||||||
if (*cause == st_again)
|
if (*cause == st_continue)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -222,7 +222,7 @@ static const struct subst *recurse_sub(const struct subst *sub,
|
|||||||
case st_ignore:
|
case st_ignore:
|
||||||
return &jump_ignore;
|
return &jump_ignore;
|
||||||
case st_break:
|
case st_break:
|
||||||
case st_again:
|
case st_continue:
|
||||||
*cause = sub->type;
|
*cause = sub->type;
|
||||||
return sub->u.jump;
|
return sub->u.jump;
|
||||||
default:
|
default:
|
||||||
|
11
b2/subst.c
11
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;
|
struct subst *sub;
|
||||||
|
|
||||||
sub = alloc_subst(st_again);
|
sub = alloc_subst(st_continue);
|
||||||
sub->u.tmp = block;
|
sub->u.tmp = block;
|
||||||
return sub;
|
return sub;
|
||||||
}
|
}
|
||||||
@ -372,7 +372,7 @@ static void recurse_fin(struct subst *sub, const struct parent *parent)
|
|||||||
break;
|
break;
|
||||||
case st_break:
|
case st_break:
|
||||||
/* fall through */
|
/* fall through */
|
||||||
case st_again:
|
case st_continue:
|
||||||
sub->u.jump = resolve_jump(sub->u.tmp, parent);
|
sub->u.jump = resolve_jump(sub->u.tmp, parent);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -445,8 +445,9 @@ static void recurse_dump(FILE *file, const struct subst *sub, int level)
|
|||||||
case st_break:
|
case st_break:
|
||||||
fprintf(file, "break %s\n", sub->u.jump->u.match.src);
|
fprintf(file, "break %s\n", sub->u.jump->u.match.src);
|
||||||
break;
|
break;
|
||||||
case st_again:
|
case st_continue:
|
||||||
fprintf(file, "again %s\n", sub->u.jump->u.match.src);
|
fprintf(file, "continue %s\n",
|
||||||
|
sub->u.jump->u.match.src);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
abort();
|
abort();
|
||||||
|
@ -45,7 +45,7 @@ enum subst_type {
|
|||||||
st_end, /* end the substitutions, accepting the part */
|
st_end, /* end the substitutions, accepting the part */
|
||||||
st_ignore, /* ignore the part */
|
st_ignore, /* ignore the part */
|
||||||
st_break, /* jump to an outer block */
|
st_break, /* jump to an outer block */
|
||||||
st_again, /* repeat an outer block */
|
st_continue, /* repeat an outer block */
|
||||||
};
|
};
|
||||||
|
|
||||||
struct subst {
|
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_end(void);
|
||||||
struct subst *subst_ignore(void);
|
struct subst *subst_ignore(void);
|
||||||
struct subst *subst_break(const char *block);
|
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);
|
void subst_finalize(struct subst *sub);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user