Skip to content

Commit

Permalink
remove spaces even for strict = FALSE
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr committed Feb 23, 2018
1 parent 2758fd7 commit 0c7e298
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions R/rules-spacing.R
Expand Up @@ -27,9 +27,11 @@ set_space_around_op <- function(pd_flat) {
#' @param zero Character vector of tokens that should be surrounded with zero
#' spaces.
style_space_around_math_token <- function(strict, zero, one, pd_flat) {
# We remove spaces for zero (e.g., around ^ in the tidyverse style guide)
# even for strict = FALSE to be consistent with the : operator
pd_flat %>%
style_space_around_token(strict, zero, 0L) %>%
style_space_around_token(strict, one, 1L)
style_space_around_token(strict = TRUE, zero, 0L) %>%
style_space_around_token(strict = strict, one, 1L)
}

#' Set spacing of token to a certain level
Expand Down
@@ -1 +1 @@
1 + +1 - 3 / 23 * 3 ^4
1 + +1 - 3 / 23 * 3^4

0 comments on commit 0c7e298

Please sign in to comment.