From 6188a1dabebe403d9a96b56de5455134c46f7529 Mon Sep 17 00:00:00 2001 From: Yihui Xie Date: Fri, 14 Jun 2024 17:09:37 -0500 Subject: [PATCH] swap try() and suppressWarnings() --- R/string.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/string.R b/R/string.R index 1e7c62b..ea7a08f 100644 --- a/R/string.R +++ b/R/string.R @@ -221,7 +221,7 @@ split_source = function(x, merge_comments = FALSE, line_number = FALSE) { #' xfun::valid_syntax('1+') #' xfun::valid_syntax(c('if(T){1+1}', 'else {2+2}'), silent = FALSE) valid_syntax = function(code, silent = TRUE) { - !inherits(try(suppressWarnings(parse_only(code)), silent = silent), 'try-error') + !inherits(suppressWarnings(try(parse_only(code)), silent = silent), 'try-error') } #' Bump version numbers