@eagleoutice/flowr-dev
Version:
Static Dataflow Analyzer and Program Slicer for the R Programming Language
35 lines • 1.53 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.flowrScriptSummarizer = flowrScriptSummarizer;
const summarizer_1 = require("../../benchmark/summarizer/summarizer");
function getBenchmarkSummarizer(options, outputBase) {
return new summarizer_1.BenchmarkSummarizer({
graphOutputPath: options.graph ? `${outputBase}-graph.json` : undefined,
inputPath: options.input,
intermediateOutputPath: outputBase,
outputPath: `${outputBase}-ultimate.json`,
logger: console.log
});
}
/**
* The core function for the 'flowr summarize' script.
*/
async function flowrScriptSummarizer(options) {
if (options.type && options.type !== 'benchmark') {
console.error(`Warning: --type ${options.type} is no longer supported. The summarizer only produces benchmark summaries.`);
}
if (options.categorize) {
console.error('Warning: --categorize is no longer supported.');
}
if (options['project-skip'] && options['project-skip'] > 0) {
console.error(`Warning: --project-skip ${options['project-skip']} is no longer supported.`);
}
const outputBase = (options.output ?? options.input).replace(/\.json$|\/$/, '-summary');
console.log(`Writing outputs to base ${outputBase}`);
const summarizer = getBenchmarkSummarizer(options, outputBase);
if (!options['ultimate-only']) {
await summarizer.preparationPhase();
}
await summarizer.summarizePhase();
}
//# sourceMappingURL=summarizer-core.js.map