UNPKG

@eagleoutice/flowr-dev

Version:

Static Dataflow Analyzer and Program Slicer for the R Programming Language

35 lines 1.57 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.FlowrAnalyzerGasPlugin = void 0; const flowr_analyzer_plugin_1 = require("../flowr-analyzer-plugin"); const semver_1 = require("semver"); /** * Base class for gas plugins, queried on-demand by {@link FlowrAnalyzerGasContext.checkGas}. * * Override {@link process} to provide a custom resource-pressure assessment for a feature key. * Return `undefined` to defer to the built-in memory and time checks. * Multiple Gas plugins are combined by taking the maximum ({@link GasLevel}) returned by any plugin * or by the built-in checks. * * A gas plugin is the right place to add domain-specific checks (e.g., CPU, I/O, quota limits) * or to override default behavior for testing by returning a hardcoded level. * @see {@link PluginType.Gas} * @see {@link FlowrAnalyzerGasContext} */ class FlowrAnalyzerGasPlugin extends flowr_analyzer_plugin_1.FlowrAnalyzerPlugin { type = flowr_analyzer_plugin_1.PluginType.Gas; static defaultPlugin() { return new DefaultFlowrAnalyzerGasPlugin(); } } exports.FlowrAnalyzerGasPlugin = FlowrAnalyzerGasPlugin; /** Default no-op gas plugin that defers all checks to the built-in memory and time logic. */ class DefaultFlowrAnalyzerGasPlugin extends FlowrAnalyzerGasPlugin { name = 'default-gas-plugin'; description = 'Defers to built-in memory and time checks.'; version = new semver_1.SemVer('0.0.0'); process(_ctx, _key) { return undefined; } } //# sourceMappingURL=flowr-analyzer-gas-plugin.js.map