---input---
\name{foo}
\alias{foo}
% I'm a comment
\title{The foo function}

\description{It doesn't do much}

\usage{
foo(x, y)
}

\arguments{
  \item{x}{A number}
  \item{y}{Another number}
}
\details{
  I just adds \code{x} and \code{y}, 
}
\value{\code{numeric}. The sum of \code{x} and \code{y}.}
\references{
  \href{http://en.wikipedia.org/wiki/Sum}{Sum}
}
\author{
  Anonymous
}
\note{
  Lorem ipsum \dots \R \emph{emp}, \strong{strong}, \bold{bold},
  \sQuote{single quotes}, \dQuote{double quotes}, \code{code},
  \preformatted{x <- 2 + 2}, \kbd{type this}, \samp{literal seq},
  \pkg{base}, \file{foo.txt}, \email{email@hostname},
  \url{http://cran.r-project.org/}, \var{foo}, \env{HOME},
  \option{-d}, \dfn{something new}, \acronym{GNU}.

  Escaped symbols: \\ \{ \} \% not comment. \\NotAMacro.
  
   \tabular{rlll}{
         [,1] \tab alpha   \tab numeric \tab A (ppb)\cr
         [,2] \tab bravo \tab integer \tab B \cr
         [,3] \tab charlie    \tab character \tab C \cr
       }
   \enumerate{
         \item delta
         \item echo
       }
   \itemize{
         \item foxtrot
         \item golf
       }
  
  \deqn{p(x; \mu, \sigma^2) = \frac{1}{\sigma \sqrt{2 \pi}} \exp \frac{-(x - \mu)^2}{2 \sigma}{%
             p(\mu; x) = 1/\sigma (2 \pi)^(-1/2)  exp( -(x - \mu)^2 / (2 \sigma)) }
       for \eqn{x = 0, 1, 2, \ldots}.
  
  \if{latex}{\out{\beta}}\ifelse{html}{\out{&beta;}}{beta}

#ifdef unix
Now windows
#endif
#ifndef windows
Using windows
#endif

}
\section{Misc}{
  Stuff.
}

\seealso{
  \code{\link{sum}}
}
\examples{
x <- 1
y <- 2
z <- foo(x, y)
\dontrun{plot(z)}
\dontshow{log(x)}
}
\keyword{arith}

---tokens---
'\\name'      Keyword
'{'           Name.Builtin
'foo'         Text
'}'           Name.Builtin
'\n'          Text

'\\alias'     Keyword
'{'           Name.Builtin
'foo'         Text
'}'           Name.Builtin
'\n'          Text

"% I'm a comment" Comment
'\n'          Text

'\\title'     Keyword
'{'           Name.Builtin
'The foo function' Text
'}'           Name.Builtin
'\n'          Text

'\n'          Text

'\\description' Keyword
'{'           Name.Builtin
"It doesn't do much" Text
'}'           Name.Builtin
'\n'          Text

'\n'          Text

'\\usage'     Keyword
'{'           Name.Builtin
'\n'          Text

'foo(x, y)'   Text
'\n'          Text

'}'           Name.Builtin
'\n'          Text

'\n'          Text

'\\arguments' Keyword
'{'           Name.Builtin
'\n'          Text

'  '          Text
'\\item'      Keyword
'{'           Name.Builtin
'x'           Text
'}'           Name.Builtin
'{'           Name.Builtin
'A number'    Text
'}'           Name.Builtin
'\n'          Text

'  '          Text
'\\item'      Keyword
'{'           Name.Builtin
'y'           Text
'}'           Name.Builtin
'{'           Name.Builtin
'Another number' Text
'}'           Name.Builtin
'\n'          Text

'}'           Name.Builtin
'\n'          Text

'\\details'   Keyword
'{'           Name.Builtin
'\n'          Text

'  I just adds ' Text
'\\code'      Keyword
'{'           Name.Builtin
'x'           Text
'}'           Name.Builtin
' and '       Text
'\\code'      Keyword
'{'           Name.Builtin
'y'           Text
'}'           Name.Builtin
', '          Text
'\n'          Text

'}'           Name.Builtin
'\n'          Text

'\\value'     Keyword
'{'           Name.Builtin
'\\code'      Keyword
'{'           Name.Builtin
'numeric'     Text
'}'           Name.Builtin
'. The sum of ' Text
'\\code'      Keyword
'{'           Name.Builtin
'x'           Text
'}'           Name.Builtin
' and '       Text
'\\code'      Keyword
'{'           Name.Builtin
'y'           Text
'}'           Name.Builtin
'.'           Text
'}'           Name.Builtin
'\n'          Text

'\\references' Keyword
'{'           Name.Builtin
'\n'          Text

'  '          Text
'\\href'      Keyword
'{'           Name.Builtin
'http://en.wikipedia.org/wiki/Sum' Text
'}'           Name.Builtin
'{'           Name.Builtin
'Sum'         Text
'}'           Name.Builtin
'\n'          Text

'}'           Name.Builtin
'\n'          Text

'\\author'    Keyword
'{'           Name.Builtin
'\n'          Text

'  Anonymous' Text
'\n'          Text

'}'           Name.Builtin
'\n'          Text

'\\note'      Keyword
'{'           Name.Builtin
'\n'          Text

'  Lorem ipsum ' Text
'\\dots'      Keyword.Constant
' '           Text
'\\R'         Keyword.Constant
' '           Text
'\\emph'      Keyword
'{'           Name.Builtin
'emp'         Text
'}'           Name.Builtin
', '          Text
'\\strong'    Keyword
'{'           Name.Builtin
'strong'      Text
'}'           Name.Builtin
', '          Text
'\\bold'      Keyword
'{'           Name.Builtin
'bold'        Text
'}'           Name.Builtin
','           Text
'\n'          Text

'  '          Text
'\\sQuote'    Keyword
'{'           Name.Builtin
'single quotes' Text
'}'           Name.Builtin
', '          Text
'\\dQuote'    Keyword
'{'           Name.Builtin
'double quotes' Text
'}'           Name.Builtin
', '          Text
'\\code'      Keyword
'{'           Name.Builtin
'code'        Text
'}'           Name.Builtin
','           Text
'\n'          Text

'  '          Text
'\\preformatted' Keyword
'{'           Name.Builtin
'x <- 2 + 2'  Text
'}'           Name.Builtin
', '          Text
'\\kbd'       Keyword
'{'           Name.Builtin
'type this'   Text
'}'           Name.Builtin
', '          Text
'\\samp'      Keyword
'{'           Name.Builtin
'literal seq' Text
'}'           Name.Builtin
','           Text
'\n'          Text

'  '          Text
'\\pkg'       Keyword
'{'           Name.Builtin
'base'        Text
'}'           Name.Builtin
', '          Text
'\\file'      Keyword
'{'           Name.Builtin
'foo.txt'     Text
'}'           Name.Builtin
', '          Text
'\\email'     Keyword
'{'           Name.Builtin
'email@hostname' Text
'}'           Name.Builtin
','           Text
'\n'          Text

'  '          Text
'\\url'       Keyword
'{'           Name.Builtin
'http://cran.r-project.org/' Text
'}'           Name.Builtin
', '          Text
'\\var'       Keyword
'{'           Name.Builtin
'foo'         Text
'}'           Name.Builtin
', '          Text
'\\env'       Keyword
'{'           Name.Builtin
'HOME'        Text
'}'           Name.Builtin
','           Text
'\n'          Text

'  '          Text
'\\option'    Keyword
'{'           Name.Builtin
'-d'          Text
'}'           Name.Builtin
', '          Text
'\\dfn'       Keyword
'{'           Name.Builtin
'something new' Text
'}'           Name.Builtin
', '          Text
'\\acronym'   Keyword
'{'           Name.Builtin
'GNU'         Text
'}'           Name.Builtin
'.'           Text
'\n'          Text

'\n'          Text

'  Escaped symbols: ' Text
'\\\\'        Literal.String.Escape
' '           Text
'\\{'         Literal.String.Escape
' '           Text
'\\}'         Literal.String.Escape
' '           Text
'\\%'         Literal.String.Escape
' not comment. ' Text
'\\\\'        Literal.String.Escape
'NotAMacro.'  Text
'\n'          Text

'  '          Text
'\n'          Text

'   '         Text
'\\tabular'   Keyword
'{'           Name.Builtin
'rlll'        Text
'}'           Name.Builtin
'{'           Name.Builtin
'\n'          Text

'         [,1] ' Text
'\\tab'       Keyword.Constant
' alpha   '   Text
'\\tab'       Keyword.Constant
' numeric '   Text
'\\tab'       Keyword.Constant
' A (ppb)'    Text
'\\cr'        Keyword.Constant
'\n'          Text

'         [,2] ' Text
'\\tab'       Keyword.Constant
' bravo '     Text
'\\tab'       Keyword.Constant
' integer '   Text
'\\tab'       Keyword.Constant
' B '         Text
'\\cr'        Keyword.Constant
'\n'          Text

'         [,3] ' Text
'\\tab'       Keyword.Constant
' charlie    ' Text
'\\tab'       Keyword.Constant
' character ' Text
'\\tab'       Keyword.Constant
' C '         Text
'\\cr'        Keyword.Constant
'\n'          Text

'       '     Text
'}'           Name.Builtin
'\n'          Text

'   '         Text
'\\enumerate' Keyword
'{'           Name.Builtin
'\n'          Text

'         '   Text
'\\item'      Keyword
' delta'      Text
'\n'          Text

'         '   Text
'\\item'      Keyword
' echo'       Text
'\n'          Text

'       '     Text
'}'           Name.Builtin
'\n'          Text

'   '         Text
'\\itemize'   Keyword
'{'           Name.Builtin
'\n'          Text

'         '   Text
'\\item'      Keyword
' foxtrot'    Text
'\n'          Text

'         '   Text
'\\item'      Keyword
' golf'       Text
'\n'          Text

'       '     Text
'}'           Name.Builtin
'\n'          Text

'  '          Text
'\n'          Text

'  '          Text
'\\deqn'      Keyword
'{'           Name.Builtin
'p(x; '       Text
'\\mu'        Keyword
', '          Text
'\\sigma'     Keyword
'^2) = '      Text
'\\frac'      Keyword
'{'           Name.Builtin
'1'           Text
'}'           Name.Builtin
'{'           Name.Builtin
'\\sigma'     Keyword
' '           Text
'\\sqrt'      Keyword
'{'           Name.Builtin
'2 '          Text
'\\pi'        Keyword
'}'           Name.Builtin
'}'           Name.Builtin
' '           Text
'\\exp'       Keyword
' '           Text
'\\frac'      Keyword
'{'           Name.Builtin
'-(x - '      Text
'\\mu'        Keyword
')^2'         Text
'}'           Name.Builtin
'{'           Name.Builtin
'2 '          Text
'\\sigma'     Keyword
'}'           Name.Builtin
'{'           Name.Builtin
'%'           Comment
'\n'          Text

'             p(' Text
'\\mu'        Keyword
'; x) = 1/'   Text
'\\sigma'     Keyword
' (2 '        Text
'\\pi'        Keyword
')^(-1/2)  exp( -(x - ' Text
'\\mu'        Keyword
')^2 / (2 '   Text
'\\sigma'     Keyword
')) '         Text
'}'           Name.Builtin
'\n'          Text

'       for ' Text
'\\eqn'       Keyword
'{'           Name.Builtin
'x = 0, 1, 2, ' Text
'\\ldots'     Keyword.Constant
'}'           Name.Builtin
'.'           Text
'\n'          Text

'  '          Text
'\n'          Text

'  '          Text
'\\if'        Keyword
'{'           Name.Builtin
'latex'       Text
'}'           Name.Builtin
'{'           Name.Builtin
'\\out'       Keyword
'{'           Name.Builtin
'\\beta'      Keyword
'}'           Name.Builtin
'}'           Name.Builtin
'\\ifelse'    Keyword
'{'           Name.Builtin
'html'        Text
'}'           Name.Builtin
'{'           Name.Builtin
'\\out'       Keyword
'{'           Name.Builtin
'&beta;'      Text
'}'           Name.Builtin
'}'           Name.Builtin
'{'           Name.Builtin
'beta'        Text
'}'           Name.Builtin
'\n'          Text

'\n#ifdef unix' Comment.Preproc
'\n'          Text

'Now windows' Text
'\n'          Text

'#endif'      Comment.Preproc
'\n'          Text

'#ifndef windows' Comment.Preproc
'\n'          Text

'Using windows' Text
'\n'          Text

'#endif'      Comment.Preproc
'\n'          Text

'\n'          Text

'}'           Name.Builtin
'\n'          Text

'\\section'   Keyword
'{'           Name.Builtin
'Misc'        Text
'}'           Name.Builtin
'{'           Name.Builtin
'\n'          Text

'  Stuff.'    Text
'\n'          Text

'}'           Name.Builtin
'\n'          Text

'\n'          Text

'\\seealso'   Keyword
'{'           Name.Builtin
'\n'          Text

'  '          Text
'\\code'      Keyword
'{'           Name.Builtin
'\\link'      Keyword
'{'           Name.Builtin
'sum'         Text
'}'           Name.Builtin
'}'           Name.Builtin
'\n'          Text

'}'           Name.Builtin
'\n'          Text

'\\examples'  Keyword
'{'           Name.Builtin
'\n'          Text

'x <- 1'      Text
'\n'          Text

'y <- 2'      Text
'\n'          Text

'z <- foo(x, y)' Text
'\n'          Text

'\\dontrun'   Keyword
'{'           Name.Builtin
'plot(z)'     Text
'}'           Name.Builtin
'\n'          Text

'\\dontshow'  Keyword
'{'           Name.Builtin
'log(x)'      Text
'}'           Name.Builtin
'\n'          Text

'}'           Name.Builtin
'\n'          Text

'\\keyword'   Keyword
'{'           Name.Builtin
'arith'       Text
'}'           Name.Builtin
'\n'          Text
