dmd.statementsem
Does semantic analysis for statements.
Specification: Statements
License
Source: statementsem.d
Documentation: https://dlang.org/phobos/dmd_statementsem.html
-
Declaration
boolthrowSemantic(const ref Locloc, ref Expressionexp, Scope*sc);Run semantic on
throw <.exp>Parameters
Locloclocation of the
throwExpressionexpvalue to be thrown
Scope*scenclosing scope
Return Value
trueif thethrowis valid, orfalseif an error was found -
Declaration
StatementscopeCode(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.statementParameters
Statementstatementthe
statementScope*sccontext
Statementsentryset to code executed upon entry to the scope
Statementsexceptionset to code executed upon exit from the scope via exception
Statementsfinallyset to code executed in finally block
Return Value
code to be run in the finally clause
-
Declaration
automakeTupleForeach(Scope*sc, boolisStatic, boolisDecl, ForeachStatementfs, Dsymbols*dbody, boolneedExpansion);Type check and unroll
foreachover an expression tuple as well asstatic foreachstatements andstatic foreachdeclarations. Forstatic foreachstatements and `static foreach` declarations, the visitor interface is used (and the result is written into theresultfield.) For `static foreach` declarations, the resulting Dsymbols* are returned directly.Discussion
The unrolled body is wrapped into a
- UnrolledLoopStatement, for
foreachover an expression tuple. - ForwardingStatement, for
static foreachstatements. - ForwardingAttribDeclaration, for
static foreachdeclarations.
static foreachvariables 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.localstatic foreachvariables. - UnrolledLoopStatement, for
-
Declaration
boolpragmaMsgSemantic(Locloc, Scope*sc, Expressions*args);Evaluate and print a
pragma(msg,args)Parameters
Locloclocation for error messages
Scope*scscope for argument interpretation
Expressions*argsexpressions to print
Return Value
trueon success -
Declaration
boolpragmaStartAddressSemantic(Locloc, Scope*sc, Expressions*args);Evaluate
pragma(startAddress, func)and store the resolved symbol inargsParameters
Locloclocation for error messages
Scope*scscope for argument interpretation
Expressions*argspragma arguments
Return Value
trueon success