@@ -52,7 +52,7 @@ flatten_operators_one <- function(pd_nested) {
5252# ' from left or from right.
5353# ' @keywords internal
5454flatten_pd <- function (pd_nested , token , child_token = token , left = TRUE ) {
55- token_pos_candidates <- which(pd_nested $ token [- 1 ] %in% token ) + 1L
55+ token_pos_candidates <- which(pd_nested $ token [- 1L ] %in% token ) + 1L
5656 if (length(token_pos_candidates ) == 0L ) {
5757 return (pd_nested )
5858 }
@@ -70,7 +70,7 @@ flatten_pd <- function(pd_nested, token, child_token = token, left = TRUE) {
7070 if (pos < 1L ) {
7171 return (pd_nested )
7272 }
73- if (! any(pd_nested $ child [[pos ]]$ token [- 1 ] %in% child_token )) {
73+ if (! any(pd_nested $ child [[pos ]]$ token [- 1L ] %in% child_token )) {
7474 return (pd_nested )
7575 }
7676 bind_with_child(pd_nested , pos )
@@ -102,8 +102,8 @@ wrap_expr_in_expr <- function(pd) {
102102 pos_ids = create_pos_ids(pd , 1 , after = FALSE ),
103103 child = pd ,
104104 terminal = FALSE ,
105- stylerignore = pd $ stylerignore [1 ],
106- indents = pd $ indent [1 ]
105+ stylerignore = pd $ stylerignore [1L ],
106+ indents = pd $ indent [1L ]
107107 )
108108}
109109
@@ -214,7 +214,7 @@ find_block_id <- function(pd) {
214214# ' @keywords internal
215215relocate_eq_assign_one <- function (pd ) {
216216 idx_eq_assign <- which(pd $ token == " EQ_ASSIGN" )
217- eq_ind <- seq2(idx_eq_assign [1 ] - 1L , last(idx_eq_assign ) + 1L )
217+ eq_ind <- seq2(idx_eq_assign [1L ] - 1L , last(idx_eq_assign ) + 1L )
218218 # initialize because wrap_expr_in_expr -> create_tokens -> requires it
219219 pd $ indent <- 0
220220 eq_expr <- pd [eq_ind , ] %> %
@@ -240,9 +240,9 @@ relocate_eq_assign_one <- function(pd) {
240240# ' @keywords internal
241241add_line_col_to_wrapped_expr <- function (pd ) {
242242 if (nrow(pd ) > 1 ) abort(" pd must be a wrapped expression that has one row." )
243- pd $ line1 <- pd $ child [[1 ]]$ line1 [1 ]
244- pd $ line2 <- last(pd $ child [[1 ]]$ line2 )
245- pd $ col1 <- pd $ child [[1 ]]$ col1 [1 ]
246- pd $ col2 <- last(pd $ child [[1 ]]$ col2 )
243+ pd $ line1 <- pd $ child [[1L ]]$ line1 [1L ]
244+ pd $ line2 <- last(pd $ child [[1L ]]$ line2 )
245+ pd $ col1 <- pd $ child [[1L ]]$ col1 [1L ]
246+ pd $ col2 <- last(pd $ child [[1L ]]$ col2 )
247247 pd
248248}
0 commit comments