Looking into it further, it seems that interp_parse is only handling the interpolation, but the sprint(print you must call print_unescaped, which handles the standard \ sequences. That's better (not duplicating the \ handling code, both in print_unescaped and interp_parse).
Good stuff, Eric! On Wednesday, January 6, 2016 at 2:31:18 AM UTC-5, Eric Forgy wrote: > > Hi Scott, > > Thanks for the enthusiasm :) > > >> You might also want to handle the $(xxx) form of interpolation (which can >> get pretty tricky I imagine), as well as all of the \ escapes, such as \n, >> \x, \u, \U, etc. >> > > `interp_parse` was written by Stefan so you can imagine it should be > fairly complete, i.e. it does already handle $(xxx) and all escape > characters :) > > When it sees an unescaped $, it will call "parse" with greedy = false, > which continues until it finds a complete expression. This is how it > handles $(xxx). >