Closed tirix closed 2 years ago
What's the reason for using strfmt
? Couldn't Diagnostic
have a Display
instance instead, that does e.g.
match *diag {
BadCharacter(span, byte) => {
write!(f, "Invalid character (byte value {byte}); Metamath source files are limited to \
US-ASCII with controls TAB, CR, LF, FF)", byte = byte)?
}
Thank you Mario!
format!
macro instead of strfmt
, as you suggested,T
returned by CPS are collected in a Vec<T>
,Cow
's to pass the labels: either static or formatted strings,Arena
to ensure these live long enough (that's also an idea taken from the MM0 code)This addresses one of the items of API issues #35.
This is an attempt at using annotate_snippets::snippet::Snippet for the API, however I'm having issues with ownership ~and lifetime~ of the strings returned in the
Snippet
structures, so this is still WIP.