UNPKG

@eagleoutice/flowr

Version:

Static Dataflow Analyzer and Program Slicer for the R Programming Language

39 lines 1.85 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.FlowrAnalyzerMetaVignetteFilesPlugin = void 0; const flowr_analyzer_file_plugin_1 = require("./flowr-analyzer-file-plugin"); const semver_1 = require("semver"); const flowr_file_1 = require("../../context/flowr-file"); const built_in_source_1 = require("../../../dataflow/internal/process/functions/call/built-in/built-in-source"); const VignettePathPattern = /vignettes?/i; /** * This plugin provides supports for the loading of Vignette files. * If you use multiple plugins, this should be included *before* other plugins. */ class FlowrAnalyzerMetaVignetteFilesPlugin extends flowr_analyzer_file_plugin_1.FlowrAnalyzerFilePlugin { name = 'flowr-analyzer-vignette-files-plugin'; description = 'This plugin provides support for loading vignette files.'; version = new semver_1.SemVer('0.1.0'); pathPattern; /** * Creates a new instance of the VIGNETTE file plugin. * @param pathPattern - The pathPattern to identify VIGNETTE files, see {@link VignettePathPattern} for the default pathPattern. */ constructor(pathPattern = VignettePathPattern) { super(); this.pathPattern = pathPattern; } applies(file) { return this.pathPattern.test((0, built_in_source_1.platformDirname)(file.toString())); } /** * Processes the given file, assigning it the {@link FileRole.Vignette} role. * Given that the file may still need to be processed by other plugins, this method returns the `true` flag for that purpose. */ process(_ctx, file) { file.assignRole(flowr_file_1.FileRole.Vignette); return [file, true]; } } exports.FlowrAnalyzerMetaVignetteFilesPlugin = FlowrAnalyzerMetaVignetteFilesPlugin; //# sourceMappingURL=flowr-analyzer-vignette-file-plugin.js.map