Mercurial > projects > ddmd
annotate dmd/LineInitExp.d @ 187:b0d41ff5e0df
Added expandability scheme outlined in http://www.dsource.org/forums/viewtopic.php?t=5659&sid=6f2150ff5b0bffcd47512a6a7608d218
author | Abscissa |
---|---|
date | Tue, 07 Jun 2011 23:37:34 -0400 |
parents | e3afd1303184 |
children |
rev | line source |
---|---|
72 | 1 module dmd.LineInitExp; |
2 | |
114 | 3 import dmd.common; |
72 | 4 import dmd.Expression; |
5 import dmd.Loc; | |
6 import dmd.Scope; | |
7 import dmd.DefaultInitExp; | |
8 import dmd.IntegerExp; | |
9 import dmd.TOK; | |
10 import dmd.Type; | |
11 | |
187
b0d41ff5e0df
Added expandability scheme outlined in http://www.dsource.org/forums/viewtopic.php?t=5659&sid=6f2150ff5b0bffcd47512a6a7608d218
Abscissa
parents:
178
diff
changeset
|
12 import dmd.DDMDExtensions; |
b0d41ff5e0df
Added expandability scheme outlined in http://www.dsource.org/forums/viewtopic.php?t=5659&sid=6f2150ff5b0bffcd47512a6a7608d218
Abscissa
parents:
178
diff
changeset
|
13 |
72 | 14 class LineInitExp : DefaultInitExp |
15 { | |
187
b0d41ff5e0df
Added expandability scheme outlined in http://www.dsource.org/forums/viewtopic.php?t=5659&sid=6f2150ff5b0bffcd47512a6a7608d218
Abscissa
parents:
178
diff
changeset
|
16 mixin insertMemberExtension!(typeof(this)); |
b0d41ff5e0df
Added expandability scheme outlined in http://www.dsource.org/forums/viewtopic.php?t=5659&sid=6f2150ff5b0bffcd47512a6a7608d218
Abscissa
parents:
178
diff
changeset
|
17 |
72 | 18 this(Loc loc) |
19 { | |
178 | 20 register(); |
72 | 21 super(loc, TOK.TOKline, this.sizeof); |
22 } | |
23 | |
24 override Expression semantic(Scope sc) | |
25 { | |
26 type = Type.tint32; | |
27 return this; | |
28 } | |
29 | |
130
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
114
diff
changeset
|
30 override Expression resolveLoc(Loc loc, Scope sc) |
72 | 31 { |
32 Expression e = new IntegerExp(loc, loc.linnum, Type.tint32); | |
33 e = e.castTo(sc, type); | |
34 return e; | |
35 } | |
36 } |