///|
fn Runtime::interpolate(
self : Runtime,
template : String,
context : EvaluationContext,
depth : Int32,
) -> String raise ProtocolError {
let parts = @interpolation.parse(template) catch {
error =>
raise RuntimeError(
code="EXPRESSION_ERROR",
reason="Invalid interpolation: \{Repr(error)}",
)
}
let local_context = { ..context, allow_remote: false, }
parts
.map(part => value_string(self.evaluate_at(part, local_context, depth + 1)))
.join("")
}