fromAst static method

BlockStatement? fromAst(
  1. Map? ast
)

Implementation

static BlockStatement? fromAst(Map? ast) {
  if (ast != null &&
      ast['type'] == astNodeNameValue(AstNodeName.BlockStatement)) {
    var astBody = ast['body'] as List;
    var bodies = <Expression?>[];
    for (var arg in astBody) {
      bodies.add(Expression.fromAst(arg));
    }
    return BlockStatement(bodies, ast: ast);
  }
  return null;
}