dmd.statementsem
Does semantic analysis for statements.
Specification: Statements
License
Source: statementsem.d
Documentation: https://dlang.org/phobos/dmd_statementsem.html
-
Declaration
Statement
scopeCode
(Statementstatement
, Scope*sc
, out Statementsentry
, out Statementsexception
, out Statementsfinally
);If
has code that needs to run in a finally clause at the end of the current scope, return that code in the form of a Statement.statement
Parameters
Statement
statement
the
statement
Scope*
sc
context
Statement
sentry
set to code executed upon entry to the scope
Statement
sexception
set to code executed upon exit from the scope via exception
Statement
sfinally
set to code executed in finally block
Return Value
code to be run in the finally clause
-
Declaration
auto
makeTupleForeach
(Scope*sc
, boolisStatic
, boolisDecl
, ForeachStatementfs
, Dsymbols*dbody
, boolneedExpansion
);Type check and unroll
foreach
over an expression tuple as well asstatic foreach
statements andstatic foreach
declarations. Forstatic foreach
statements and `static foreach` declarations, the visitor interface is used (and the result is written into theresult
field.) For `static foreach` declarations, the resulting Dsymbols* are returned directly.Discussion
The unrolled body is wrapped into a
- UnrolledLoopStatement, for
foreach
over an expression tuple. - ForwardingStatement, for
static foreach
statements. - ForwardingAttribDeclaration, for
static foreach
declarations.
static foreach
variables are declared asSTC.local
, such that they are inserted into the local symbol tables of the forwarding constructs instead of forwarded. For `static foreach` with multiple foreach loop variables whose aggregate has been lowered into a sequence of tuples, this function expands the tuples into multipleSTC.local
static foreach
variables. - UnrolledLoopStatement, for