public StmtBlock(Ctx ctx, IEnumerable<Stmt> statements)
: base(ctx) {
// Expand any nested blocks. Evaluate to array.
this.Statements = statements.SelectMany(x => {
if (x == null) {
return Enumerable.Empty<Stmt>();
}
if (x.StmtType == NodeType.Block) {
return ((StmtBlock)x).Statements;
}
return new[] { x };
}).Where(x => x != null).ToArray();
}