@eagleoutice/flowr 2.8.13 → 2.8.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -218,6 +218,8 @@ export interface DataflowGraphVertexVariableDefinition extends DataflowGraphVert
218
218
  readonly tag: VertexType.VariableDefinition;
219
219
  /** Does not require an environment, those are attached to the call */
220
220
  readonly environment?: undefined;
221
+ /** Indicates whether the variable definition is a *partial* definition (e.g,. in `x[a] <- b`) */
222
+ readonly par?: true;
221
223
  }
222
224
  /**
223
225
  * Arguments required to construct a vertex which represents the definition of a function in the {@link DataflowGraph|dataflow graph}.
@@ -363,7 +363,6 @@ function getAllLinkedFunctionDefinitions(functionDefinitionReadIds, dataflowGrap
363
363
  const visited = new Set();
364
364
  while (potential.length !== 0) {
365
365
  const cid = potential.pop();
366
- // console.log(`visiting ${recoverName(cid, dataflowGraph.idMap)} ${cid}`);
367
366
  visited.add(cid);
368
367
  if ((0, built_in_1.isBuiltIn)(cid)) {
369
368
  builtIns.add(cid);
@@ -388,7 +387,7 @@ function getAllLinkedFunctionDefinitions(functionDefinitionReadIds, dataflowGrap
388
387
  }
389
388
  }
390
389
  }
391
- if (vertex.tag === vertex_1.VertexType.FunctionCall || hasReturnEdge) {
390
+ if (vertex.tag === vertex_1.VertexType.FunctionCall || hasReturnEdge || (vertex.tag === vertex_1.VertexType.VariableDefinition && vertex.par)) {
392
391
  continue;
393
392
  }
394
393
  for (const [target, { types }] of edges) {
@@ -45,6 +45,10 @@ args, rootId, data, config) {
45
45
  if (createdVert?.tag === vertex_1.VertexType.FunctionCall) {
46
46
  createdVert.origin = [built_in_1.BuiltInProcName.Replacement];
47
47
  }
48
+ const targetVert = res.graph.getVertex((0, unpack_argument_1.unpackArg)(args[0])?.info.id);
49
+ if (targetVert?.tag === vertex_1.VertexType.VariableDefinition) {
50
+ targetVert.par = true;
51
+ }
48
52
  const convertedArgs = config.readIndices ? args.slice(1, -1) : (0, built_in_access_1.symbolArgumentsToStrings)(args.slice(1, -1), 0);
49
53
  /* now, we soft-inject other arguments, so that calls like `x[y] <- 3` are linked correctly */
50
54
  const { callArgs } = (0, common_1.processAllArguments)({
@@ -392,6 +392,7 @@ ${(0, doc_structure_1.details)('Example: Super Definition (<code><<-</code>)', a
392
392
  The implementation is relatively sparse and similar to the other marker vertices:
393
393
 
394
394
  ${ctx.hierarchy('DataflowGraphVertexVariableDefinition')}
395
+ Of only interest is \`par\`, which signals that the definitions is partial (e.g., in the case of \`x[a] <- 1\`).
395
396
 
396
397
  Of course, there are not just operators that define variables, but also functions, like \`assign\`.
397
398
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eagleoutice/flowr",
3
- "version": "2.8.13",
3
+ "version": "2.8.14",
4
4
  "description": "Static Dataflow Analyzer and Program Slicer for the R Programming Language",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "repository": {
package/util/version.js CHANGED
@@ -6,7 +6,7 @@ exports.printVersionInformation = printVersionInformation;
6
6
  const semver_1 = require("semver");
7
7
  const assert_1 = require("./assert");
8
8
  // this is automatically replaced with the current version by release-it
9
- const version = '2.8.13';
9
+ const version = '2.8.14';
10
10
  /**
11
11
  * Retrieves the current flowR version as a new {@link SemVer} object.
12
12
  */