Mercurial > projects > dang
diff ast/Stmt.d @ 114:3a0cd42de9cc
Removed misc/Error.d and is now using the error system all way through.
author | Anders Johnsen <skabet@gmail.com> |
---|---|
date | Sun, 25 May 2008 16:40:38 +0200 |
parents | 771ac63898e2 |
children | c3b24e7e8cf8 |
line wrap: on
line diff
--- a/ast/Stmt.d Sun May 25 15:48:13 2008 +0200 +++ b/ast/Stmt.d Sun May 25 16:40:38 2008 +0200 @@ -8,8 +8,7 @@ ast.Decl; import sema.Scope, - basic.SourceLocation, - misc.Error; + basic.SourceLocation; enum StmtType { @@ -191,9 +190,11 @@ if (all_values.length != old_values.length + new_values.length) { // overlap! - auto e = new Error( + // TODO: Move this to another sema file where it can be enforced. + /+ auto e = new Error( "Can't have multiple cases with the same value." " Values appearing in multiple cases: %0"); + //e.loc(values[0].token.location); all_values = Array.intersectionOf(old_values, new_values); @@ -207,15 +208,18 @@ if (Array.bsearch(all_values, v)) e.tok(c.values[i].token); */ - throw e; + throw e;+/ } old_values = all_values; } void setDefault(Stmt[] stmts) { + // TODO: Move this to another sema file where it can be enforced. + /* if (defaultBlock.length != 0) throw new Error("Switch statements can't have multiple defaults"); + */ defaultBlock = stmts; if (cases.length > 0) cases[$ - 1].followedByDefault = true;