72
|
1 module dmd.UAddExp;
|
|
2
|
114
|
3 import dmd.common;
|
72
|
4 import dmd.Expression;
|
|
5 import dmd.Identifier;
|
|
6 import dmd.UnaExp;
|
|
7 import dmd.Loc;
|
|
8 import dmd.Scope;
|
|
9 import dmd.TOK;
|
123
|
10 import dmd.Id;
|
72
|
11
|
|
12 class UAddExp : UnaExp
|
|
13 {
|
|
14 this(Loc loc, Expression e)
|
|
15 {
|
|
16 super(loc, TOK.TOKuadd, this.sizeof, e);
|
|
17 }
|
|
18
|
|
19 override Expression semantic(Scope sc)
|
|
20 {
|
|
21 Expression e;
|
|
22
|
|
23 version (LOGSEMANTIC) {
|
|
24 printf("UAddExp.semantic('%s')\n", toChars());
|
|
25 }
|
|
26 assert(!type);
|
|
27 UnaExp.semantic(sc);
|
|
28 e1 = resolveProperties(sc, e1);
|
|
29 e = op_overload(sc);
|
|
30 if (e)
|
|
31 return e;
|
|
32 e1.checkNoBool();
|
|
33 e1.checkArithmetic();
|
|
34 return e1;
|
|
35 }
|
|
36
|
|
37 override Identifier opId()
|
|
38 {
|
123
|
39 return Id.uadd;
|
72
|
40 }
|
|
41 }
|