Skip to content

Annotation exists in code after execution of prov.capture when called from cleanR #78

@MKLau

Description

@MKLau

I inserted the function "myfunc" into the messycode.R script.

The myfunc function is:

myfunc <- function(x){
z <- 2+2
y <- z*2
return(y)
}

After running cleanR on the messycode and then calling myfunc to view it's object contents, I get the following:

 function (x)                                                                                                                                                                   
 {                                                                                                                                                                              
     if (ddg.should.run.annotated("myfunc")) {                                                                                                                                  
         ddg.function()                                                                                                                                                         
         ddg.eval("z <- 2 + 2", function ()                                                                                                                                     
         parsed.stmt)                                                                                                                                                           
         ddg.eval("y <- z * 2", function ()                                                                                                                                     
         parsed.stmt)                                                                                                                                                           
         return(ddg.ret.value(ddg.eval("y", function ()                                                                                                                         
         parsed.stmt), function ()                                                                                                                                              
         parsed.stmt))                                                                                                                                                          
     }                                                                                                                                                                          
     else {                                                                                                                                                                     
         z <- 2 + 2                                                                                                                                                             
         y <- z * 2                                                                                                                                                             
         return(y)                                                                                                                                                              
     }                                                                                                                                                                          
 } 

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions