perturb mangled name to avoid collisions with those in FuncDeclaration.localsymtab
Determine which Module a Dsymbol is in.
Does this Dsymbol come from a C file?
final Module
getAccessModule();
Determine which Module a Dsymbol is in, as far as access rights go.
final @safe inout(Dsymbol)
pastMixin() inout;
pastMixin returns the enclosing symbol if this is a template mixin.
pastMixinAndNspace does likewise, additionally skipping over Nspaces that are mangleOnly.
See also
parent,
toParent and
toParent2.
final @safe inout(Dsymbol)
toParent() inout;
final @safe inout(Dsymbol)
toParent2() inout;
final inout(Dsymbol)
toParentDecl() inout;
final inout(Dsymbol)
toParentLocal() inout;
parent field returns a lexically enclosing scope symbol this is a member of.
toParent() returns a logically enclosing scope symbol this is a member of. It skips over TemplateMixin's.
toParent2() returns an enclosing scope symbol this is living at runtime. It skips over both TemplateInstance's and TemplateMixin's. It's used when looking for the 'this' pointer of the enclosing function/class.
toParentDecl() similar to
toParent2() but always follows the template declaration scope instead of the instantiation scope.
toParentLocal() similar to
toParentDecl() but follows the instantiation scope if a template declaration is non-local i.e. global or static.
Examples:module mod;template Foo(alias a) {mixin Bar!(); }mixintemplate Bar() {public {// VisibilityDeclarationvoid baz() { a = 2; } } }void test() {int v = 1;alias foo = Foo!(v); foo.baz();assert(v == 2); }// s == FuncDeclaration('mod.test.Foo!().Bar!().baz()')// s.parent == TemplateMixin('mod.test.Foo!().Bar!()')// s.toParent() == TemplateInstance('mod.test.Foo!()')// s.toParent2() == FuncDeclaration('mod.test')// s.toParentDecl() == Module('mod')// s.toParentLocal() == FuncDeclaration('mod.test') static Dsymbols*
arraySyntaxCopy(Dsymbols*
a);
Do syntax copy of an array of Dsymbol's.
final inout(AggregateDeclaration)
isMember() inout;
Returns an AggregateDeclaration when toParent() is that.
final inout(AggregateDeclaration)
isMember2() inout;
Returns an AggregateDeclaration when toParent2() is that.
final inout(AggregateDeclaration)
isMemberDecl() inout;
Returns an AggregateDeclaration when toParentDecl() is that.
final inout(AggregateDeclaration)
isMemberLocal() inout;
Returns an AggregateDeclaration when toParentLocal() is that.
pure nothrow @nogc @safe Visibility
visible();
Dsymbol
syntaxCopy(Dsymbol
s);
Copy the syntax. Used for template instantiations. If s is NULL, allocate the new object, otherwise fill it in.
void
addComment(const(char)*
comment);
Add documentation comment to Dsymbol. Ignore NULL comments.
final const(char)*
comment();
get documentation comment for this Dsymbol
final UnitTestDeclaration
ddocUnittest();
Get ddoc unittest associated with this symbol. (only use this with ddoc)
Returns:ddoc unittest, null if none
final void
ddocUnittest(UnitTestDeclaration
utd);
Set ddoc unittest associated with this symbol.
Returns true if this symbol is defined in a non-root module without instantiation.
static void
deinitialize();
Deinitializes the global state of the compiler.
This can be used to restore the state set by_init to its original state.