createDiTokenExpression function
Implementation
o.Expression createDiTokenExpression(CompileTokenMetadata token) {
if (token.identifierIsInstance) {
return o.importExpr(token.identifier!).instantiate(
token.value != null ? [o.literal(token.value)] : const <o.Expression>[],
type: o.importType(token.identifier, [], [o.TypeModifier.Const]),
genericTypes: token.identifier!.typeArguments.isNotEmpty
? token.identifier!.typeArguments
: null);
} else if (token.value != null) {
return o.literal(token.value);
} else {
return o.importExpr(token.identifier!);
}
}