I haven't actually looked at this code, but lockingTextWriter
is what D calls an output range.
It's simply a struct with a method called put
that accepts a string as an argument. So, you might be able to get the info as a string by doing this:
struct StringSink {
string result;
void put(in char[] s) { result ~= s; }
}
StringSink sink;
context.localStart(sf, &sink);
.....
string result = sink.result;
or something along those lines.