UNPKG

@eagleoutice/flowr

Version:

Static Dataflow Analyzer and Program Slicer for the R Programming Language

61 lines 1.91 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.GraphDifferenceReport = void 0; exports.initDiffContext = initDiffContext; /** * To be produced by a function differencing two graphs (e.g., {@link DataflowGraph|DFGs} or {@link ControlFlowGraph|CFGs}). * * @see {@link GraphDifferenceReport#isEqual|isEqual} - to check whether the graphs are equal * @see {@link GraphDifferenceReport#addComment|addComment} - to add comments to the report * @see {@link GraphDifferenceReport#comments|comments} - to get the attached comments * @see {@link GraphDifferenceReport#problematic|problematic} - to get the problematic vertices/edges */ class GraphDifferenceReport { _comments = undefined; _problematic = undefined; addComment(comment, ...related) { if (this._comments === undefined) { this._comments = [comment]; } else { this._comments.push(comment); } if (related.length > 0) { if (this._problematic === undefined) { this._problematic = [...related]; } else { this._problematic.push(...related); } } } comments() { return this._comments; } problematic() { return this._problematic; } isEqual() { return this._comments === undefined; } } exports.GraphDifferenceReport = GraphDifferenceReport; /** * Create the context for differencing two graphs */ function initDiffContext(left, right, config) { return { left: left.graph, leftname: left.name, right: right.graph, rightname: right.name, report: new GraphDifferenceReport(), position: '', config: { rightIsSubgraph: false, leftIsSubgraph: false, ...config } }; } //# sourceMappingURL=diff-graph.js.map