Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Throw informative error for Windows style EOL (mainly for atom users) #400

Merged
merged 4 commits into from Jun 23, 2018
Merged
Diff settings

Always

Just for now

Prev

examples can't return error

  • Loading branch information...
lorenzwalthert committed Jun 21, 2018
commit e92b1b8969d76385a79978aa3ed18a105ed52df5
Copy path View file
@@ -8,10 +8,13 @@
#' @param ... Parameters passed to [base::parse()]
#' @keywords internal
#' @examples
#' \dontrun{
#' styler:::parse_safely("a + 3 -4 -> x\r\n glück + 1")
#' # This cannot be detected as a EOL style problem because the first
#' # line ends as expected with \n
#' styler:::parse_safely("a + 3 -4 -> x\nx + 2\r\n glück + 1")
#' }
#' styler:::parse_safely("a + 3 -4 -> \n glück + 1")
parse_safely <- function(text, ...) {
tried_parsing <- tryCatch(parse(text = text, ...),
error = function(e) e,
Copy path View file

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.