another minor problem fixed: only test on options['R'] once
in a FOR statement!
This commit is contained in:
parent
b86a455efa
commit
982138b8da
3 changed files with 9 additions and 10 deletions
|
@ -1 +1 @@
|
|||
static char Version[] = "ACK Modula-2 compiler Version 0.42";
|
||||
static char Version[] = "ACK Modula-2 compiler Version 0.43";
|
||||
|
|
|
@ -100,7 +100,7 @@ printnode(nd, lvl)
|
|||
register t_node *nd;
|
||||
{
|
||||
indnt(lvl);
|
||||
print("Class: %d; Symbol: %s\n", nd->nd_class, symbol2str(nd->nd_symb));
|
||||
print("Class: %d; Symbol: %s; Flags: %d\n", nd->nd_class, symbol2str(nd->nd_symb), nd->nd_flags);
|
||||
if (nd->nd_type) {
|
||||
indnt(lvl);
|
||||
print("Type: ");
|
||||
|
|
|
@ -448,6 +448,8 @@ WalkStat(nd, exit_label)
|
|||
|
||||
assert(nd->nd_class == Stat);
|
||||
|
||||
if (nd->nd_symb == ';') return;
|
||||
|
||||
DoLineno(nd);
|
||||
options['R'] = (nd->nd_flags & ROPTION);
|
||||
options['A'] = (nd->nd_flags & AOPTION);
|
||||
|
@ -462,9 +464,6 @@ WalkStat(nd, exit_label)
|
|||
}
|
||||
break;
|
||||
|
||||
case ';':
|
||||
break;
|
||||
|
||||
case BECOMES:
|
||||
DoAssign(left, right);
|
||||
break;
|
||||
|
@ -574,13 +573,11 @@ WalkStat(nd, exit_label)
|
|||
nd->nd_def->df_flags |= D_FORLOOP;
|
||||
def_ilb(l1);
|
||||
if (! options['R']) {
|
||||
label x = ++text_label;
|
||||
|
||||
ForLoopVarExpr(nd);
|
||||
C_stl(tmp2);
|
||||
}
|
||||
WalkNode(right, exit_label);
|
||||
nd->nd_def->df_flags &= ~D_FORLOOP;
|
||||
if (! options['R']) {
|
||||
label x = ++text_label;
|
||||
WalkNode(right, exit_label);
|
||||
C_lol(tmp2);
|
||||
ForLoopVarExpr(nd);
|
||||
C_beq(x);
|
||||
|
@ -588,6 +585,8 @@ WalkStat(nd, exit_label)
|
|||
C_trp();
|
||||
def_ilb(x);
|
||||
}
|
||||
else WalkNode(right, exit_label);
|
||||
nd->nd_def->df_flags &= ~D_FORLOOP;
|
||||
FreeInt(tmp2);
|
||||
if (stepsize) {
|
||||
C_lol(tmp);
|
||||
|
|
Loading…
Reference in a new issue