[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ess-help
Subject:    Re: [ESS] Folding chunks in Sweave?
From:       "A.J. Rossini" <blindglobe () gmail ! com>
Date:       2006-07-31 14:12:32
Message-ID: 1abe3fa90607310712s3cfe140y4c0f54a4be7c801c () mail ! gmail ! com
[Download RAW message or body]

On 7/24/06, Thomas Lumley <tlumley@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@gmail.com
Muttenz, Switzerland.
"Commit early,commit often, and commit in a repository from which we can easily
roll-back your mistakes" (AJR, 4Jan05).


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic