Represents a list of statements that can be used in contexts requiring multiple statements, such as switch case sections or block contents.
Namespace: Metalama.Framework.Code.SyntaxBuilders
Assembly: Metalama.Framework.dll
Syntax
public interface IStatementListRemarks
IStatementList is a compile-time abstraction over a sequence of statements. Unlike regular collections, statement lists cannot be enumerated at compile time because they are evaluated lazily when the statements are inserted into the target syntax tree.
To create an IStatementList, use one of the following methods:
- List(params IStatement[]) - Create a list from a fixed array of statements
- StatementListBuilder - Build a list dynamically when the statements are determined at compile time
- UnwrapBlock(IStatement) - Extract the statement list from a block statement
- AsList(IStatement) - Convert a single statement into a singleton list