fromAst static method

IfStatement? fromAst(
  1. Map? ast
)

Implementation

static IfStatement? fromAst(Map? ast) {
  if (ast != null &&
      ast['type'] == astNodeNameValue(AstNodeName.IfStatement)) {
    return IfStatement(
        BinaryExpression.fromAst(ast['condition']),
        BlockStatement.fromAst(ast['consequent']),
        BlockStatement.fromAst(ast['alternate']),
        ast: ast);
  }
  return null;
}