The attached patch provides a (possibly naive) implementation of the remaining escape characters from:
http://www.tcl.tk/man/tcl8.5/TclCmd/Tcl.htm#M16
that were missing, namely
\ooo (octal)
\xhh (hex)
and
\uhhhh (unicode)
Supplied as a patch as I know someone's in the middle of working on the parser right now.
For this to *really* work, we need to be able to append ascii and unicode strings together with impunity. (Which *might* already work.)
> The attached patch provides a (possibly naive) implementation of the remaining escape characters from:
Withouht further looking: can't you use
src/string.c:string_unescape_cstring(), which has all these escapes already?
leo
It does the following escapes:
1 \xhh 1..2 hex digits
2 \ooo 1..3 oct digits
3 \cX control char X
4 \x{h..h} 1..8 hex digits
5 \uhhhh 4 hex digits
6 \Uhhhhhhhh 8 hex digits
7-15 \a, \b, \t, \n, \v, \f, \r, \e, \?
Per:
http://www.tcl.tk/man/tcl8.5/TclCmd/Tcl.htm#M16
does 12 different backslash substitutions. While there is some substantial overlap, there are escapes I need that this doesn't provide, but worse, escapes you provide that I don't want.
Regards.
That was me. I've just checked in this patch (slightly altered) as
part of my refactor (r8181). Thanks! :-)
--
matt diephouse
http://matt.diephouse.com