[ESS] Folding chunks in Sweave?

A.J. Rossini blindglobe at gmail.com
Mon Jul 31 16:12:32 CEST 2006


On 7/24/06, Thomas Lumley <tlumley at u.washington.edu> wrote:

> I don't think any sane R code will have a @ at the start of a line, but if
> you want to rule out insane code you will need to count parentheses
> carefully, eg
> <<>>
> 1 + (a # )
> @
> b
>
> This can't be done with a regexp -- it takes a stack machine to check that
> parentheses are matched. On the other hand, Sweave itself just uses the
> regexp "^@" to match the end of a code chunk, and there is presumably no
> need to handle Sweave syntax better than Sweave does.
>

Noweb format explicitly defines "@" as the first char in a line as the
code-chunk end; I don't believe that Sweave refined that format with
other definitions.

best,
-tony

blindglobe at gmail.com
Muttenz, Switzerland.
"Commit early,commit often, and commit in a repository from which we can easily
roll-back your mistakes" (AJR, 4Jan05).




More information about the ESS-help mailing list