Add back some enclosing scope-exit information to the frontend to produce

proper error messages inside switch statements.
This commit is contained in:
Christian Kamm
2009-03-28 14:39:16 +01:00
parent 99168f443f
commit b2e601bd74
2 changed files with 34 additions and 0 deletions

View File

@@ -469,6 +469,9 @@ struct SwitchStatement : Statement
Array gotoCases; // array of unresolved GotoCaseStatement's
Array *cases; // array of CaseStatement's
int hasNoDefault; // !=0 if no default statement
// LDC
Statement *enclosingScopeExit;
SwitchStatement(Loc loc, Expression *c, Statement *b);
Statement *syntaxCopy();
@@ -491,6 +494,9 @@ struct CaseStatement : Statement
int index; // which case it is (since we sort this)
block *cblock; // back end: label for the block
// LDC
Statement *enclosingScopeExit;
CaseStatement(Loc loc, Expression *exp, Statement *s);
Statement *syntaxCopy();
Statement *semantic(Scope *sc);
@@ -519,6 +525,9 @@ struct DefaultStatement : Statement
block *cblock; // back end: label for the block
#endif
// LDC
Statement *enclosingScopeExit;
DefaultStatement(Loc loc, Statement *s);
Statement *syntaxCopy();
Statement *semantic(Scope *sc);