@eagleoutice/flowr-dev
Version:
Static Dataflow Analyzer and Program Slicer for the R Programming Language
25 lines • 1.26 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.processFunctionCall = processFunctionCall;
const named_call_handling_1 = require("./named-call-handling");
const unnamed_call_handling_1 = require("./unnamed-call-handling");
const process_named_call_1 = require("../../process-named-call");
/**
* Processes a function call, either named or unnamed.
* @see {@link processNamedCall}
* @see {@link processUnnamedFunctionCall}
*/
function processFunctionCall(functionCall, data) {
if (functionCall.named) {
// magrittr-style `%op%` calls (e.g. `%>%`) are normalized as named calls, but chain left-associatively
// through their first argument just like a binary operator or pipe, so they fold instead of recursing
if (functionCall.infixSpecial === true && functionCall.arguments.length === 2) {
return (0, process_named_call_1.processChainedCall)(functionCall, data);
}
return (0, named_call_handling_1.processNamedCall)(functionCall.functionName, functionCall.arguments, functionCall.info.id, data);
}
else {
return (0, unnamed_call_handling_1.processUnnamedFunctionCall)(functionCall, data);
}
}
//# sourceMappingURL=default-call-handling.js.map