Mercurial > projects > ddmd
comparison dmd/Import.d @ 72:2e2a5c3f943a
reduced warnings by adding override to the methods
think this also normalizes different line endings used all over the place
author | Trass3r |
---|---|
date | Sat, 28 Aug 2010 16:19:48 +0200 |
parents | 427f8aa74d28 |
children | 43073c7c7769 |
comparison
equal
deleted
inserted
replaced
71:8e24ef1dd139 | 72:2e2a5c3f943a |
---|---|
86 | 86 |
87 names.push(cast(void*)name); | 87 names.push(cast(void*)name); |
88 aliases.push(cast(void*)alias_); | 88 aliases.push(cast(void*)alias_); |
89 } | 89 } |
90 | 90 |
91 string kind() | 91 override string kind() |
92 { | 92 { |
93 return isstatic ? "static import" : "import"; | 93 return isstatic ? "static import" : "import"; |
94 } | 94 } |
95 | 95 |
96 Dsymbol syntaxCopy(Dsymbol s) // copy only syntax trees | 96 override Dsymbol syntaxCopy(Dsymbol s) // copy only syntax trees |
97 { | 97 { |
98 assert(false); | 98 assert(false); |
99 } | 99 } |
100 | 100 |
101 void load(Scope sc) | 101 void load(Scope sc) |
135 pkg = mod; | 135 pkg = mod; |
136 | 136 |
137 //writef("-Import::load('%s'), pkg = %p\n", toChars(), pkg); | 137 //writef("-Import::load('%s'), pkg = %p\n", toChars(), pkg); |
138 } | 138 } |
139 | 139 |
140 void semantic(Scope sc) | 140 override void semantic(Scope sc) |
141 { | 141 { |
142 //writef("Import.semantic('%s')\n", toChars()); | 142 //writef("Import.semantic('%s')\n", toChars()); |
143 | 143 |
144 load(sc); | 144 load(sc); |
145 | 145 |
259 } | 259 } |
260 | 260 |
261 //printf("-Import.semantic('%s'), pkg = %p\n", toChars(), pkg); | 261 //printf("-Import.semantic('%s'), pkg = %p\n", toChars(), pkg); |
262 } | 262 } |
263 | 263 |
264 void semantic2(Scope sc) | 264 override void semantic2(Scope sc) |
265 { | 265 { |
266 //printf("Import::semantic2('%s')\n", toChars()); | 266 //printf("Import::semantic2('%s')\n", toChars()); |
267 mod.semantic2(); | 267 mod.semantic2(); |
268 if (mod.needmoduleinfo) | 268 if (mod.needmoduleinfo) |
269 sc.module_.needmoduleinfo = 1; | 269 sc.module_.needmoduleinfo = 1; |
270 } | 270 } |
271 | 271 |
272 Dsymbol toAlias() | 272 override Dsymbol toAlias() |
273 { | 273 { |
274 if (aliasId) | 274 if (aliasId) |
275 return mod; | 275 return mod; |
276 return this; | 276 return this; |
277 } | 277 } |
278 | 278 |
279 /***************************** | 279 /***************************** |
280 * Add import to sd's symbol table. | 280 * Add import to sd's symbol table. |
281 */ | 281 */ |
282 bool addMember(Scope sc, ScopeDsymbol sd, bool memnum) | 282 override bool addMember(Scope sc, ScopeDsymbol sd, bool memnum) |
283 { | 283 { |
284 bool result = false; | 284 bool result = false; |
285 | 285 |
286 if (names.dim == 0) | 286 if (names.dim == 0) |
287 return Dsymbol.addMember(sc, sd, memnum); | 287 return Dsymbol.addMember(sc, sd, memnum); |
308 } | 308 } |
309 | 309 |
310 return result; | 310 return result; |
311 } | 311 } |
312 | 312 |
313 Dsymbol search(Loc loc, Identifier ident, int flags) | 313 override Dsymbol search(Loc loc, Identifier ident, int flags) |
314 { | 314 { |
315 //printf("%s.Import.search(ident = '%s', flags = x%x)\n", toChars(), ident.toChars(), flags); | 315 //printf("%s.Import.search(ident = '%s', flags = x%x)\n", toChars(), ident.toChars(), flags); |
316 | 316 |
317 if (!pkg) | 317 if (!pkg) |
318 { | 318 { |
322 | 322 |
323 // Forward it to the package/module | 323 // Forward it to the package/module |
324 return pkg.search(loc, ident, flags); | 324 return pkg.search(loc, ident, flags); |
325 } | 325 } |
326 | 326 |
327 bool overloadInsert(Dsymbol s) | 327 override bool overloadInsert(Dsymbol s) |
328 { | 328 { |
329 // Allow multiple imports of the same name | 329 // Allow multiple imports of the same name |
330 return s.isImport() !is null; | 330 return s.isImport() !is null; |
331 } | 331 } |
332 | 332 |
333 void toCBuffer(OutBuffer buf, HdrGenState* hgs) | 333 override void toCBuffer(OutBuffer buf, HdrGenState* hgs) |
334 { | 334 { |
335 assert(false); | 335 assert(false); |
336 } | 336 } |
337 | 337 |
338 Import isImport() { return this; } | 338 override Import isImport() { return this; } |
339 } | 339 } |