MangoTheCat / functionMap

Draw the functions map for a R package
36 stars 8 forks source link

Code that needs another package #15

Closed gaborcsardi closed 8 years ago

gaborcsardi commented 8 years ago

E.g. code that uses R6 classes typically contains an R6Class call, outside of any functions. This cannot be run, because it needs the R6 package.

Should we just treat R6 specially?

gaborcsardi commented 8 years ago

Or we should just make sure that all imports and dependencies are available?

gaborcsardi commented 8 years ago

Or, we do not actually try to run the code, at least not code that is not a function definition. Maybe this is the best solution.

So, we need some smart reader, that parses the code into a list of expressions, and then analyze that. No need to run it at all, actually. We just need to be able to parse it syntactically.

We only need to run it, if some references are not resolved with the static analysis, and we need to load the package and its imports and search for the unresolved references.

gaborcsardi commented 8 years ago

Close this for now, will implement the parsing of non-function-definition code later.