@eagleoutice/flowr
Version:
Static Dataflow Analyzer and Program Slicer for the R Programming Language
29 lines • 1.54 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.LocationMapQueryDefinition = void 0;
const location_map_query_executor_1 = require("./location-map-query-executor");
const ansi_1 = require("../../../util/text/ansi");
const time_1 = require("../../../util/text/time");
const joi_1 = __importDefault(require("joi"));
const query_print_1 = require("../../query-print");
exports.LocationMapQueryDefinition = {
executor: location_map_query_executor_1.executeLocationMapQuery,
asciiSummarizer: (formatter, _processed, queryResults, result) => {
const out = queryResults;
result.push(`Query: ${(0, ansi_1.bold)('location-map', formatter)} (${(0, time_1.printAsMs)(out['.meta'].timing, 0)})`);
result.push(' ╰ File List:');
for (const [id, file] of Object.entries(out.map.files)) {
result.push(` ╰ ${id}: \`${file}\``);
}
result.push(` ╰ Id List: {${(0, query_print_1.summarizeIdsIfTooLong)(formatter, [...Object.keys(out.map.ids)])}}`);
return true;
},
schema: joi_1.default.object({
type: joi_1.default.string().valid('location-map').required().description('The type of the query.'),
}).description('The location map query retrieves the location of every id in the ast.'),
flattenInvolvedNodes: () => []
};
//# sourceMappingURL=location-map-query-format.js.map