72
|
1 module dmd.LineInitExp;
|
|
2
|
|
3 import dmd.Expression;
|
|
4 import dmd.Loc;
|
|
5 import dmd.Scope;
|
|
6 import dmd.DefaultInitExp;
|
|
7 import dmd.IntegerExp;
|
|
8 import dmd.TOK;
|
|
9 import dmd.Type;
|
|
10
|
|
11 class LineInitExp : DefaultInitExp
|
|
12 {
|
|
13 this(Loc loc)
|
|
14 {
|
|
15 super(loc, TOK.TOKline, this.sizeof);
|
|
16 }
|
|
17
|
|
18 override Expression semantic(Scope sc)
|
|
19 {
|
|
20 type = Type.tint32;
|
|
21 return this;
|
|
22 }
|
|
23
|
|
24 override Expression resolve(Loc loc, Scope sc)
|
|
25 {
|
|
26 Expression e = new IntegerExp(loc, loc.linnum, Type.tint32);
|
|
27 e = e.castTo(sc, type);
|
|
28 return e;
|
|
29 }
|
|
30 }
|