Mercurial > projects > ddmd
annotate dmd/ModAssignExp.d @ 117:fe941d774f4a
+ ctfe of assign operations
author | Trass3r |
---|---|
date | Thu, 02 Sep 2010 02:50:19 +0200 |
parents | e28b18c23469 |
children | 9e39c7de8438 |
rev | line source |
---|---|
0 | 1 module dmd.ModAssignExp; |
2 | |
114 | 3 import dmd.common; |
117 | 4 import dmd.expression.Mod; |
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; | |
67 | 15 import dmd.backend.OPER; |
56 | 16 import dmd.Id; |
0 | 17 |
18 import dmd.backend.elem; | |
19 | |
20 class ModAssignExp : BinExp | |
21 { | |
22 this(Loc loc, Expression e1, Expression e2) | |
23 { | |
19
01cadcfa4842
Implemented CompileExp, ConditionalDeclaration, ModAssignExp, parsingmixin statements, TemplateAliasParameters, TemplateMixins, TypeDArray.
Robert Clipsham <robert@octarineparrot.com>
parents:
0
diff
changeset
|
24 super(loc, TOK.TOKmodass, this.sizeof, e1, e2); |
0 | 25 } |
26 | |
72 | 27 override Expression semantic(Scope sc) |
0 | 28 { |
73 | 29 BinExp.semantic(sc); |
30 checkComplexMulAssign(); | |
31 return commonSemanticAssign(sc); | |
0 | 32 } |
33 | |
72 | 34 override Expression interpret(InterState istate) |
0 | 35 { |
117 | 36 return interpretAssignCommon(istate, &Mod); |
0 | 37 } |
38 | |
72 | 39 override void buildArrayIdent(OutBuffer buf, Expressions arguments) |
0 | 40 { |
41 assert(false); | |
42 } | |
43 | |
72 | 44 override Expression buildArrayLoop(Arguments fparams) |
0 | 45 { |
46 assert(false); | |
47 } | |
48 | |
72 | 49 override Identifier opId() /* For operator overloading */ |
0 | 50 { |
56 | 51 return Id.modass; |
0 | 52 } |
53 | |
72 | 54 override elem* toElem(IRState* irs) |
0 | 55 { |
67 | 56 return toElemBin(irs,OPmodass); |
0 | 57 } |
19
01cadcfa4842
Implemented CompileExp, ConditionalDeclaration, ModAssignExp, parsingmixin statements, TemplateAliasParameters, TemplateMixins, TypeDArray.
Robert Clipsham <robert@octarineparrot.com>
parents:
0
diff
changeset
|
58 } |