Skip to content

Commit 8105d43

Browse files
Drop {tibble} as a hard dependency (#1013)
1 parent 405030c commit 8105d43

17 files changed

+46
-48
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ Imports:
3131
R.cache (>= 0.15.0),
3232
rlang (>= 0.1.1),
3333
rprojroot (>= 1.1),
34-
tibble (>= 1.4.2),
3534
tools,
3635
vctrs (>= 0.4.1),
3736
withr (>= 1.0.0),
@@ -45,6 +44,7 @@ Suggests:
4544
rmarkdown,
4645
roxygen2,
4746
rstudioapi (>= 0.7),
47+
tibble (>= 1.4.2),
4848
testthat (>= 3.0.0)
4949
VignetteBuilder:
5050
knitr

NAMESPACE

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ importFrom(rlang,is_installed)
4242
importFrom(rlang,seq2)
4343
importFrom(rlang,warn)
4444
importFrom(rlang,with_handlers)
45-
importFrom(tibble,tribble)
4645
importFrom(utils,capture.output)
4746
importFrom(utils,tail)
4847
importFrom(utils,write.table)

R/environments.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ parser_version_find <- function(pd) {
5858
#' @details
5959
#' * `parser_version`: Needed to dispatch between parser versions, see
6060
#' [parser_version_set()] for details.
61-
#' * `stylerignore`: A tibble with parse data containing tokens that fall within
61+
#' * `stylerignore`: A data frame with parse data containing tokens that fall within
6262
#' a stylerignore sequence. This is used after serializing the flattened
6363
#' parse table to apply the initial formatting to these tokens. See
6464
#' [stylerignore] for details.

R/nest.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ set_spaces <- function(spaces_after_prefix, force_one) {
330330
#' a parent to other tokens (called internal) and such that are not (called
331331
#' child). Then, the token in child are joined to their parents in internal
332332
#' and all token information of the children is nested into a column "child".
333-
#' This is done recursively until we are only left with a nested tibble that
333+
#' This is done recursively until we are only left with a nested data frame that
334334
#' contains one row: The nested parse table.
335335
#' @param pd_flat A flat parse table including both terminals and non-terminals.
336336
#' @seealso [compute_parse_data_nested()]

R/nested-to-tree.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ create_tree_from_pd_with_default_style_attributes <- function(pd,
2121
}
2222

2323

24-
#' Convert a nested tibble into a node tree
24+
#' Convert a nested data frame into a node tree
2525
#'
26-
#' This function is convenient to display all nesting levels of a nested tibble
26+
#' This function is convenient to display all nesting levels of a nested data frame
2727
#' at once.
28-
#' @param pd_nested A nested tibble.
28+
#' @param pd_nested A nested data frame.
2929
#' @param structure_only Whether or not create a tree that represents the
3030
#' structure of the expression without any information on the tokens. Useful
3131
#' to check whether two structures are identical.

R/token-define.R

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,32 @@
1-
token <- tibble::tribble(
2-
~text, ~class, ~token,
3-
"&", "logical", "AND",
4-
"&&", "logical", "AND2",
5-
"|", "logical", "OR",
6-
"||", "logical", "OR2",
7-
">", "logical", "GT",
8-
"<", "logical", "LT",
9-
"<=", "logical", "LE",
10-
">=", "logical", "GE",
11-
"!=", "logical", "NE",
12-
"==", "logical", "EQ",
13-
"=", "assign_left", "EQ_SUB",
14-
"=", "assign_left", "EQ_ASSIGN",
15-
"<-", "assign_left", "LEFT_ASSIGN",
16-
"->", "assign_right", "RIGHT_ASSIGN",
17-
"+", "math", "'+'",
18-
"-", "math", "'-'",
19-
"*", "math", "'*'",
20-
"/", "math", "'/'",
21-
"^", "math", "'^'",
22-
"~", "formula", "'~'",
23-
"if", "cond", "IF",
24-
"else", "cond", "ELSE",
25-
"in", "loop_cond", "IN",
26-
"while", "loop_cond", "WHILE"
1+
token <- rbind.data.frame(
2+
c("&", "logical", "AND"),
3+
c("&&", "logical", "AND2"),
4+
c("|", "logical", "OR"),
5+
c("||", "logical", "OR2"),
6+
c(">", "logical", "GT"),
7+
c("<", "logical", "LT"),
8+
c("<=", "logical", "LE"),
9+
c(">=", "logical", "GE"),
10+
c("!=", "logical", "NE"),
11+
c("==", "logical", "EQ"),
12+
c("=", "assign_left", "EQ_SUB"),
13+
c("=", "assign_left", "EQ_ASSIGN"),
14+
c("<-", "assign_left", "LEFT_ASSIGN"),
15+
c("->", "assign_right", "RIGHT_ASSIGN"),
16+
c("+", "math", "'+'"),
17+
c("-", "math", "'-'"),
18+
c("*", "math", "'*'"),
19+
c("/", "math", "'/'"),
20+
c("^", "math", "'^'"),
21+
c("~", "formula", "'~'"),
22+
c("if", "cond", "IF"),
23+
c("else", "cond", "ELSE"),
24+
c("in", "loop_cond", "IN"),
25+
c("while", "loop_cond", "WHILE"),
26+
stringsAsFactors = FALSE
2727
)
2828

29+
colnames(token) <- c("text", "class", "token")
2930
math_token <- token$token[token$class == "math"]
3031
logical_token <- token$token[token$class == "logical"]
3132
left_assignment_token <- token$token[token$class == "assign_left"]

R/ui-styling.R

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#' @keywords api
2-
#' @importFrom tibble tribble
32
#' @importFrom magrittr %>%
43
NULL
54

R/utils-navigate-nest.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@ previous_non_comment <- function(pd, pos) {
3333
#' next terminal
3434
#' @param pd A nest.
3535
#' @param stack Whether or not to also return information on the tokens that
36-
#' are between `pd` and the first terminal, so the returned tibble can be
36+
#' are between `pd` and the first terminal, so the returned data frame can be
3737
#' understood as a transition path from `pd` to the next terminal, instead of
3838
#' the information at the terminal only. The order is inside-out,
3939
#' i.e. the first non-terminal on top, the terminal last.
4040
#' @param vars The variables to return.
4141
#' @param tokens_exclude A vector with tokens to exclude. This can be helpful if
4242
#' one wants to find the next token that is not a comment for example.
4343
#' @return
44-
#' Returns a tibble (which is **not** a valid parse table for
44+
#' Returns a data frame (which is **not** a valid parse table for
4545
#' `stack = TRUE`), with `vars` and another variable `position` that denotes
4646
#' the index each element in the transition. This can be helpful in conjunction
4747
#' with [purrr::pluck()] or [purrr::modify_in()] to reach the terminal in the

inst/WORDLIST

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ cli
2323
CMD
2424
codecov
2525
coercible
26+
coercions
2627
compat
2728
config
2829
CONST

man/create_node_from_nested.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)