-
-
Notifications
You must be signed in to change notification settings - Fork 8
assign side_effects and occurrence as attributes of @code
#223
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
Changes from 8 commits
f86bc13
291cf10
b04d078
e49187a
b65f18d
36444b1
4ea2ae2
e4fdcd4
76b0dd8
839fca6
a8016bc
8d3649e
90fab4f
751e6ca
bcc9c5f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -37,7 +37,7 @@ setMethod("eval_code", signature = c("qenv", "character"), function(object, code | |
|
|
||
| for (i in seq_along(code_split)) { | ||
| current_code <- code_split[[i]] | ||
| current_call <- parse(text = current_code, keep.source = FALSE) | ||
| current_call <- parse(text = trimws(current_code), keep.source = TRUE) | ||
|
|
||
| # Using withCallingHandlers to capture warnings and messages. | ||
| # Using tryCatch to capture the error and abort further evaluation. | ||
|
|
@@ -79,6 +79,12 @@ setMethod("eval_code", signature = c("qenv", "character"), function(object, code | |
| } | ||
|
|
||
| attr(current_code, "id") <- sample.int(.Machine$integer.max, size = 1) | ||
|
|
||
| pd <- utils::getParseData(current_call) | ||
| pd <- normalize_pd(pd) | ||
| call_pd <- extract_calls(pd)[[1]] | ||
|
||
|
|
||
| attr(current_code, "dependency") <- c(extract_side_effects(call_pd), extract_occurrence(call_pd)) | ||
| object@code <- c(object@code, list(current_code)) | ||
| } | ||
|
|
||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.