Mercurial > projects > dil
comparison src/dil/semantic/Pass2.d @ 822:fd52beaaa94a
Merging changes from Aziz.
author | Jarrett Billingsley <jarrett.billingsley@gmail.com> |
---|---|
date | Fri, 14 Mar 2008 11:03:11 -0400 |
parents | 09a64d96967a 1d06b4aed7cf |
children | 1ecf05e680ba |
comparison
equal
deleted
inserted
replaced
821:09a64d96967a | 822:fd52beaaa94a |
---|---|
132 d.symbol.setCompleting(); | 132 d.symbol.setCompleting(); |
133 | 133 |
134 Type type = Types.Int; // Default to int. | 134 Type type = Types.Int; // Default to int. |
135 if (d.baseType) | 135 if (d.baseType) |
136 type = visitT(d.baseType).type; | 136 type = visitT(d.baseType).type; |
137 d.symbol.type = new TypeEnum(d.symbol, type); | 137 // Set the enum's base type. |
138 d.symbol.type.baseType = type; | |
139 | |
140 // TODO: check base type. must be basic type or another enum. | |
138 | 141 |
139 enterScope(d.symbol); | 142 enterScope(d.symbol); |
140 | 143 |
141 foreach (member; d.members) | 144 foreach (member; d.members) |
142 { | 145 { |
149 if (finalValue is Interpreter.NAR) | 152 if (finalValue is Interpreter.NAR) |
150 finalValue = new IntExpression(0, d.symbol.type); | 153 finalValue = new IntExpression(0, d.symbol.type); |
151 } | 154 } |
152 //else | 155 //else |
153 // TODO: increment a number variable and assign that to value. | 156 // TODO: increment a number variable and assign that to value. |
154 member.symbol.type = d.symbol.type; // Assign TypeEnum. | |
155 member.symbol.value = finalValue; | 157 member.symbol.value = finalValue; |
156 member.symbol.setComplete(); | 158 member.symbol.setComplete(); |
157 } | 159 } |
158 | 160 |
159 exitScope(); | 161 exitScope(); |