Skip to content

Commit e73247a

Browse files
committed
Use is_syntactic_literal()
1 parent 3c42193 commit e73247a

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

R/quasi-label.R

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,22 +90,17 @@ auto_label <- function(expr, value) {
9090
}
9191

9292
can_inline <- function(x) {
93-
if (is.null(x)) {
94-
return(TRUE)
95-
}
96-
if (!is.atomic(x) || !is.vector(x)) {
93+
if (!is_syntactic_literal(x)) {
9794
return(FALSE)
9895
}
99-
if (length(x) != 1) {
96+
if (!is.null(dim(x))) {
10097
return(FALSE)
10198
}
10299

103100
if (is.character(x)) {
104101
is.na(x) || (!grepl("\n", x) && nchar(x) < 100)
105-
} else if (is.logical(x) || is.numeric(x)) {
106-
TRUE
107102
} else {
108-
FALSE
103+
TRUE
109104
}
110105
}
111106

0 commit comments

Comments
 (0)