visitStringInterpolationExpr method
Implementation
@override
Uint8List visitStringInterpolationExpr(ASTStringInterpolation expr) {
final bytesBuilder = BytesBuilder();
bytesBuilder.addByte(HTOpCode.local);
bytesBuilder.addByte(HTValueTypeCode.stringInterpolation);
var literal = expr.text;
_lexicon.escapeCharacters.forEach((key, value) {
literal = literal.replaceAll(key, value);
});
bytesBuilder.add(_utf8String(literal));
bytesBuilder.addByte(expr.interpolations.length);
for (final node in expr.interpolations) {
final bytes = compileAST(node, endOfExec: true);
bytesBuilder.add(bytes);
}
return bytesBuilder.toBytes();
}