fromValue static method

ASTValue fromValue(
  1. dynamic o
)

Implementation

static ASTValue fromValue(dynamic o) {
  if (o == null) return ASTValueNull.instance;

  if (o is ASTValue) return o;

  if (o is String) return ASTValueString(o);
  if (o is int) return ASTValueInt(o);
  if (o is double) return ASTValueDouble(o);
  if (o is bool) return ASTValueBool(o);

  var t = ASTType.from(o);
  return ASTValue.from(t, o);
}