view dmd/ModuleDeclaration.d @ 176:fa9a71a9f5a8

Moved all the mutable globals to Global
author korDen
date Sun, 10 Oct 2010 05:22:45 +0400
parents af724d3510d7
children e3afd1303184
line wrap: on
line source

module dmd.ModuleDeclaration;

import dmd.common;
import dmd.Identifier;
import dmd.ArrayTypes;
import dmd.OutBuffer;

class ModuleDeclaration
{
    Identifier id;
    Identifiers packages;		// array of Identifier's representing packages
    bool safe;

    this(Identifiers packages, Identifier id, bool safe)
	{
		this.packages = packages;
		this.id = id;
		this.safe = safe;
	}

    string toChars()
	{
		scope OutBuffer buf = new OutBuffer();
		if (packages)
		{
			foreach (pid; packages)
			{
                buf.writestring(pid.toChars());
				buf.writeByte('.');
			}
		}
		buf.writestring(id.toChars());
		buf.writeByte(0);
		return buf.extractString();
	}
}