fromAst static method

FunctionDeclaration? fromAst(
  1. Map? ast
)

Implementation

static FunctionDeclaration? fromAst(Map? ast) {
  if (ast != null &&
      ast['type'] ==
          astNodeNameValue(AstRuntimeNodeName.FunctionDeclaration)) {
    return FunctionDeclaration(
      ast['name'],
      FunctionExpression.fromAst(ast['expression']),
      TypeName.fromAst(ast['returnType']),
    );
  }
  logDebug(_tag, 'Can not parse ast to FunctionDeclaration');
  return null;
}