Mercurial > projects > ddmd
annotate dmd/DotExp.d @ 192:eb38fdcb3e62 default tip
updated to compile with dmd2.062
author | korDen |
---|---|
date | Sat, 02 Mar 2013 01:25:52 -0800 |
parents | b0d41ff5e0df |
children |
rev | line source |
---|---|
72 | 1 module dmd.DotExp; |
2 | |
114 | 3 import dmd.common; |
72 | 4 import dmd.Expression; |
5 import dmd.Loc; | |
6 import dmd.Scope; | |
129 | 7 import dmd.ScopeExp; |
8 import dmd.TemplateDeclaration; | |
9 import dmd.DotTemplateExp; | |
72 | 10 import dmd.BinExp; |
11 import dmd.TOK; | |
12 | |
187
b0d41ff5e0df
Added expandability scheme outlined in http://www.dsource.org/forums/viewtopic.php?t=5659&sid=6f2150ff5b0bffcd47512a6a7608d218
Abscissa
parents:
178
diff
changeset
|
13 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
|
14 |
0 | 15 class DotExp : BinExp |
16 { | |
187
b0d41ff5e0df
Added expandability scheme outlined in http://www.dsource.org/forums/viewtopic.php?t=5659&sid=6f2150ff5b0bffcd47512a6a7608d218
Abscissa
parents:
178
diff
changeset
|
17 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
|
18 |
0 | 19 this(Loc loc, Expression e1, Expression e2) |
20 { | |
178 | 21 register(); |
129 | 22 super(loc, TOKdotexp, DotExp.sizeof, e1, e2); |
0 | 23 } |
24 | |
72 | 25 override Expression semantic(Scope sc) |
0 | 26 { |
129 | 27 version (LOGSEMANTIC) { |
28 printf("DotExp.semantic('%s')\n", toChars()); | |
29 if (type) printf("\ttype = %s\n", type.toChars()); | |
30 } | |
31 e1 = e1.semantic(sc); | |
32 e2 = e2.semantic(sc); | |
33 if (e2.op == TOKimport) | |
34 { | |
35 ScopeExp se = cast(ScopeExp)e2; | |
36 TemplateDeclaration td = se.sds.isTemplateDeclaration(); | |
37 if (td) | |
38 { | |
39 Expression e = new DotTemplateExp(loc, e1, td); | |
40 e = e.semantic(sc); | |
41 return e; | |
42 } | |
43 } | |
44 if (!type) | |
45 type = e2.type; | |
46 return this; | |
0 | 47 } |
48 } | |
49 |