@eagleoutice/flowr 2.9.8 → 2.9.9

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eagleoutice/flowr",
3
- "version": "2.9.8",
3
+ "version": "2.9.9",
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": {
@@ -92,6 +92,11 @@ export declare abstract class FlowrFile<Content extends StringableContent = Stri
92
92
  get roles(): readonly FileRole[] | undefined;
93
93
  path(): string;
94
94
  content(): Content;
95
+ /**
96
+ * Allows to overwrite the content cache.
97
+ * @protected
98
+ */
99
+ protected setContent(content: Content): void;
95
100
  protected abstract loadContent(): Content;
96
101
  assignRole(role: FileRole): void;
97
102
  /**
@@ -62,6 +62,13 @@ class FlowrFile {
62
62
  }
63
63
  return this.contentCache;
64
64
  }
65
+ /**
66
+ * Allows to overwrite the content cache.
67
+ * @protected
68
+ */
69
+ setContent(content) {
70
+ this.contentCache = content;
71
+ }
65
72
  assignRole(role) {
66
73
  if (this._roles === undefined) {
67
74
  this._roles = [role];
@@ -24,6 +24,7 @@ export declare class FlowrDescriptionFile extends FlowrFile<DeepReadonly<DCF>> {
24
24
  * @see {@link parseDCF} for details on the parsing logic.
25
25
  */
26
26
  protected loadContent(): DCF;
27
+ static fromDCF(dcf: DCF, path: string, roles?: FileRole[]): FlowrDescriptionFile;
27
28
  /**
28
29
  * Description file lifter, this does not re-create if already a description file
29
30
  */
@@ -34,6 +34,11 @@ class FlowrDescriptionFile extends flowr_file_1.FlowrFile {
34
34
  loadContent() {
35
35
  return parseDCF(this.wrapped);
36
36
  }
37
+ static fromDCF(dcf, path, roles) {
38
+ const file = new FlowrDescriptionFile(new flowr_file_1.FlowrTextFile(path, roles));
39
+ file.setContent(dcf);
40
+ return file;
41
+ }
37
42
  /**
38
43
  * Description file lifter, this does not re-create if already a description file
39
44
  */
@@ -32,6 +32,10 @@ export declare class FlowrNamespaceFile extends FlowrFile<NamespaceFormat> {
32
32
  * and handle role assignments.
33
33
  */
34
34
  constructor(file: FlowrFileProvider, ctx?: FlowrAnalyzerContext);
35
+ /**
36
+ * Creates a {@link FlowrNamespaceFile} from a given {@link NamespaceFormat}, path and optional roles. This is useful if you already have the namespace content parsed and want to create a namespace file instance without re-parsing.
37
+ */
38
+ static fromNamespaceFormat(fmt: NamespaceFormat, path: string, roles?: FileRole[]): FlowrNamespaceFile;
35
39
  /**
36
40
  * Loads and parses the content of the wrapped file in the {@link NamespaceFormat}.
37
41
  * @see {@link parseNamespaceSimple} for details on the parsing logic.
@@ -30,6 +30,14 @@ class FlowrNamespaceFile extends flowr_file_1.FlowrFile {
30
30
  this.wrapped = file;
31
31
  this.ctx = ctx;
32
32
  }
33
+ /**
34
+ * Creates a {@link FlowrNamespaceFile} from a given {@link NamespaceFormat}, path and optional roles. This is useful if you already have the namespace content parsed and want to create a namespace file instance without re-parsing.
35
+ */
36
+ static fromNamespaceFormat(fmt, path, roles) {
37
+ const file = new FlowrNamespaceFile(new flowr_file_1.FlowrTextFile(path, roles));
38
+ file.setContent(fmt);
39
+ return file;
40
+ }
33
41
  /**
34
42
  * Loads and parses the content of the wrapped file in the {@link NamespaceFormat}.
35
43
  * @see {@link parseNamespaceSimple} for details on the parsing logic.
@@ -24,4 +24,8 @@ export declare class FlowrNewsFile extends FlowrFile<NewsChunk[]> {
24
24
  * News file lifter, this does not re-create if already a news file
25
25
  */
26
26
  static from(file: FlowrFileProvider | FlowrNewsFile, role?: FileRole): FlowrNewsFile;
27
+ /**
28
+ * Creates a FlowrNewsFile from given news chunks, path and optional roles. This is useful if you already have the news content parsed and want to create a news file instance without re-parsing.
29
+ */
30
+ static fromNewsChunks(chunks: NewsChunk[], path: string, roles?: FileRole[]): FlowrNewsFile;
27
31
  }
@@ -33,6 +33,14 @@ class FlowrNewsFile extends flowr_file_1.FlowrFile {
33
33
  }
34
34
  return file instanceof FlowrNewsFile ? file : new FlowrNewsFile(file);
35
35
  }
36
+ /**
37
+ * Creates a FlowrNewsFile from given news chunks, path and optional roles. This is useful if you already have the news content parsed and want to create a news file instance without re-parsing.
38
+ */
39
+ static fromNewsChunks(chunks, path, roles) {
40
+ const file = new FlowrNewsFile(new flowr_file_1.FlowrTextFile(path, roles));
41
+ file.setContent(chunks);
42
+ return file;
43
+ }
36
44
  }
37
45
  exports.FlowrNewsFile = FlowrNewsFile;
38
46
  function makeRversionRegex() {
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.9.8';
9
+ const version = '2.9.9';
10
10
  /**
11
11
  * Retrieves the current flowR version as a new {@link SemVer} object.
12
12
  */