@eagleoutice/flowr
Version:
Static Dataflow Analyzer and Program Slicer for the R Programming Language
33 lines • 1.39 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.FlowrAnalyzerRmdFilePlugin = void 0;
const semver_1 = require("semver");
const flowr_analyzer_file_plugin_1 = require("../flowr-analyzer-file-plugin");
const flowr_rmarkdown_file_1 = require("../files/flowr-rmarkdown-file");
const built_in_source_1 = require("../../../../dataflow/internal/process/functions/call/built-in/built-in-source");
const RmdPattern = /\.rmd$/i;
/**
* The plugin provides support for R Markdown (`.rmd`) files
*/
class FlowrAnalyzerRmdFilePlugin extends flowr_analyzer_file_plugin_1.FlowrAnalyzerFilePlugin {
name = 'rmd-file-plugin';
description = 'Parses R Markdown files';
version = new semver_1.SemVer('0.1.0');
pattern;
/**
* Creates a new instance of the R Markdown file plugin.
* @param filePattern - The pattern to identify R Markdown files, see {@link RmdPattern} for the default pattern.
*/
constructor(filePattern = RmdPattern) {
super();
this.pattern = filePattern;
}
applies(file) {
return this.pattern.test((0, built_in_source_1.platformBasename)(file.toString()));
}
process(_ctx, arg) {
return flowr_rmarkdown_file_1.FlowrRMarkdownFile.from(arg);
}
}
exports.FlowrAnalyzerRmdFilePlugin = FlowrAnalyzerRmdFilePlugin;
//# sourceMappingURL=flowr-analyzer-rmd-file-plugin.js.map