fromAst static method

IfStatement? fromAst(
  1. Map? ast
)

Implementation

static IfStatement? fromAst(Map? ast) {
  if (ast != null &&
      ast['type'] == astNodeNameValue(AstRuntimeNodeName.IfStatement)) {
    return IfStatement(
        AstRuntimeNodeParser.fromAst(ast['condition']),
        AstRuntimeNodeParser.fromAst(ast['consequent']),
        AstRuntimeNodeParser.fromAst(ast['alternate']));
  }
  logDebug(_tag, 'Can not parse ast to IfStatement');
  return null;
}