ProvTools / provR

GNU General Public License v2.0
7 stars 3 forks source link

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

Open MKLau opened 6 years ago

MKLau commented 6 years ago

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)                                                                                                                                                              
     }                                                                                                                                                                          
 }