@eagleoutice/flowr 2.0.5 → 2.0.6

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.
@@ -55,7 +55,7 @@ function linkArgumentsOnCall(args, params, graph) {
55
55
  graph.addEdge(arg.nodeId, specialDotParameter.name.info.id, { type: 16 /* EdgeType.DefinesOnCall */ });
56
56
  }
57
57
  else {
58
- logger_1.dataflowLogger.error(`skipping argument ${i} as there is no corresponding parameter - R should block that`);
58
+ logger_1.dataflowLogger.warn(`skipping argument ${i} as there is no corresponding parameter - R should block that`);
59
59
  }
60
60
  continue;
61
61
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eagleoutice/flowr",
3
- "version": "2.0.5",
3
+ "version": "2.0.6",
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": {
@@ -33,7 +33,9 @@ function parseBinaryOp(data, lhs, operator, rhs) {
33
33
  const operationName = (0, normalize_meta_1.retrieveOpName)(operator);
34
34
  const { location, content } = (0, normalize_meta_1.retrieveMetaStructure)(operator.content);
35
35
  if ((0, strings_1.startAndEndsWith)(operationName, '%')) {
36
- (0, assert_1.guard)(parsedLhs.location !== undefined && parsedLhs.lexeme !== undefined && parsedRhs.location !== undefined && parsedRhs.lexeme !== undefined, () => `special op lhs and rhs must have a locations and lexemes, but ${JSON.stringify(parsedLhs)} and ${JSON.stringify(parsedRhs)})`);
36
+ const lhsLoc = parsedLhs.type === "RExpressionList" /* RType.ExpressionList */ ? parsedLhs.grouping?.[0].location : parsedLhs.location;
37
+ const rhsLoc = parsedRhs.type === "RExpressionList" /* RType.ExpressionList */ ? parsedRhs.grouping?.[0].location : parsedRhs.location;
38
+ (0, assert_1.guard)(lhsLoc !== undefined && rhsLoc !== undefined, () => `special op lhs and rhs must have a locations, but ${JSON.stringify(parsedLhs)} || ${JSON.stringify(lhsLoc)} and ${JSON.stringify(parsedRhs)} || || ${JSON.stringify(rhsLoc)})`);
37
39
  // parse as infix function call!
38
40
  return {
39
41
  type: "RFunctionCall" /* RType.FunctionCall */,
@@ -52,18 +54,18 @@ function parseBinaryOp(data, lhs, operator, rhs) {
52
54
  arguments: [
53
55
  {
54
56
  type: "RArgument" /* RType.Argument */,
55
- location: parsedLhs.location,
57
+ location: lhsLoc,
56
58
  value: parsedLhs,
57
59
  name: undefined,
58
- lexeme: parsedLhs.lexeme,
60
+ lexeme: parsedLhs.lexeme ?? '',
59
61
  info: {}
60
62
  },
61
63
  {
62
64
  type: "RArgument" /* RType.Argument */,
63
- location: parsedRhs.location,
65
+ location: rhsLoc,
64
66
  value: parsedRhs,
65
67
  name: undefined,
66
- lexeme: parsedRhs.lexeme,
68
+ lexeme: parsedRhs.lexeme ?? '',
67
69
  info: {}
68
70
  }
69
71
  ],
@@ -7,4 +7,4 @@ export declare function splitComments(tokens: readonly NamedXmlBasedJson[]): {
7
7
  others: NamedXmlBasedJson[];
8
8
  };
9
9
  export declare function normalizeExpressions(data: NormalizerData, tokens: readonly XmlBasedJson[] | readonly NamedXmlBasedJson[]): (RNode | RDelimiter)[];
10
- export declare function parseNodesWithUnknownType(data: NormalizerData, mappedWithName: readonly NamedXmlBasedJson[]): (RNode | RDelimiter)[];
10
+ export declare function parseNodesWithUnknownType(data: NormalizerData, mappedWithName: readonly NamedXmlBasedJson[] | undefined): (RNode | RDelimiter)[];
@@ -18,7 +18,7 @@ const normalize_if_then_else_1 = require("../control/normalize-if-then-else");
18
18
  const normalize_comment_1 = require("../other/normalize-comment");
19
19
  function normalizeMappedWithoutSemicolonBasedOnType(mappedWithName, data) {
20
20
  let result = undefined;
21
- switch (mappedWithName.length) {
21
+ switch (mappedWithName?.length) {
22
22
  case 1:
23
23
  result = (0, normalize_single_node_1.normalizeSingleNode)(data, mappedWithName[0]);
24
24
  break;
@@ -93,7 +93,7 @@ function handleExpressionList(raw) {
93
93
  return { segments: [], comments: [], braces: undefined };
94
94
  }
95
95
  const { comments, others: tokens } = splitComments(raw);
96
- const first = tokens[0].name;
96
+ const first = tokens[0]?.name;
97
97
  if (first === "{" /* RawRType.BraceLeft */) {
98
98
  const endType = tokens[tokens.length - 1].name;
99
99
  (0, assert_1.guard)(endType === "}" /* RawRType.BraceRight */, () => `expected a brace at the end of the expression list as well, but ${endType} :: ${JSON.stringify(tokens[tokens.length - 1], json_1.jsonReplacer)}`);
@@ -172,7 +172,7 @@ exports.normalizeExpressions = normalizeExpressions;
172
172
  function parseNodesWithUnknownType(data, mappedWithName) {
173
173
  const parsedNodes = [];
174
174
  // used to indicate the new root node of this set of nodes
175
- for (const elem of mappedWithName) {
175
+ for (const elem of mappedWithName ?? []) {
176
176
  const retrieved = (0, normalize_single_node_1.normalizeSingleNode)(data, elem);
177
177
  parsedNodes.push(retrieved);
178
178
  }
@@ -32,7 +32,7 @@ export declare function assureTokenType(obj: XmlBasedJson, expectedName: RawRTyp
32
32
  * @param content - the json object to extract the token-type from
33
33
  */
34
34
  export declare function getTokenType(content: XmlBasedJson): RawRType;
35
- export declare function getWithTokenType(obj: XmlBasedJson[]): {
35
+ export declare function getWithTokenType(obj: readonly XmlBasedJson[]): {
36
36
  name: RawRType;
37
37
  content: XmlBasedJson;
38
38
  }[];
@@ -66,7 +66,7 @@ function getTokenType(content) {
66
66
  }
67
67
  exports.getTokenType = getTokenType;
68
68
  function getWithTokenType(obj) {
69
- return obj.map((content) => ({
69
+ return obj.map(content => ({
70
70
  name: getTokenType(content),
71
71
  content
72
72
  }));
package/util/version.js CHANGED
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.flowrVersion = void 0;
4
4
  const semver_1 = require("semver");
5
5
  // this is automatically replaced with the current version by release-it
6
- const version = '2.0.5';
6
+ const version = '2.0.6';
7
7
  function flowrVersion() {
8
8
  return new semver_1.SemVer(version);
9
9
  }