Movatterモバイル変換


[0]ホーム

URL:


D Logo
Menu
Search

Library Reference

version 2.110.0

overview

Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page.Requires a signed-in GitHub account. This works well for small changes.If you'd like to make larger changes you may want to consider usinga local clone.

dmd.statementsem

Does semantic analysis for statements.

SpecificationStatements

Authors:
Walter Bright
License:
Boost License 1.0

Sourcestatementsem.d

Documentationhttps://dlang.org/phobos/dmd_statementsem.html

Coveragehttps://codecov.io/gh/dlang/dmd/src/master/src/dmd/statementsem.d

StatementstatementSemantic(Statements, Scope*sc);
Performs semantic analysis in Statement AST nodes
Parameters:
Statementsstatement to perform semantic analysis on
Scope*scscope in which statement resides
Returns:
statements after semantic analysis. Can benull, for example withpragma(msg, "")
boolthrowSemantic(const ref Locloc, ref Expressionexp, Scope*sc);
Run semantic onthrow <exp>.
Parameters:
Locloclocation of thethrow
Expressionexpvalue to be thrown
Scope*scenclosing scope
Returns:
true if thethrow is valid, or false if an error was found
StatementscopeCode(Statementstatement, Scope*sc, out Statementsentry, out Statementsexception, out Statementsfinally);
Ifstatement 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.
Parameters:
Statementstatementthe statement
Scope*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
Returns:
code to be run in the finally clause
automakeTupleForeach(Scope*sc, boolisStatic, boolisDecl, ForeachStatementfs, Dsymbols*dbody, boolneedExpansion);
Type check and unrollforeach 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.
The unrolled body is wrapped into a
  • UnrolledLoopStatement, forforeach over an expression tuple.
  • ForwardingStatement, forstatic foreach statements.
  • ForwardingAttribDeclaration, forstatic 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.localstatic foreach variables.
boolcheckLabel(GotoStatementgs);
Check for skipped variable declarations.
Parameters:
GotoStatementgsstatement to check
Returns:
true for error
Copyright © 1999-2025 by theD Language Foundation | Page generated byDdoc on Thu Mar 27 23:09:38 2025

[8]ページ先頭

©2009-2025 Movatter.jp