diff --git a/R/utils-cache.R b/R/utils-cache.R index fdbc2cbe2..97108a63d 100644 --- a/R/utils-cache.R +++ b/R/utils-cache.R @@ -163,7 +163,7 @@ cache_by_expression <- function(text, } else { expressions$stylerignore <- rep(FALSE, length(expressions$text)) } - # TODO base_indention should be set to 0 on write and on read for expressions + # TODO base_indention should be set to 0 on write and on read for expressions # (only) to make it possible to use the cache for expressions with different # indention. when not the whole input text is cached, we go trough all # expressions and check if they are cached, if yes, we take the input (from diff --git a/R/utils-navigate-nest.R b/R/utils-navigate-nest.R index 0ef6cf5da..9aeccf109 100644 --- a/R/utils-navigate-nest.R +++ b/R/utils-navigate-nest.R @@ -83,20 +83,3 @@ next_terminal <- function(pd, } } } - - -#' Find the index of the last comment in the sequence of comments-only tokens -#' after the token that has position `pos` in `pd`. -#' @param pd A parse table. -#' @param pos The position of the token to start the search from. -#' @keywords internal -extend_if_comment <- function(pd, pos) { - if (pos == nrow(pd)) { - return(pos) - } - if (pd$token[pos + 1L] == "COMMENT") { - extend_if_comment(pd, pos + 1L) - } else { - pos - } -} diff --git a/man/extend_if_comment.Rd b/man/extend_if_comment.Rd deleted file mode 100644 index eeaee1f99..000000000 --- a/man/extend_if_comment.Rd +++ /dev/null @@ -1,19 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/utils-navigate-nest.R -\name{extend_if_comment} -\alias{extend_if_comment} -\title{Find the index of the last comment in the sequence of comments-only tokens -after the token that has position \code{pos} in \code{pd}.} -\usage{ -extend_if_comment(pd, pos) -} -\arguments{ -\item{pd}{A parse table.} - -\item{pos}{The position of the token to start the search from.} -} -\description{ -Find the index of the last comment in the sequence of comments-only tokens -after the token that has position \code{pos} in \code{pd}. -} -\keyword{internal} diff --git a/tests/testthat/test-helpers.R b/tests/testthat/test-helpers.R index 139a86314..acded0ce0 100644 --- a/tests/testthat/test-helpers.R +++ b/tests/testthat/test-helpers.R @@ -15,8 +15,3 @@ test_that("can lookup tokens", { lookup_new_special() }) }) - -test_that("can extend non-comment", { - pd <- compute_parse_data_nested(c("if (TRUE) # \n call(34)")) - expect_equal(extend_if_comment(pd$child[[1]], 4), 5) -})