Skip to content

Commit

Permalink
Merge pull request #1250 from r-lib/rm-unused-helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
IndrajeetPatil authored Dec 11, 2024
2 parents ba3fe63 + c320dc4 commit 84f250a
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 42 deletions.
2 changes: 1 addition & 1 deletion R/utils-cache.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 0 additions & 17 deletions R/utils-navigate-nest.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
19 changes: 0 additions & 19 deletions man/extend_if_comment.Rd

This file was deleted.

5 changes: 0 additions & 5 deletions tests/testthat/test-helpers.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})

0 comments on commit 84f250a

Please # to comment.