@eagleoutice/flowr
Version:
Static Dataflow Analyzer and Program Slicer for the R Programming Language
45 lines • 1.75 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.UnsupportedFunctions = void 0;
const identifier_1 = require("../dataflow/environments/identifier");
const vertex_1 = require("../dataflow/graph/vertex");
/**
* List of known function calls that may change the environment unresolvable/implicitly.
*/
const UnsupportedFunctionsList = {
'.Primitive': { package: 'base' },
'.Internal': { package: 'base' },
'.External': { package: 'base' },
'.Call': { package: 'base' },
'.C': { package: 'base' },
'.Fortran': { package: 'base' },
'.dyn.load': { package: 'base' },
'eval': { package: 'base' },
'evalq': { package: 'base' },
'eval.parent': { package: 'base' },
'eval_tidy': { package: 'rlang' },
'eval_bare': { package: 'rlang' },
'body<-': { package: 'base' },
'formals<-': { package: 'base' },
'environment<-': { package: 'base' },
'load': { package: 'base' },
'attach': { package: 'base' },
'detach': { package: 'base' },
'rm': { package: 'base' },
'remove': { package: 'base' },
'list2env': { package: 'base' },
'assignInNamespace': { package: 'utils' },
'assignInMyNamespace': { package: 'utils' },
};
/**
* Helper for unsupported functions that may change the environment.
*/
exports.UnsupportedFunctions = {
/**
* Checks whether a data flow graph vertex represents a unsupported (environment-changing) function call (e.g. `eval`, `load`, `attach`, `rm`, ...)
*/
isUnsupportedCall(vertex) {
return (0, vertex_1.isFunctionCallVertex)(vertex) && Object.hasOwn(UnsupportedFunctionsList, identifier_1.Identifier.getName(vertex.name));
}
};
//# sourceMappingURL=unsupported-functions.js.map