Mercurial > projects > dil
comparison 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 |
comparison
equal
deleted
inserted
replaced
639:1b1315ac27a4 | 640:05645f5613c1 |
---|---|
100 if (node.kind == NodeKind.Declarations) | 100 if (node.kind == NodeKind.Declarations) |
101 break; | 101 break; |
102 suffixLength = "Declaration".length; | 102 suffixLength = "Declaration".length; |
103 break; | 103 break; |
104 case NC.Statement: | 104 case NC.Statement: |
105 if (node.kind == NodeKind.Statements) | 105 switch (node.kind) |
106 { | |
107 case NodeKind.Statements, | |
108 NodeKind.CatchBody, | |
109 NodeKind.FinallyBody, | |
110 NodeKind.AsmInstruction, | |
111 NodeKind.IllegalAsmInstruction: | |
106 break; | 112 break; |
107 suffixLength = "Statement".length; | 113 default: |
114 suffixLength = "Statement".length; | |
115 } | |
108 break; | 116 break; |
109 case NC.Expression: | 117 case NC.Expression: |
110 suffixLength = "Expression".length; | 118 switch (node.kind) |
119 { | |
120 case NodeKind.VoidInitializer, | |
121 NodeKind.ArrayInitializer, | |
122 NodeKind.StructInitializer: | |
123 break; | |
124 default: | |
125 suffixLength = "Expression".length; | |
126 } | |
111 break; | 127 break; |
112 case NC.Type: | 128 case NC.Type: |
113 suffixLength = "Type".length; | 129 suffixLength = "Type".length; |
114 break; | 130 break; |
115 case NC.Other: | 131 case NC.Other: |
132 break; | |
116 default: | 133 default: |
134 assert(0); | |
117 } | 135 } |
118 // Remove common suffix. | 136 // Remove common suffix. |
119 name = name[0 .. $ - suffixLength]; | 137 name = name[0 .. $ - suffixLength]; |
120 // Store the name in the table. | 138 // Store the name in the table. |
121 name_table[node.kind] = name; | 139 name_table[node.kind] = name; |