Open sandboxFocus

Method UnwrapBlock

UnwrapBlock(IStatement)

Extracts an IStatementList from a block statement, or creates a singleton list if the statement is not a block.

Declaration
public static IStatementList UnwrapBlock(IStatement statement)
Parameters
Type Name Description
IStatement statement

The statement to unwrap.

Returns
Type Description
IStatementList

An IStatementList containing the statements from the block if statement is a block, or a singleton list containing the statement itself if it is not a block.

Remarks

This method is useful when you need to work with the individual statements inside a block, or when you want to treat any statement uniformly as a list of statements.