File: split_source.Rd

package info (click to toggle)
r-cran-xfun 0.20-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 680 kB
  • sloc: ansic: 242; sh: 22; makefile: 2
file content (22 lines) | stat: -rw-r--r-- 554 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/string.R
\name{split_source}
\alias{split_source}
\title{Split source lines into complete expressions}
\usage{
split_source(x)
}
\arguments{
\item{x}{A character vector of R source code.}
}
\value{
A list of character vectors, and each vector contains a complete R
  expression.
}
\description{
Parse the lines of code one by one to find complete expressions in the code,
and put them in a list.
}
\examples{
xfun::split_source(c("if (TRUE) {", "1 + 1", "}", "print(1:5)"))
}