Skip to content

Commit

Permalink
Make sure code is not instrumented multiple times
Browse files Browse the repository at this point in the history
Closes #15
  • Loading branch information
gaborcsardi committed Nov 10, 2017
1 parent a80941d commit bd89f5c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion R/debug.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ debug <- function(msg, pkg = environmentName(topenv(parent.frame()))) {
return(msg)
}

msg <- sub("^!+DEBUG\\s+", "", msg)
msg <- sub("^!+\\s*", "", msg)
file <- get_output_file()

time_stamp_mode <- if (file == "") "diff" else "stamp"
Expand Down
1 change: 1 addition & 0 deletions R/instrument.R
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ is_debug_string <- function(x) {
}

make_debug_call <- function(x) {
x <- sub("^(!+)DEBUG", "\\1", x, perl = TRUE)
x <- handle_dynamic_code(x)
as.call(list(quote(debugme::debug), x))
}

0 comments on commit bd89f5c

Please sign in to comment.