Open ltratt opened 2 years ago
I had a look through these, and it appears to me that these just want to be turned into \"{}\"
.
I.e. they are all names, etc that we wouldn't expect to contain any escape sequences. So I don't
think we need to go as far as something like \"{}\", x.escape_default()
, to try mirroring that debug
also escapes.
Edit: The above may not be right, I think actually '\'
and '"'
may be valid lex names that need escaping here.
I think actually '\' and '"' may be valid lex names that need escaping here.
Good point! Yes, this needs checking.
In a couple of places (e.g. https://github.com/softdevteam/grmtools/blob/master/lrlex/src/lib/ctbuilder.rs#L419) we use debug formatting in a non-debug location. This feels somewhat unsatisfactory, particularly as there are fewer guarantees about stability.