Skip to content

Commit

Permalink
remove unused utilities (#129)
Browse files Browse the repository at this point in the history
Before `0.4.0` release:
- `is_infix()` was used in `autolink_url()` and `href_expr()`
- `is_prefix()` was used in `href_expr()`

But refactoring in `0.4.0` release removed this reliance.
  • Loading branch information
IndrajeetPatil authored Jun 9, 2022
1 parent 51fe7db commit 64ce230
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions R/utils.R
Original file line number Diff line number Diff line change
@@ -1,28 +1,3 @@
is_infix <- function(x) {
ops <- c(
"::", ":::", "$", "@", "[", "[[", "^", "-", "+", ":", "*", "/",
"<", ">", "<=", ">=", "==", "!=", "!", "&", "&&", "|", "||", "~",
"->", "->>", "<-", "<<-", "=", "?"
)

grepl("^%.*%$", x) || x %in% ops
}

is_prefix <- function(x) {
if (is_infix(x)) {
return(FALSE)
}

special <- c(
"(", "{", "if", "for", "while", "repeat", "next", "break", "function"
)
if (x %in% special) {
return(FALSE)
}

TRUE
}

devtools_loaded <- function(x) {
if (!x %in% loadedNamespaces()) {
return(FALSE)
Expand Down

0 comments on commit 64ce230

Please sign in to comment.