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 {
|
178
|
16 register();
|
72
|
17 super(loc, TOK.TOKuadd, this.sizeof, e);
|
|
18 }
|
|
19
|
|
20 override Expression semantic(Scope sc)
|
|
21 {
|
|
22 Expression e;
|
|
23
|
|
24 version (LOGSEMANTIC) {
|
|
25 printf("UAddExp.semantic('%s')\n", toChars());
|
|
26 }
|
|
27 assert(!type);
|
|
28 UnaExp.semantic(sc);
|
|
29 e1 = resolveProperties(sc, e1);
|
|
30 e = op_overload(sc);
|
|
31 if (e)
|
|
32 return e;
|
|
33 e1.checkNoBool();
|
|
34 e1.checkArithmetic();
|
|
35 return e1;
|
|
36 }
|
|
37
|
|
38 override Identifier opId()
|
|
39 {
|
123
|
40 return Id.uadd;
|
72
|
41 }
|
|
42 }
|