Mercurial > projects > ddmd
annotate dmd/ProtDeclaration.d @ 192:eb38fdcb3e62 default tip
updated to compile with dmd2.062
author | korDen |
---|---|
date | Sat, 02 Mar 2013 01:25:52 -0800 |
parents | b0d41ff5e0df |
children |
rev | line source |
---|---|
0 | 1 module dmd.ProtDeclaration; |
2 | |
114 | 3 import dmd.common; |
0 | 4 import dmd.AttribDeclaration; |
5 import dmd.PROT; | |
6 import dmd.OutBuffer; | |
7 import dmd.HdrGenState; | |
8 import dmd.Scope; | |
9 import dmd.Dsymbol; | |
10 import dmd.Array; | |
11 | |
187
b0d41ff5e0df
Added expandability scheme outlined in http://www.dsource.org/forums/viewtopic.php?t=5659&sid=6f2150ff5b0bffcd47512a6a7608d218
Abscissa
parents:
178
diff
changeset
|
12 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
|
13 |
0 | 14 class ProtDeclaration : AttribDeclaration |
15 { | |
187
b0d41ff5e0df
Added expandability scheme outlined in http://www.dsource.org/forums/viewtopic.php?t=5659&sid=6f2150ff5b0bffcd47512a6a7608d218
Abscissa
parents:
178
diff
changeset
|
16 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
|
17 |
0 | 18 PROT protection; |
19 | |
74
7e0d548de9e6
Switch Arrays of Dsymbols to the new templated Vector type
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
72
diff
changeset
|
20 this(PROT p, Dsymbols decl) |
0 | 21 { |
178 | 22 register(); |
0 | 23 super(decl); |
24 | |
25 protection = p; | |
26 //printf("decl = %p\n", decl); | |
27 } | |
28 | |
72 | 29 override Dsymbol syntaxCopy(Dsymbol s) |
0 | 30 { |
49 | 31 ProtDeclaration pd; |
32 | |
33 assert(!s); | |
34 pd = new ProtDeclaration(protection, Dsymbol.arraySyntaxCopy(decl)); | |
35 return pd; | |
0 | 36 } |
79 | 37 |
86 | 38 override void importAll(Scope sc) |
39 { | |
40 Scope newsc = sc; | |
41 if (sc.protection != protection || sc.explicitProtection != 1) | |
42 { | |
43 // create new one for changes | |
44 newsc = sc.clone(); | |
45 newsc.flags &= ~SCOPE.SCOPEfree; | |
46 newsc.protection = protection; | |
47 newsc.explicitProtection = 1; | |
48 } | |
79 | 49 |
86 | 50 foreach (Dsymbol s; decl) |
51 s.importAll(newsc); | |
52 | |
53 if (newsc !is sc) | |
54 newsc.pop(); | |
55 } | |
56 | |
72 | 57 override void setScope(Scope sc) |
0 | 58 { |
59 if (decl) | |
60 { | |
61 setScopeNewSc(sc, sc.stc, sc.linkage, protection, 1, sc.structalign); | |
62 } | |
63 } | |
64 | |
72 | 65 override void semantic(Scope sc) |
0 | 66 { |
67 if (decl) | |
68 { | |
69 semanticNewSc(sc, sc.stc, sc.linkage, protection, 1, sc.structalign); | |
70 } | |
71 } | |
72 | |
72 | 73 override void toCBuffer(OutBuffer buf, HdrGenState* hgs) |
0 | 74 { |
75 assert(false); | |
76 } | |
77 | |
78 static void protectionToCBuffer(OutBuffer buf, PROT protection) | |
79 { | |
80 assert(false); | |
81 } | |
72 | 82 } |