Scope

struct Scope {
Scope* enclosing;
Module _module;
ScopeDsymbol scopesym;
FuncDeclaration func;
Dsymbol parent;
LabelStatement slabel;
SwitchStatement sw;
Statement tryBody;
TryFinallyStatement tf;
ScopeGuardStatement os;
Statement sbreak;
Statement scontinue;
ForeachStatement fes;
Scope* callsc;
Dsymbol inunion;
bool nofree;
bool inLoop;
int intypeof;
VarDeclaration lastVar;
Module minst;
TemplateInstance tinst;
CtorFlow ctorflow;
int explicitProtection;
StorageClass stc;
DeprecatedDeclaration depdecl;
uint flags;
UserAttributeDeclaration userAttribDecl;
DocComment* lastdc;
uint[void*] anchorCounts;
Identifier prevAnchor;
extern (D) __gshared
Scope* freelist;
}

Members

Functions

detach
void detach()

Similar to pop(), but the results in this are not folded into enclosing.

getClassScope
ClassDeclaration getClassScope()

Search enclosing scopes for ClassDeclaration.

getStructClassScope
AggregateDeclaration getStructClassScope()

Search enclosing scopes for ClassDeclaration.

isDeprecated
bool isDeprecated()

Checks whether the current scope (or any of its parents) is deprecated.

merge
void merge(const ref Loc loc, const ref CtorFlow ctorflow)

Merge results of ctorflow into this.

search
Dsymbol search(const ref Loc loc, Identifier ident, Dsymbol* pscopesym, int flags = IgnoreNone)

Perform unqualified name lookup by following the chain of scopes up until found.

setNoFree
void setNoFree()

For TemplateDeclarations, we need to remember the Scope where it was declared. So mark the Scope as not to be free'd.

Static functions

search_correct_C
const(char)* search_correct_C(Identifier ident)

Maybe ident was a C or C++ name. Check for that, and suggest the D equivalent.

Variables

aligndecl
AlignDeclaration aligndecl;

alignment for struct members

cppmangle
CPPMANGLE cppmangle;

mangle type

inlining
PINLINE inlining;

inlining strategy for functions

linkage
LINK linkage;

linkage for external functions

namespace
CPPNamespaceDeclaration namespace;

C++ namespace this symbol is in

protection
Prot protection;

protection for class members

Meta