Report a bugIf you spot a problem with this page, click here to create a Bugzilla issue.
Improve this pageQuickly 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.init
Defines initializers of variables, e.g. the array literal inint[3] x = [0, 1, 2].
class
Initializer:
dmd.ast_node.ASTNode;
initializerSemantic has been run on this
class
VoidInitializer:
dmd.init.Initializer;
class
DefaultInitializer:
dmd.init.Initializer;
The C23 default initializer{ }
class
ErrorInitializer:
dmd.init.Initializer;
class
StructInitializer:
dmd.init.Initializer;
class
ArrayInitializer:
dmd.init.Initializer;
class
ExpInitializer:
dmd.init.Initializer;
Holds thedesignator for C initializers
[ constant-expression ]
. identifier
Holds thedesignation (opt) initializer for C initializers
Designators*
designatorList;
designation (opt)
initializer
class
CInitializer:
dmd.init.Initializer;
C11 6.7.9 Initialization Represents the C initializer-list
DesigInits
initializerList;
initializer-list
type that array will be used to initialize
Initializer
syntaxCopy(Initializer
inx);
Copy the AST for Initializer.
Parameters:Initializerinx | Initializer AST to copy |
Result
VisitInitializer(Result)(Initializer
init);
Visit each Initializer in init. Call a function visit%s(init) for each node, where %s is the op of the node. Otherwise call visitDefault(init) for that node. If the visit function returns R.init, continue visiting each node, otherwise return the value of R.
Parameters:| Result | return type |
Initializerinit | Initializer tree to traverse |
Returns:Result.init for continue, value of type Result for early exit
pure @safe string
visitCase(string
handler);
CTFE-only helper function for VisitInitializer.
Parameters:stringhandler | string for the name of the visit handler |
Returns:boilerplate code for a case