Mercurial > projects > dil
diff trunk/src/cmd/Generate.d @ 640:05645f5613c1
Added an error message.
Improved parseTryStatement().
Fixed getShortClassName().
author | Aziz K?ksal <aziz.koeksal@gmail.com> |
---|---|
date | Mon, 14 Jan 2008 02:36:14 +0100 |
parents | 933cd8d24467 |
children | c37d25d661af |
line wrap: on
line diff
--- a/trunk/src/cmd/Generate.d Mon Jan 14 01:45:44 2008 +0100 +++ b/trunk/src/cmd/Generate.d Mon Jan 14 02:36:14 2008 +0100 @@ -102,18 +102,36 @@ suffixLength = "Declaration".length; break; case NC.Statement: - if (node.kind == NodeKind.Statements) + switch (node.kind) + { + case NodeKind.Statements, + NodeKind.CatchBody, + NodeKind.FinallyBody, + NodeKind.AsmInstruction, + NodeKind.IllegalAsmInstruction: break; - suffixLength = "Statement".length; + default: + suffixLength = "Statement".length; + } break; case NC.Expression: - suffixLength = "Expression".length; + switch (node.kind) + { + case NodeKind.VoidInitializer, + NodeKind.ArrayInitializer, + NodeKind.StructInitializer: + break; + default: + suffixLength = "Expression".length; + } break; case NC.Type: suffixLength = "Type".length; break; case NC.Other: + break; default: + assert(0); } // Remove common suffix. name = name[0 .. $ - suffixLength];