On Thu, 2007-04-26 at 10:52 -0400, Chris King wrote:
> > In this case .. attempts to make the code look nice
> > turn out to cause a bug. AFAICR trailing whitespace
> > is elided (because you can't see it). Thus
> >
> > """hello
> > """
> >
> > will be 'hello\n' even if you put extra ' ' after hello.
> > If you put
> >
> > """hello \
> > """
> >
> > it adds the white space .. but removes the \n ... ;(
>
> Keep this behavior!
Argg .. well actually I lied .. :)
the lexer has these definitions (in lpsrc/flx_lexer.ipk):
(* string parsers *)
let decode_qstring s = let n = len s in unescape (substr s 0 (n-1))
let decode_dstring s = let n = len s in unescape (substr s 0 (n-1))
let decode_qqqstring s = let n = len s in unescape (substr s 0 (n-3))
let decode_dddstring s = let n = len s in unescape (substr s 0 (n-3))
let decode_raw_qstring s = let n = len s in substr s 0 (n-1)
let decode_raw_dstring s = let n = len s in substr s 0 (n-1)
let decode_raw_qqqstring s = let n = len s in substr s 0 (n-3)
let decode_raw_dddstring s = let n = len s in substr s 0 (n-3)
Here 'unescape' processes escape codes, it is defined in
lpsrc/flx_string.ipk
All strings are lexed by these functions, whether they're
wide, unicode, C null-term strings, q"verba$tim" strings or
f"or%mat" strings... that is the string is taken 'as written'
if it is a raw string, otherwise the string with internal
escape code processed.
however every case is separately decoded, so we could replace
any of the algorithms as desired.
The 'naming' mechanism is horrible IMHO, using
f" ..
c" ..
r" ..
q" ..
rc" ..
starting to look Perlish .. :)
--
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Felix-language mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/felix-language