convertCdExpressionToIr function

Expression convertCdExpressionToIr(
  1. NameResolver nameResolver,
  2. Expression implicitReceiver,
  3. AST expression,
  4. SourceSpan? expressionSourceSpan,
  5. CompileDirectiveMetadata metadata, {
  6. OutputType? boundType,
})

Converts a bound AST expression to an o.Expression.

If specified, boundType is the type of the input to which expression is bound. This is used to support empty expressions for boolean inputs, and to type annotate collection literal bindings.

Implementation

o.Expression convertCdExpressionToIr(
  NameResolver nameResolver,
  o.Expression implicitReceiver,
  compiler_ast.AST expression,
  SourceSpan? expressionSourceSpan,
  CompileDirectiveMetadata metadata, {
  o.OutputType? boundType,
}) {
  final visitor = _AstToExpressionVisitor(
    nameResolver,
    implicitReceiver,
    metadata,
    boundType,
  );
  return _visit(expression, visitor, expressionSourceSpan);
}