Scope

Undocumented in source but is binding to C++. You might be able to learn more by searching the web for its name.

Members

Functions

alignment
structalign_t alignment()
detach
void detach()

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

getClassScope
ClassDeclaration getClassScope()

Search enclosing scopes for ClassDeclaration.

getEnclosingFunction
inout(FuncDeclaration) getEnclosingFunction()

Find the lexically enclosing function (if any).

getScopesym
ScopeDsymbol getScopesym()

Search enclosing scopes for ScopeDsymbol.

getStructClassScope
AggregateDeclaration getStructClassScope()

Search enclosing scopes for ClassDeclaration or StructDeclaration.

inner
Scope* inner()

Find the innermost scope with a symbol table.

insert
Dsymbol insert(Dsymbol s)

Add symbol s to innermost symbol table.

isDeprecated
bool isDeprecated()

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

isFromSpeculativeSemanticContext
bool isFromSpeculativeSemanticContext()

dmd relies on mutation of state during semantic analysis, however sometimes semantic is being performed in a speculative context that should not have any visible effect on the rest of the compilation: for example when compiling a typeof() or __traits(compiles).

merge
void merge(Loc loc, CtorFlow ctorflow)

Merge results of ctorflow into this.

needsCodegen
bool needsCodegen()
search
Dsymbol search(Loc loc, Identifier ident, Dsymbol* pscopesym, int flags)

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.

Static variables

freelist
Scope* freelist;

do not set wasRead for it

Variables

_module
Module _module;

Root module

aliasAsg
AliasDeclaration aliasAsg;

if set, then aliasAsg is being assigned a new value,

aligndecl
AlignDeclaration aligndecl;

alignment for struct members

anchorCounts
uint[void*] anchorCounts;

lookup duplicate anchor name count

callsc
Scope* callsc;

used for __FUNCTION__, __PRETTY_FUNCTION__ and __MODULE__

cppmangle
CPPMANGLE cppmangle;

mangle type

ctorflow
CtorFlow ctorflow;

flow analysis for constructors

depdecl
DeprecatedDeclaration depdecl;

customized deprecation message

eSink
ErrorSink eSink;

sink for error messages

enclosing
Scope* enclosing;

enclosing Scope

explicitVisibility
int explicitVisibility;

set if in an explicit visibility attribute

fes
ForeachStatement fes;

if nested function for ForeachStatement, this is it

func
FuncDeclaration func;

function we are in

inLoop
bool inLoop;

true if inside a loop (where constructor calls aren't allowed)

inlining
PragmaDeclaration inlining;

inlining strategy for functions

intypeof
int intypeof;

in typeof(exp)

inunion
Dsymbol inunion;

!= null if processing members of a union

lastVar
VarDeclaration lastVar;

Previous symbol used to prevent goto-skips-init

lastdc
DocComment* lastdc;

documentation comment for last symbol at this scope

linkage
LINK linkage;

linkage for external functions

minst
Module minst;

root module where the instantiated templates should belong to

namespace
CPPNamespaceDeclaration namespace;

C++ namespace this symbol is in

nofree
bool nofree;

true if shouldn't free it

os
ScopeGuardStatement os;

enclosing scope(xxx) statement

parent
Dsymbol parent;

parent to use

prevAnchor
Identifier prevAnchor;

qualified symbol name of last doc anchor

sbreak
Statement sbreak;

enclosing statement that supports "break"

scontinue
Statement scontinue;

enclosing statement that supports "continue"

scopesym
ScopeDsymbol scopesym;

current symbol

slabel
LabelStatement slabel;

enclosing labelled statement

stc
StorageClass stc;

storage class

sw
SwitchStatement sw;

enclosing switch statement

tf
TryFinallyStatement tf;

enclosing try finally statement

tinst
TemplateInstance tinst;

enclosing template instance

tryBody
Statement tryBody;

enclosing _body of TryCatchStatement or TryFinallyStatement

varDecl
VarDeclaration varDecl;

variable we are in during semantic2

visibility
Visibility visibility;

visibility for class members

Meta