% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/is_lint_level.R
\name{is_lint_level}
\alias{is_lint_level}
\title{Is this an expression- or a file-level source object?}
\usage{
is_lint_level(source_expression, level = c("expression", "file"))
}
\arguments{
\item{source_expression}{A parsed expression object, i.e., an element
of the object returned by \code{\link[=get_source_expressions]{get_source_expressions()}}.}

\item{level}{Which level of expression is being tested? \code{"expression"}
means an individual expression, while \code{"file"} means all expressions
in the current file are available.}
}
\description{
Helper for determining whether the current \code{source_expression} contains
all expressions in the current file, or just a single expression.
}
\examples{
tmp <- tempfile()
writeLines(c("x <- 1", "y <- x + 1"), tmp)
source_exprs <- get_source_expressions(tmp)
is_lint_level(source_exprs$expressions[[1L]], level = "expression")
is_lint_level(source_exprs$expressions[[1L]], level = "file")
is_lint_level(source_exprs$expressions[[3L]], level = "expression")
is_lint_level(source_exprs$expressions[[3L]], level = "file")
unlink(tmp)

}
