[Rd] [WISH / PATCH] possibility to split string literals across multiple lines
r-devel at akersting.de
Wed Jun 14 12:58:38 CEST 2017
I would really like to have a way to split long string literals across
multiple lines in R.
Currently, if a string literal spans multiple lines, there is no way to
inhibit the introduction of newline characters:
If a line ends with a backslash, it is just ignored:
We could use this fact to implement string splitting in a fairly
backward-compatible way, since currently such trailing backslashes
should hardly be used as they do not have any effect. The attached patch
makes the parser ignore a newline character directly following a backslash:
I personally would also prefer if leading blanks (spaces and tabs) in
the second line are ignored to allow for proper indentation:
> "aaa \
 "aaa bbb"
+ \ bbb"
 "aaa bbb"
This is also implemented by this patch.
An alternative approach could be to have something like
be interpreted as "aaa bbb".
I don't know the ins and outs of the parser of R (hence: please very
carefully review the attached patch), but I guess this would be more
work to implement!?
What do you think? Is there anybody else who is missing this feature in
the first place?
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 2598 bytes
Desc: not available
More information about the R-devel