comparison dmd/Module.d @ 128:e6e542f37b94

Some more Array -> Vector conversions
author Eldar Insafutdinov <e.insafutdinov@gmail.com>
date Sat, 04 Sep 2010 01:33:05 +0100
parents 1765f3ef917d
children 010eb8f0e18d
comparison
equal deleted inserted replaced
127:9ee9b55452cb 128:e6e542f37b94
295 295
296 objfile = new File(objfilename); 296 objfile = new File(objfilename);
297 symfile = new File(symfilename); 297 symfile = new File(symfilename);
298 } 298 }
299 299
300 static Module load(Loc loc, Array packages, Identifier ident) 300 static Module load(Loc loc, Identifiers packages, Identifier ident)
301 { 301 {
302 Module m; 302 Module m;
303 string filename; 303 string filename;
304 304
305 //writef("Module.load(ident = '%s')\n", ident.toChars()); 305 //writef("Module.load(ident = '%s')\n", ident.toChars());
309 // into: 309 // into:
310 // foo\bar\baz 310 // foo\bar\baz
311 filename = ident.toChars(); 311 filename = ident.toChars();
312 if (packages && packages.dim) 312 if (packages && packages.dim)
313 { 313 {
314 scope OutBuffer buf = new OutBuffer(); 314 scope buf = new OutBuffer();
315 int i; 315
316 316 foreach (pid; packages)
317 for (i = 0; i < packages.dim; i++)
318 { 317 {
319 Identifier pid = cast(Identifier)packages.data[i];
320
321 buf.writestring(pid.toChars()); 318 buf.writestring(pid.toChars());
322 version (Windows) 319 version (Windows)
323 { 320 {
324 buf.writeByte('\\'); 321 buf.writeByte('\\');
325 } 322 }
377 if (global.params.verbose) 374 if (global.params.verbose)
378 { 375 {
379 writef("import "); 376 writef("import ");
380 if (packages) 377 if (packages)
381 { 378 {
382 for (size_t i = 0; i < packages.dim; i++) 379 foreach (pid; packages)
383 { 380 {
384 Identifier pid = cast(Identifier)packages.data[i];
385 writef("%s.", pid.toChars()); 381 writef("%s.", pid.toChars());
386 } 382 }
387 } 383 }
388 writef("%s\t(%s)\n", ident.toChars(), m.srcfile.toChars()); 384 writef("%s\t(%s)\n", ident.toChars(), m.srcfile.toChars());
389 } 385 }