1414indent_without_paren_for_while_fun <- function (pd , indent_by ) {
1515 tokens <- c(" FOR" , " WHILE" , " FUNCTION" )
1616 nrow <- nrow(pd )
17- if (! (pd $ token [1 ] %in% tokens )) {
17+ if (! (pd $ token [1L ] %in% tokens )) {
1818 return (pd )
1919 }
2020 if (is_curly_expr(pd $ child [[nrow ]])) {
@@ -32,8 +32,8 @@ indent_without_paren_for_while_fun <- function(pd, indent_by) {
3232# ' @importFrom rlang seq2
3333# ' @keywords internal
3434indent_without_paren_if_else <- function (pd , indent_by ) {
35- expr_after_if <- next_non_comment(pd , which(pd $ token == " ')'" )[1 ])
36- is_if <- pd $ token [1 ] == " IF"
35+ expr_after_if <- next_non_comment(pd , which(pd $ token == " ')'" )[1L ])
36+ is_if <- pd $ token [1L ] == " IF"
3737 if (! is_if ) {
3838 return (pd )
3939 }
@@ -52,8 +52,8 @@ indent_without_paren_if_else <- function(pd, indent_by) {
5252 expr_after_else_idx <- next_non_comment(pd , else_idx )
5353 has_else_without_curly_or_else_chid <-
5454 any(pd $ token == " ELSE" ) &&
55- pd $ child [[expr_after_else_idx ]]$ token [1 ] != " '{'" &&
56- pd $ child [[expr_after_else_idx ]]$ token [1 ] != " IF"
55+ pd $ child [[expr_after_else_idx ]]$ token [1L ] != " '{'" &&
56+ pd $ child [[expr_after_else_idx ]]$ token [1L ] != " IF"
5757
5858 needs_indention_now <- pd $ lag_newlines [
5959 next_non_comment(pd , which(pd $ token == " ELSE" ))
@@ -97,7 +97,7 @@ compute_indent_indices <- function(pd,
9797 needs_indention <- needs_indention(pd , potential_triggers ,
9898 other_trigger_tokens = c(" EQ_SUB" , " EQ_FORMALS" )
9999 )
100- trigger <- potential_triggers [needs_indention ][1 ]
100+ trigger <- potential_triggers [needs_indention ][1L ]
101101 if (is.na(trigger )) {
102102 return (numeric (0 ))
103103 }
@@ -163,7 +163,7 @@ needs_indention <- function(pd,
163163needs_indention_one <- function (pd ,
164164 potential_trigger_pos ,
165165 other_trigger_tokens ) {
166- before_first_break <- which(pd $ lag_newlines > 0L )[1 ] - 1L
166+ before_first_break <- which(pd $ lag_newlines > 0L )[1L ] - 1L
167167 if (is.na(before_first_break )) {
168168 return (FALSE )
169169 }
0 commit comments