Skip to content

Commit 4833340

Browse files
quoted key does not mean aligned per se
1 parent 47a7126 commit 4833340

File tree

4 files changed

+55
-1
lines changed

4 files changed

+55
-1
lines changed

R/detect-alignment-utils.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ alignment_col1_all_named <- function(relevant_pd_by_line) {
8080
if (nrow(x) < 3) {
8181
return(FALSE)
8282
}
83-
identical(x$token[c(1, 3)], c("SYMBOL_SUB", "expr")) &&
83+
x$token[3] == "expr" &&
84+
x$token[1] %in% c("SYMBOL_SUB", "STR_CONST") &&
8485
x$token[2] %in% c(
8586
"EQ_SUB", "SPECIAL-IN", "LT", "GT", "EQ", "NE"
8687
)
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
df <- dplyr::rename(df,
2+
"xValues" = "Time",
3+
"xUnit" = "TimeUnit",
4+
"yValues" = "simulationValues",
5+
"yUnit" = "unit",
6+
"yDimension" = "dimension"
7+
)

tests/testthat/alignment/quoted-names-in_tree

Lines changed: 39 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
df <- dplyr::rename(df,
2+
"xValues" = "Time",
3+
"xUnit" = "TimeUnit",
4+
"yValues" = "simulationValues",
5+
"yUnit" = "unit",
6+
"yDimension" = "dimension"
7+
)

0 commit comments

Comments
 (0)