parseInterpolationImpl method

  1. @override
AST? parseInterpolationImpl(
  1. String input,
  2. String location,
  3. List<CompileIdentifierMetadata> exports
)
override

Override to implement parseInterpolation.

Basic validation is already performed that input is seemingly valid.

Implementation

@override
ast.AST? parseInterpolationImpl(
  String input,
  String location,
  List<CompileIdentifierMetadata> exports,
) {
  final split = splitInterpolation(input, location);
  if (split == null) {
    return null;
  }
  return ast.Interpolation(
    split.strings,
    split.expressions
        .map(
          (e) => parseExpression(
            e,
            location,
            allowAssignments: false,
            exports: exports,
          ),
        )
        .toList(),
  );
}