1234567891011121314151617181920212223242526272829typet={location:Loc.span;message:string}letto_stringe=let{location;message}=einletlocation_string=iflocation.start.line=location.end_.linethenPrintf.sprintf"line %i, characters %i-%i"location.start.linelocation.start.columnlocation.end_.columnelsePrintf.sprintf"line %i, character %i to line %i, character %i"location.start.linelocation.start.columnlocation.end_.linelocation.end_.columninPrintf.sprintf"File \"%s\", %s:\n%s"location.filelocation_stringmessageletppfmtv=Format.fprintffmt"%s"(to_stringv)letkasprintfkfmt=Format.(kfprintf(fun_->k(flush_str_formatter()))str_formatterfmt)letkmakek?suggestion=kasprintf(funmessage->matchsuggestionwith|None->kmessage|Somesuggestion->k(message^"\nSuggestion: "^suggestion))letmake?suggestionformat=letkmessagelocation={location;message}inkmakek?suggestionformat