Mercurial > projects > ddmd
annotate dmd/OrAssignExp.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 |
---|---|
0 | 1 module dmd.OrAssignExp; |
2 | |
114 | 3 import dmd.common; |
117 | 4 import dmd.expression.Or; |
0 | 5 import dmd.BinExp; |
6 import dmd.Loc; | |
7 import dmd.Expression; | |
8 import dmd.Scope; | |
9 import dmd.InterState; | |
10 import dmd.OutBuffer; | |
11 import dmd.ArrayTypes; | |
12 import dmd.Identifier; | |
13 import dmd.IRState; | |
14 import dmd.TOK; | |
15 import dmd.Id; | |
16 | |
17 import dmd.backend.elem; | |
18 import dmd.backend.OPER; | |
19 | |
187
b0d41ff5e0df
Added expandability scheme outlined in http://www.dsource.org/forums/viewtopic.php?t=5659&sid=6f2150ff5b0bffcd47512a6a7608d218
Abscissa
parents:
178
diff
changeset
|
20 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
|
21 |
0 | 22 class OrAssignExp : BinExp |
23 { | |
187
b0d41ff5e0df
Added expandability scheme outlined in http://www.dsource.org/forums/viewtopic.php?t=5659&sid=6f2150ff5b0bffcd47512a6a7608d218
Abscissa
parents:
178
diff
changeset
|
24 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
|
25 |
0 | 26 this(Loc loc, Expression e1, Expression e2) |
27 { | |
178 | 28 register(); |
0 | 29 super(loc, TOK.TOKorass, OrAssignExp.sizeof, e1, e2); |
30 } | |
31 | |
72 | 32 override Expression semantic(Scope sc) |
0 | 33 { |
34 return commonSemanticAssignIntegral(sc); | |
35 } | |
36 | |
72 | 37 override Expression interpret(InterState istate) |
0 | 38 { |
117 | 39 return interpretAssignCommon(istate, &Or); |
0 | 40 } |
41 | |
72 | 42 override void buildArrayIdent(OutBuffer buf, Expressions arguments) |
0 | 43 { |
123 | 44 AssignExp_buildArrayIdent(buf, arguments, "Or"); |
0 | 45 } |
46 | |
130
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
123
diff
changeset
|
47 override Expression buildArrayLoop(Parameters fparams) |
0 | 48 { |
123 | 49 return AssignExp_buildArrayLoop!(typeof(this))(fparams); |
0 | 50 } |
51 | |
72 | 52 override Identifier opId() /* For operator overloading */ |
0 | 53 { |
54 return Id.orass; | |
55 } | |
56 | |
72 | 57 override elem* toElem(IRState* irs) |
0 | 58 { |
59 return toElemBin(irs, OPorass); | |
60 } | |
72 | 61 } |