@eagleoutice/flowr 2.17.2 → 2.17.3

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/README.md CHANGED
@@ -38,7 +38,7 @@ It offers a wide variety of features, for example:
38
38
 
39
39
  ```shell
40
40
  $ docker run -it --rm eagleoutice/flowr # or npm run flowr
41
- flowR repl v2.17.0, R grammar v14 (tree-sitter engine)
41
+ flowR repl v2.17.2, R grammar v14 (tree-sitter engine)
42
42
  R> :query @linter "read.csv(\"/root/x.txt\")"
43
43
  ```
44
44
 
@@ -46,7 +46,7 @@ It offers a wide variety of features, for example:
46
46
  <summary style='color:gray'>Output</summary>
47
47
 
48
48
  ```text
49
- Query: linter (21 ms)
49
+ Query: linter (47 ms)
50
50
  ╰ Deprecated Functions (deprecated-functions): no findings
51
51
  ╰ File Path Validity (file-path-validity):
52
52
  ╰ certain:
@@ -72,7 +72,7 @@ It offers a wide variety of features, for example:
72
72
  ╰ Namespace Access Validity (namespace-access): no findings
73
73
  ╰ Secret Exfiltration (secret-exfiltration): no findings
74
74
  ╰ Process State in Session (process-state-in-session): no findings
75
- All queries together required ≈21 ms (1ms accuracy, total 22 ms)
75
+ All queries together required ≈47 ms (1ms accuracy, total 48 ms)
76
76
  ```
77
77
 
78
78
  The linter will analyze the code and return any issues found.
@@ -86,7 +86,7 @@ It offers a wide variety of features, for example:
86
86
 
87
87
  _Results (prettified and summarized):_
88
88
 
89
- Query: **linter** (23 ms)\
89
+ Query: **linter** (39 ms)\
90
90
  &nbsp;&nbsp;&nbsp;╰ **Deprecated Functions** (deprecated-functions): _no findings_\
91
91
  &nbsp;&nbsp;&nbsp;╰ **File Path Validity** (file-path-validity):\
92
92
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;╰ certain:\
@@ -112,7 +112,7 @@ It offers a wide variety of features, for example:
112
112
  &nbsp;&nbsp;&nbsp;╰ **Namespace Access Validity** (namespace-access): _no findings_\
113
113
  &nbsp;&nbsp;&nbsp;╰ **Secret Exfiltration** (secret-exfiltration): _no findings_\
114
114
  &nbsp;&nbsp;&nbsp;╰ **Process State in Session** (process-state-in-session): _no findings_\
115
- _All queries together required ≈23 ms (1ms accuracy, total 23 ms)_
115
+ _All queries together required ≈40 ms (1ms accuracy, total 40 ms)_
116
116
 
117
117
  <details> <summary style="color:gray">Show Detailed Results as Json</summary>
118
118
 
@@ -205,7 +205,7 @@ It offers a wide variety of features, for example:
205
205
 
206
206
  ```shell
207
207
  $ docker run -it --rm eagleoutice/flowr # or npm run flowr
208
- flowR repl v2.17.0, R grammar v14 (tree-sitter engine)
208
+ flowR repl v2.17.2, R grammar v14 (tree-sitter engine)
209
209
  R> :query @static-slice (11@sum) file://test/testfiles/example.R
210
210
  ```
211
211
 
@@ -218,7 +218,7 @@ It offers a wide variety of features, for example:
218
218
  N <- 10
219
219
  for(i in 1:(N-1)) sum <- sum + i + w
220
220
  sum
221
- All queries together required ≈4 ms (1ms accuracy, total 4 ms)
221
+ All queries together required ≈7 ms (1ms accuracy, total 8 ms)
222
222
  ```
223
223
 
224
224
  </details>
@@ -226,7 +226,7 @@ It offers a wide variety of features, for example:
226
226
  </details>
227
227
 
228
228
  * 🚀 **fast call-graph, data-, and control-flow graphs**\
229
- Within just [<i><span title="This measurement is automatically fetched from the latest benchmark!">129.1 ms</span></i> (as of Nov 3, 2026)](https://flowr-analysis.github.io/flowr/wiki/stats/benchmark),
229
+ Within just [<i><span title="This measurement is automatically fetched from the latest benchmark!">123.9 ms</span></i> (as of Nov 5, 2026)](https://flowr-analysis.github.io/flowr/wiki/stats/benchmark),
230
230
  _flowR_ can analyze the data- and control-flow of the average real-world R&nbsp;script. See the [benchmarks](https://flowr-analysis.github.io/flowr/wiki/stats/benchmark) for more information,
231
231
  and consult the [wiki pages](https://github.com/flowr-analysis/flowr/wiki/Dataflow-Graph) for more details on the [dataflow graphs](https://github.com/flowr-analysis/flowr/wiki/Dataflow-Graph) as well as [call graphs](https://github.com/flowr-analysis/flowr/wiki/Dataflow-Graph#perspectives-cg).
232
232
  (&nbsp;[▶&nbsp;Explore in Browser](https://flowr-analysis.github.io/flowr/wiki/playground/#c=zDYSwRgTghhCeAUATADsWECUAoLBnAxlMAKYD6ALgPakC2UAHgAQA8AtIwGYCuAdvuSEo949DIyYB6RnXojsWaAHdGKlW0aIo5KADoO0GsXghEjALyMAjAC4AbABpGANyJdi5xvngBmRwA5HAHZHACZHAE5HABYMbHwSKB5VdQ4QYHJiCHglRxdgN0YAPkYQuISeABICImJTdWqSCmoZeHjiRIq8t3lcLho6OFJcbXJcFnZe-pgQXCM2xMdDRI8l4Qba2KxeLlnEJu1gNQm%2B7KhFTtdieUUIEAydfFwneEmB2CGR3EcAIleYWAeT2%2B2FQlHIrXKVUIJEQIMoIB4owh7UqJgwQA&p=13:1 "run this script in flowR's playground, no setup")&nbsp;)
@@ -257,7 +257,7 @@ It offers a wide variety of features, for example:
257
257
 
258
258
  ```shell
259
259
  $ docker run -it --rm eagleoutice/flowr # or npm run flowr
260
- flowR repl v2.17.0, R grammar v14 (tree-sitter engine)
260
+ flowR repl v2.17.2, R grammar v14 (tree-sitter engine)
261
261
  R> :dataflow* test/testfiles/example.R
262
262
  ```
263
263
 
@@ -0,0 +1,4 @@
1
+ export declare const RReexports: Readonly<Record<string, {
2
+ readonly version: string;
3
+ readonly reexports: Readonly<Record<string, string>>;
4
+ }>>;
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RReexports = void 0;
4
+ /* eslint-disable */
5
+ /*
6
+ * GENERATED by scripts/gen-r-reexports.R with R version 4.6.1 (2026-06-24) -- do not edit.
7
+ * Per package, at the version installed then, the exported functions it re-exports, each with the package defining it.
8
+ */
9
+ exports.RReexports = {
10
+ "broom": { version: "1.0.13", reexports: { "augment": "generics", "glance": "generics", "tidy": "generics" } },
11
+ "bslib": { version: "0.11.0", reexports: { "css": "htmltools", "font_collection": "sass", "font_face": "sass", "font_google": "sass", "font_link": "sass" } },
12
+ "cachem": { version: "1.1.0", reexports: { "is.key_missing": "fastmap", "key_missing": "fastmap" } },
13
+ "callr": { version: "3.8.0", reexports: { "poll": "processx", "run": "processx" } },
14
+ "dplyr": { version: "1.2.1", reexports: { "%>%": "magrittr", "add_row": "tibble", "all_of": "tidyselect", "any_of": "tidyselect", "as_data_frame": "tibble", "as_label": "rlang", "as_tibble": "tibble", "contains": "tidyselect", "data_frame": "tibble", "ends_with": "tidyselect", "enexpr": "rlang", "enexprs": "rlang", "enquo": "rlang", "enquos": "rlang", "ensym": "rlang", "ensyms": "rlang", "everything": "tidyselect", "expr": "rlang", "glimpse": "pillar", "intersect": "generics", "last_col": "tidyselect", "lst": "tibble", "matches": "tidyselect", "num_range": "tidyselect", "one_of": "tidyselect", "quo": "rlang", "quo_name": "rlang", "quos": "rlang", "setdiff": "generics", "setequal": "generics", "starts_with": "tidyselect", "sym": "rlang", "syms": "rlang", "tibble": "tibble", "tribble": "tibble", "type_sum": "pillar", "union": "generics", "where": "tidyselect" } },
15
+ "forcats": { version: "1.0.1", reexports: { "%>%": "magrittr" } },
16
+ "ggfun": { version: "0.2.1", reexports: { "gpar": "grid", "identify": "graphics" } },
17
+ "ggimage": { version: "0.3.5", reexports: { "as.ggplot": "ggplotify", "as.grob": "ggplotify" } },
18
+ "ggplot2": { version: "4.0.3", reexports: { "alpha": "scales", "arrow": "grid", "as_label": "rlang", "enexpr": "rlang", "enexprs": "rlang", "enquo": "rlang", "enquos": "rlang", "ensym": "rlang", "ensyms": "rlang", "expr": "rlang", "quo": "rlang", "quo_name": "rlang", "quos": "rlang", "sym": "rlang", "syms": "rlang", "unit": "grid", "vars": "dplyr" } },
19
+ "googledrive": { version: "2.2.0", reexports: { "%>%": "magrittr" } },
20
+ "googlesheets4": { version: "1.1.3", reexports: { "%>%": "magrittr", "anchored": "cellranger", "cell_cols": "cellranger", "cell_limits": "cellranger", "cell_rows": "cellranger" } },
21
+ "haven": { version: "2.5.5", reexports: { "as_factor": "forcats" } },
22
+ "hexSticker": { version: "0.5.1", reexports: { "geom_subview": "ggimage", "ggplot": "ggplot2", "theme_transparent": "ggimage" } },
23
+ "igraph": { version: "2.3.3", reexports: { "%>%": "magrittr" } },
24
+ "lubridate": { version: "1.9.5", reexports: { "intersect": "generics", "setdiff": "generics", "union": "generics" } },
25
+ "magick": { version: "2.9.1", reexports: { "%>%": "magrittr" } },
26
+ "modelr": { version: "0.1.11", reexports: { "%>%": "magrittr" } },
27
+ "openssl": { version: "2.4.2", reexports: { "askpass": "askpass" } },
28
+ "promises": { version: "1.5.0", reexports: { "%>%": "magrittr", "%T>%": "magrittr" } },
29
+ "purrr": { version: "1.2.2", reexports: { "%>%": "magrittr", "done": "rlang", "exec": "rlang", "is_atomic": "rlang", "is_bare_atomic": "rlang", "is_bare_character": "rlang", "is_bare_double": "rlang", "is_bare_integer": "rlang", "is_bare_list": "rlang", "is_bare_logical": "rlang", "is_bare_numeric": "rlang", "is_bare_vector": "rlang", "is_character": "rlang", "is_double": "rlang", "is_empty": "rlang", "is_formula": "rlang", "is_function": "rlang", "is_integer": "rlang", "is_list": "rlang", "is_logical": "rlang", "is_scalar_atomic": "rlang", "is_scalar_character": "rlang", "is_scalar_double": "rlang", "is_scalar_integer": "rlang", "is_scalar_list": "rlang", "is_scalar_logical": "rlang", "is_scalar_vector": "rlang", "is_vector": "rlang", "rep_along": "rlang", "set_names": "rlang", "zap": "rlang" } },
30
+ "ragg": { version: "1.5.2", reexports: { "font_feature": "systemfonts", "get_font_features": "textshaping", "register_font": "systemfonts", "register_variant": "systemfonts" } },
31
+ "readxl": { version: "1.6.0", reexports: { "anchored": "cellranger", "cell_cols": "cellranger", "cell_limits": "cellranger", "cell_rows": "cellranger" } },
32
+ "RSQLite": { version: "3.53.3", reexports: { "Id": "DBI" } },
33
+ "rvest": { version: "1.0.5", reexports: { "%>%": "magrittr", "read_html": "xml2", "url_absolute": "xml2" } },
34
+ "shiny": { version: "1.14.0", reexports: { "a": "htmltools", "br": "htmltools", "code": "htmltools", "div": "htmltools", "em": "htmltools", "h1": "htmltools", "h2": "htmltools", "h3": "htmltools", "h4": "htmltools", "h5": "htmltools", "h6": "htmltools", "hr": "htmltools", "HTML": "htmltools", "htmlTemplate": "htmltools", "img": "htmltools", "includeCSS": "htmltools", "includeHTML": "htmltools", "includeMarkdown": "htmltools", "includeScript": "htmltools", "includeText": "htmltools", "is.key_missing": "fastmap", "is.singleton": "htmltools", "key_missing": "fastmap", "p": "htmltools", "pre": "htmltools", "singleton": "htmltools", "span": "htmltools", "strong": "htmltools", "suppressDependencies": "htmltools", "tag": "htmltools", "tagAppendAttributes": "htmltools", "tagAppendChild": "htmltools", "tagAppendChildren": "htmltools", "tagGetAttribute": "htmltools", "tagHasAttribute": "htmltools", "tagList": "htmltools", "tagSetChildren": "htmltools", "validateCssUnit": "htmltools", "withTags": "htmltools" } },
35
+ "stringr": { version: "1.6.0", reexports: { "%>%": "magrittr" } },
36
+ "targets": { version: "1.12.0", reexports: { "all_of": "tidyselect", "any_of": "tidyselect", "contains": "tidyselect", "ends_with": "tidyselect", "everything": "tidyselect", "last_col": "tidyselect", "matches": "tidyselect", "num_range": "tidyselect", "one_of": "tidyselect", "starts_with": "tidyselect" } },
37
+ "testthat": { version: "3.3.2", reexports: { "%>%": "magrittr" } },
38
+ "tibble": { version: "3.3.1", reexports: { "%>%": "magrittr", "char": "pillar", "glimpse": "pillar", "has_name": "rlang", "num": "pillar", "obj_sum": "pillar", "set_char_opts": "pillar", "set_num_opts": "pillar", "size_sum": "pillar", "tbl_sum": "pillar", "type_sum": "pillar" } },
39
+ "tidyr": { version: "1.3.2", reexports: { "%>%": "magrittr", "all_of": "tidyselect", "any_of": "tidyselect", "as_tibble": "tibble", "contains": "tidyselect", "ends_with": "tidyselect", "everything": "tidyselect", "last_col": "tidyselect", "matches": "tidyselect", "num_range": "tidyselect", "one_of": "tidyselect", "starts_with": "tidyselect", "tibble": "tibble", "tribble": "tibble" } },
40
+ "tidyselect": { version: "1.2.1", reexports: { "enquo": "rlang", "quo": "rlang", "quo_name": "rlang", "quos": "rlang" } },
41
+ "vroom": { version: "1.7.1", reexports: { "contains": "tidyselect", "ends_with": "tidyselect", "everything": "tidyselect", "last_col": "tidyselect", "matches": "tidyselect", "num_range": "tidyselect", "one_of": "tidyselect", "starts_with": "tidyselect" } }
42
+ };
43
+ //# sourceMappingURL=r-reexports.generated.js.map
@@ -215,6 +215,7 @@ export declare const Dataflow: {
215
215
  * Dataflow.library.attaches(ctx, 'tidyverse'); // the search() entries it adds
216
216
  * Dataflow.library.loads(ctx, 'tidyverse'); // every namespace it loads
217
217
  * Dataflow.library.layers(ctx, 'tidyverse'); // the namespace and imports environments themselves
218
+ * Dataflow.library.reexports(ctx, 'dplyr'); // the exports it takes from others, `%>%` from magrittr included
218
219
  * ```
219
220
  */
220
221
  readonly library: {
@@ -225,6 +226,8 @@ export declare const Dataflow: {
225
226
  readonly loads: typeof libraryLoadsOf;
226
227
  /** The environment layers `library(pkg)` adds to the search path; see {@link libraryLayersOf}. */
227
228
  readonly layers: typeof libraryLayersOf;
229
+ /** The exports of `pkg` that re-export another package's function, with that package; see {@link libraryReexportsOf}. */
230
+ readonly reexports: typeof libraryReexportsOf;
228
231
  };
229
232
  readonly visualize: {
230
233
  readonly mermaid: {
@@ -263,6 +266,11 @@ export declare const Dataflow: {
263
266
  declare function libraryLayersOf(this: void, ctx: FlowrAnalyzerContext, pkg: string, spec?: AttachSpec): readonly Environment[];
264
267
  /** The `search()` entries `library(pkg)` adds, in `search()` order: `pkg`, its `Depends` and a meta-package's core set, recursively. */
265
268
  declare function libraryAttachesOf(this: void, ctx: FlowrAnalyzerContext, pkg: string, spec?: AttachSpec): readonly string[];
269
+ /**
270
+ * The exports of `pkg` it re-exports from another package, mapped to that package (`%>%` of dplyr to `magrittr`).
271
+ * The analysis keeps such an export as one of `pkg` (`dplyr::%>%`), so both stay apart; this tells where it comes from.
272
+ */
273
+ declare function libraryReexportsOf(this: void, ctx: FlowrAnalyzerContext, pkg: string): ReadonlyMap<string, string>;
266
274
  /** The namespaces `library(pkg)` loads, `pkg` first: the closure over {@link directLoadsOf} at the versions the analysis assumes. */
267
275
  declare function libraryLoadsOf(this: void, ctx: FlowrAnalyzerContext, pkg: string): readonly string[];
268
276
  export {};
@@ -12,6 +12,7 @@ const vertex_1 = require("./vertex");
12
12
  const identifier_1 = require("../environments/identifier");
13
13
  const built_in_proc_name_1 = require("../environments/built-in-proc-name");
14
14
  const r_base_packages_1 = require("../../util/r-base-packages");
15
+ const flowr_namespace_file_1 = require("../../project/plugins/file-plugins/files/flowr-namespace-file");
15
16
  const defaultmap_1 = require("../../util/collections/defaultmap");
16
17
  const linker_1 = require("../internal/linker");
17
18
  const dfg_get_symbol_refs_1 = require("../origin/dfg-get-symbol-refs");
@@ -407,6 +408,7 @@ exports.Dataflow = {
407
408
  * Dataflow.library.attaches(ctx, 'tidyverse'); // the search() entries it adds
408
409
  * Dataflow.library.loads(ctx, 'tidyverse'); // every namespace it loads
409
410
  * Dataflow.library.layers(ctx, 'tidyverse'); // the namespace and imports environments themselves
411
+ * Dataflow.library.reexports(ctx, 'dplyr'); // the exports it takes from others, `%>%` from magrittr included
410
412
  * ```
411
413
  */
412
414
  library: {
@@ -416,7 +418,9 @@ exports.Dataflow = {
416
418
  /** The namespaces `library(pkg)` loads; see {@link libraryLoadsOf}. */
417
419
  loads: libraryLoadsOf,
418
420
  /** The environment layers `library(pkg)` adds to the search path; see {@link libraryLayersOf}. */
419
- layers: libraryLayersOf
421
+ layers: libraryLayersOf,
422
+ /** The exports of `pkg` that re-export another package's function, with that package; see {@link libraryReexportsOf}. */
423
+ reexports: libraryReexportsOf
420
424
  }
421
425
  };
422
426
  /** both qualifications of a call from a single origin resolution, as the base-R step only adds to what the origins gave */
@@ -458,7 +462,26 @@ function libraryAttachesOf(ctx, pkg, spec) {
458
462
  if (spec?.namespaceOnly) {
459
463
  return []; // loading a namespace puts nothing on the search path
460
464
  }
461
- return libraryLayersOf(ctx, pkg, spec).filter(l => l.t !== environment_1.EnvType.Imports && l.n !== undefined).map(l => l.n);
465
+ /* a package R attaches on startup is on the search path already, so a `Depends: methods` adds no entry */
466
+ return libraryLayersOf(ctx, pkg, spec).filter(l => l.t !== environment_1.EnvType.Imports && l.n !== undefined && !r_base_packages_1.AttachedBasePackageSet.has(l.n)).map(l => l.n);
467
+ }
468
+ /**
469
+ * The exports of `pkg` it re-exports from another package, mapped to that package (`%>%` of dplyr to `magrittr`).
470
+ * The analysis keeps such an export as one of `pkg` (`dplyr::%>%`), so both stay apart; this tells where it comes from.
471
+ */
472
+ function libraryReexportsOf(ctx, pkg) {
473
+ const ns = ctx.deps.getDependency(pkg)?.namespaceInfo;
474
+ const reexports = new Map();
475
+ if (ns === undefined) {
476
+ return reexports;
477
+ }
478
+ for (const fn of (0, flowr_namespace_file_1.getCallables)(ns)) {
479
+ const origin = (0, flowr_namespace_file_1.importOrigin)(fn, ns);
480
+ if (origin !== undefined) {
481
+ reexports.set(fn, origin);
482
+ }
483
+ }
484
+ return reexports;
462
485
  }
463
486
  /** The packages loading `pkg` loads directly: its `Depends` and `Imports`, its `NAMESPACE` imports, and a meta-package's core set. */
464
487
  function directLoadsOf(ctx, pkg) {
@@ -379,16 +379,16 @@ function selectExports(callables, spec) {
379
379
  * What a package's attached layer binds, built per name on the first lookup. An attach names thousands of exports
380
380
  * and a script mentions a few dozen, so the definitions are only made for the ones something asks about.
381
381
  */
382
- function lazyExports(pack, exports, ctx, definedAt, cds) {
382
+ function lazyExports(pack, exports, ctx, definedAt, cds, ns) {
383
383
  const byName = new Map(exports.map(exp => [identifier_1.Identifier.getName(identifier_1.Identifier.make(exp.as, pack)), exp]));
384
384
  const aliases = exports.filter(exp => exp.as !== exp.exported).map(exp => `${exp.as}=${exp.exported}`);
385
- return new frame_memory_1.LazyBindings(new Set(byName.keys()), name => [exportDefinition(pack, byName.get(name), ctx, definedAt, cds)], `${pack}|${String(definedAt)}|${aliases.join(',')}|${info_1.ControlDependency.key(cds)}`);
385
+ return new frame_memory_1.LazyBindings(new Set(byName.keys()), name => [exportDefinition(pack, byName.get(name), ctx, definedAt, cds, ns)], `${pack}|${String(definedAt)}|${aliases.join(',')}|${info_1.ControlDependency.key(cds)}`);
386
386
  }
387
387
  /**
388
388
  * The identifier definition binding a package export (or its alias) to its built-in function-definition.
389
389
  * The identity stays the plain export (so a call still materializes its `built-in:pkg:fn` vertex); whatever the configuration states about that name (processor, config, eval handler) rides along on top.
390
390
  */
391
- function exportDefinition(pack, exp, ctx, definedAt = node_id_1.NodeId.toBuiltIn(pack), cds) {
391
+ function exportDefinition(pack, exp, ctx, definedAt = node_id_1.NodeId.toBuiltIn(pack), cds, ns) {
392
392
  const identity = {
393
393
  name: identifier_1.Identifier.make(exp.as, pack),
394
394
  type: identifier_1.ReferenceType.Function,
@@ -398,7 +398,10 @@ function exportDefinition(pack, exp, ctx, definedAt = node_id_1.NodeId.toBuiltIn
398
398
  };
399
399
  /* an export named like a primitive is a method registered for it (lubridate's `$`), the primitive still evaluates the call */
400
400
  const exported = identifier_1.Identifier.make(exp.exported);
401
- const stated = ctx.env.statedFor(pack)?.get(exported)?.[0] ?? ctx.env.emptyBuiltInEnvironment.memory.get(exported)?.[0];
401
+ /* a re-export stays the export of `pack`, but means what its origin states about it */
402
+ const origin = ns === undefined ? undefined : (0, flowr_namespace_file_1.importOrigin)(exp.exported, ns);
403
+ const stated = ctx.env.statedFor(pack)?.get(exported)?.[0] ?? (origin === undefined ? undefined : ctx.env.statedFor(origin)?.get(exported)?.[0])
404
+ ?? ctx.env.emptyBuiltInEnvironment.memory.get(exported)?.[0];
402
405
  if (stated === undefined) {
403
406
  return identity;
404
407
  }
@@ -429,7 +432,7 @@ function attachResolved(dependency, envInfo, ctx, spec, definedAt, attaching, cd
429
432
  spec = withStartupPosition(pack, envInfo, spec);
430
433
  const layerType = spec.namespaceOnly ? environment_1.EnvType.LoadedNamespace : environment_1.EnvType.Namespace;
431
434
  const layer = new environment_1.Environment(envInfo.current).asLibrary(pack, layerType);
432
- layer.adoptMap(lazyExports(pack, exports, ctx, definedAt, cds));
435
+ layer.adoptMap(lazyExports(pack, exports, ctx, definedAt, cds, dependency.namespaceInfo));
433
436
  return { level: envInfo.level, current: environment_1.REnvironment.attachAt(envInfo.current, layer, layer, spec.pos) };
434
437
  }
435
438
  /* as R does: the Depends first (at the default position, whatever `pos` says), then `pack`, then what its `.onAttach` attaches */
@@ -441,7 +444,7 @@ function attachResolved(dependency, envInfo, ctx, spec, definedAt, attaching, cd
441
444
  // full attach: imports layer at the bottom, namespace (exports) layer on top
442
445
  const importsEnv = imports(new environment_1.Environment(below.current).asLibrary(pack, environment_1.EnvType.Imports), dependency.namespaceInfo, ctx);
443
446
  const namespaceEnv = new environment_1.Environment(importsEnv).asLibrary(pack, environment_1.EnvType.Namespace);
444
- namespaceEnv.adoptMap(lazyExports(pack, exports, ctx, definedAt, cds));
447
+ namespaceEnv.adoptMap(lazyExports(pack, exports, ctx, definedAt, cds, dependency.namespaceInfo));
445
448
  const attached = { level: below.level, current: environment_1.REnvironment.attachAt(below.current, namespaceEnv, importsEnv, withStartupPosition(pack, below, spec).pos) };
446
449
  return alongside(attached, onAttach);
447
450
  }
@@ -770,8 +770,9 @@ function askWhatLibraryDoes(analyzer) {
770
770
  const ctx = analyzer.context();
771
771
  return {
772
772
  attaches: df_helper_1.Dataflow.library.attaches(ctx, 'tidyverse'), // the search() entries it adds, dplyr, ggplot2, ... included
773
- loads: df_helper_1.Dataflow.library.loads(ctx, 'tidyverse'), // every namespace it loads, transitively
774
- layers: df_helper_1.Dataflow.library.layers(ctx, 'tidyverse') // the namespace and imports environments it attaches
773
+ loads: df_helper_1.Dataflow.library.loads(ctx, 'tidyverse'), // every namespace it loads, transitively, magrittr included
774
+ layers: df_helper_1.Dataflow.library.layers(ctx, 'tidyverse'), // the namespace and imports environments it attaches
775
+ reexports: df_helper_1.Dataflow.library.reexports(ctx, 'dplyr') // what dplyr re-exports, `%>%` from magrittr included
775
776
  };
776
777
  }
777
778
  async function dummyDataflow() {
@@ -1042,6 +1043,10 @@ To ask what a \`library\` call does without analyzing any code, use ${ctx.link('
1042
1043
  ${ctx.code(askWhatLibraryDoes, { dropLinesStart: 1 })}
1043
1044
 
1044
1045
  It answers from the signature database at the versions the analysis assumes, and also from what flowR states about a package and from the \`NAMESPACE\` files it read.
1046
+ A package R attaches on startup (\`methods\`, \`stats\`, ...) is on the search path already, so a \`Depends\` on it adds no entry.
1047
+ Packages R only loads, such as the \`magrittr\` of \`library(tidyverse)\`, are not attached: their functions are reachable through the re-exports of the attached ones (\`dplyr::%>%\` is \`magrittr::%>%\`).
1048
+ The analysis keeps such a re-export as an export of the re-exporting package, so the two stay apart, and gives it what flowR states about the origin; \`reexports\` names the origin of each.
1049
+ A signature database that records no re-exports falls back to what R reports for the package (\`scripts/gen-r-reexports.R\`, covering the tidyverse and other popular packages).
1045
1050
 
1046
1051
  Last but not least, the information contains the single **entry point** (${JSON.stringify(result.entryPoint)}) and a set of **exit points** (${JSON.stringify(result.exitPoints.map(e => e.nodeId))}).
1047
1052
  Besides marking potential exits, the exit points also provide information about why the exit occurs and which control dependencies affect the exit.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eagleoutice/flowr",
3
- "version": "2.17.2",
3
+ "version": "2.17.3",
4
4
  "description": "Static Dataflow Analyzer and Program Slicer for the R Programming Language",
5
5
  "engines": {
6
6
  "node": ">=22"
@@ -67,6 +67,11 @@ export declare class FlowrNamespaceFile extends FlowrFile<NamespaceFormat> {
67
67
  * @param pkg - The package to check in
68
68
  */
69
69
  export declare function isExportedInNamespaceFormat(this: void, fmt: NamespaceFormat, name: string, pkg?: string): boolean | RNode<ParentInformation>[];
70
+ /**
71
+ * The package an explicit `importFrom(pkg, name)` takes `name` from. A package exporting such a name defines nothing
72
+ * of it but re-exports that package's function (`dplyr::%>%` is `magrittr::%>%`), which stays its own export all the same.
73
+ */
74
+ export declare function importOrigin(this: void, name: string, nsInfo: NamespaceInfo): string | undefined;
70
75
  /** As {@link isExportedInNamespaceFormat}, but for one already picked {@link NamespaceInfo}. */
71
76
  export declare function isExportedInInfo(this: void, name: string, nsInfo: NamespaceInfo): boolean | RNode<ParentInformation>[];
72
77
  /** All exported names of a namespace that can be referenced (functions, symbols, patterns, and S3 methods as `generic.class`). */
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.FlowrNamespaceFile = void 0;
4
4
  exports.isExportedInNamespaceFormat = isExportedInNamespaceFormat;
5
+ exports.importOrigin = importOrigin;
5
6
  exports.isExportedInInfo = isExportedInInfo;
6
7
  exports.getExportedNames = getExportedNames;
7
8
  exports.getCallables = getCallables;
@@ -81,6 +82,18 @@ function isExportedInNamespaceFormat(fmt, name, pkg = 'current') {
81
82
  const nsInfo = pkg === 'current' ? fmt.current : fmt[pkg];
82
83
  return nsInfo ? isExportedInInfo(name, nsInfo) : false;
83
84
  }
85
+ /**
86
+ * The package an explicit `importFrom(pkg, name)` takes `name` from. A package exporting such a name defines nothing
87
+ * of it but re-exports that package's function (`dplyr::%>%` is `magrittr::%>%`), which stays its own export all the same.
88
+ */
89
+ function importOrigin(name, nsInfo) {
90
+ for (const [pkg, names] of nsInfo.importedPackages) {
91
+ if (names !== 'all' && names.includes(name)) {
92
+ return pkg;
93
+ }
94
+ }
95
+ return undefined;
96
+ }
84
97
  /** As {@link isExportedInNamespaceFormat}, but for one already picked {@link NamespaceInfo}. */
85
98
  function isExportedInInfo(name, nsInfo) {
86
99
  if (nsInfo.exportedSymbols.includes(name) || nsInfo.exportedFunctions.includes(name)
@@ -116,4 +116,4 @@ export declare class FlowrAnalyzerPackageVersionsSigDbPlugin extends FlowrAnalyz
116
116
  * The resolved {@link Package} (namespace and version) of a source's export view. What the configuration states
117
117
  * for the package (`stated`) is part of its interface, even where the source misses it.
118
118
  */
119
- export declare function packageFromExports(name: string, info: Pick<LibraryExports, 'exported' | 's4Classes' | 'version'>, stated?: Iterable<unknown>): Package;
119
+ export declare function packageFromExports(name: string, info: Pick<LibraryExports, 'exported' | 's4Classes' | 'version' | 'reexports'>, stated?: Iterable<unknown>): Package;
@@ -56,6 +56,7 @@ const r_version_1 = require("../../../util/r-version");
56
56
  const r_base_packages_1 = require("../../../util/r-base-packages");
57
57
  const defaultmap_1 = require("../../../util/collections/defaultmap");
58
58
  const arrays_1 = require("../../../util/collections/arrays");
59
+ const r_reexports_generated_1 = require("../../../data/r-reexports.generated");
59
60
  const secure_mode_1 = require("../../../util/secure-mode");
60
61
  /** the plugin's instance name (pass to `unregisterPlugins` to disable the default sigdb resolver) */
61
62
  exports.SigDbPluginName = 'flowr-analyzer-package-versions-sigdb-plugin';
@@ -493,7 +494,9 @@ exports.FlowrAnalyzerPackageVersionsSigDbPlugin = FlowrAnalyzerPackageVersionsSi
493
494
  * for the package (`stated`) is part of its interface, even where the source misses it.
494
495
  */
495
496
  function packageFromExports(name, info, stated) {
496
- const exported = stated === undefined ? info.exported.slice() : (0, arrays_1.uniqueArray)([...info.exported, ...[...stated].map(String)]);
497
+ /* a source that records no re-exports lacks them altogether, so R's own answer for the package stands in */
498
+ const reexports = info.reexports ?? knownReexports(name);
499
+ const exported = (0, arrays_1.uniqueArray)([...info.exported, ...reexports?.keys() ?? [], ...[...stated ?? []].map(String)]);
497
500
  const namespaceInfo = {
498
501
  exportedSymbols: exported,
499
502
  exportedFunctions: [],
@@ -502,7 +505,8 @@ function packageFromExports(name, info, stated) {
502
505
  exportedS4Classes: info.s4Classes.slice(),
503
506
  exportS3Generics: reconstructS3Generics(exported),
504
507
  exportedPatterns: [],
505
- importedPackages: new Map(),
508
+ /* a re-export is an `importFrom()` of the name the package exports */
509
+ importedPackages: reexportImports(reexports),
506
510
  loadsWithSideEffects: false,
507
511
  callable: exported
508
512
  };
@@ -510,4 +514,23 @@ function packageFromExports(name, info, stated) {
510
514
  carries no version rather than a made-up one */
511
515
  return new package_1.Package({ name, namespaceInfo, resolvedVersion: info.version || undefined });
512
516
  }
517
+ /** the re-exports R reports for `pkg`, see {@link RReexports} */
518
+ function knownReexports(pkg) {
519
+ const known = Object.hasOwn(r_reexports_generated_1.RReexports, pkg) ? r_reexports_generated_1.RReexports[pkg] : undefined;
520
+ return known === undefined ? undefined : new Map(Object.entries(known.reexports));
521
+ }
522
+ /** the `importFrom(origin, names)` directives behind a source's re-exports, grouped by origin */
523
+ function reexportImports(reexports) {
524
+ const imports = new Map();
525
+ for (const [fn, origin] of reexports ?? []) {
526
+ const names = imports.get(origin);
527
+ if (names === undefined) {
528
+ imports.set(origin, [fn]);
529
+ }
530
+ else {
531
+ names.push(fn);
532
+ }
533
+ }
534
+ return imports;
535
+ }
513
536
  //# sourceMappingURL=flowr-analyzer-package-versions-sigdb-plugin.js.map
@@ -127,7 +127,8 @@ function buildBlob(p, strings, tier, feats) {
127
127
  const fn = (f) => {
128
128
  const base = [strings.str(f.name), sig(f.params), cg(f.callees), f.props,
129
129
  feats.locations && f.file ? strings.str(f.file) : -1, feats.locations ? f.line ?? -1 : -1];
130
- const rec = f.topic && f.topic !== f.name ? [...base, strings.str(f.topic)] : base;
130
+ const topic = f.topic && f.topic !== f.name ? strings.str(f.topic) : -1;
131
+ const rec = f.reexportOf ? [...base, topic, strings.str(f.reexportOf)] : topic >= 0 ? [...base, topic] : base;
131
132
  return fns.intern(rec.join(','), rec);
132
133
  };
133
134
  const depList = (list) => {
@@ -388,9 +389,7 @@ function optimizeStringOrder(strings, blobs) {
388
389
  for (const f of blob.fns) {
389
390
  bump(f[0]);
390
391
  bump(f[4]);
391
- if (f[6] !== undefined) {
392
- bump(f[6]);
393
- }
392
+ f.slice(6).forEach(bump);
394
393
  }
395
394
  for (const list of blob.deps) {
396
395
  for (const d of list) {
@@ -458,8 +457,10 @@ function optimizeStringOrder(strings, blobs) {
458
457
  if (f[4] >= 0) {
459
458
  f[4] = remap[f[4]];
460
459
  }
461
- if (f[6] !== undefined && f[6] >= 0) {
462
- f[6] = remap[f[6]];
460
+ for (let i = 6; i < f.length; i++) {
461
+ if (f[i] >= 0) {
462
+ f[i] = remap[f[i]];
463
+ }
463
464
  }
464
465
  }
465
466
  for (const list of blob.deps) {
@@ -42,6 +42,8 @@ export interface DecodedFunction {
42
42
  readonly callees: readonly string[];
43
43
  /** the Rd help topic (man-page name) documenting this function, when it differs from {@link name} */
44
44
  readonly topic?: string;
45
+ /** the package this name is re-exported from, see {@link SigFunctionInfo.reexportOf} */
46
+ readonly reexportOf?: string;
45
47
  }
46
48
  /**
47
49
  * The transitive callees of `name`. Each local callee that is itself a function of `functions` (one package
@@ -75,7 +75,7 @@ function transitiveCallees(functions, name) {
75
75
  }
76
76
  /** decode one of a blob's function records against the global string dictionary */
77
77
  function decodeFunction(strings, blob, fnIdx) {
78
- const [nameIdx, sigIdx, cgIdx, bits, fileIdx, line, topicIdx] = blob.fns[fnIdx];
78
+ const [nameIdx, sigIdx, cgIdx, bits, fileIdx, line, topicIdx, reexportIdx] = blob.fns[fnIdx];
79
79
  const name = strings.at(nameIdx);
80
80
  const signature = (sigIdx >= 0 ? blob.sigs[sigIdx] : []).map(p => {
81
81
  const [n, props, def] = Array.isArray(p) ? [p[0], p[1], p.length === 3 ? p[2] : -1] : [p, 0, -1];
@@ -89,6 +89,7 @@ function decodeFunction(strings, blob, fnIdx) {
89
89
  return (0, objects_1.compactRecord)({
90
90
  name,
91
91
  topic: topicIdx !== undefined && topicIdx >= 0 ? strings.at(topicIdx) : undefined,
92
+ reexportOf: reexportIdx !== undefined ? strings.at(reexportIdx) : undefined,
92
93
  file: fileIdx >= 0 ? strings.at(fileIdx) : undefined,
93
94
  line,
94
95
  exported: isExportedEntry(bits, name),
@@ -169,8 +170,9 @@ function deriveLibraryExports(strings, blob, meta, pkg, version, cranBase = sche
169
170
  const s3Classes = [];
170
171
  const s4Classes = [];
171
172
  const locations = new Map();
173
+ const reexports = new Map();
172
174
  for (const i of idxs) {
173
- const [nameIdx, , , bits, fileIdx, line] = blob.fns[i];
175
+ const [nameIdx, , , bits, fileIdx, line, , reexportIdx] = blob.fns[i];
174
176
  const name = strings.at(nameIdx);
175
177
  (isExportedEntry(bits, name) ? exported : internal).push(name);
176
178
  if (bits & 32 /* FnProp.Deprecated */) {
@@ -185,12 +187,16 @@ function deriveLibraryExports(strings, blob, meta, pkg, version, cranBase = sche
185
187
  if (fileIdx >= 0) {
186
188
  locations.set(name, { file: strings.at(fileIdx), line });
187
189
  }
190
+ if (reexportIdx !== undefined) {
191
+ reexports.set(name, strings.at(reexportIdx));
192
+ }
188
193
  }
189
194
  const cran = !blob.noncran?.includes(ver);
190
195
  return {
191
196
  version: ver, exported, internal, deprecated, s3Classes, s4Classes, cran,
192
197
  cranUrl: cranBlobUrl(cranBase, pkg, ver, { latest, archived: archived === 1, cran }),
193
- ...(locations.size > 0 ? { locations } : {})
198
+ ...(locations.size > 0 ? { locations } : {}),
199
+ ...(reexports.size > 0 ? { reexports } : {})
194
200
  };
195
201
  }
196
202
  //# sourceMappingURL=decode.js.map
@@ -30,6 +30,8 @@ export interface LibraryExports {
30
30
  readonly cranUrl?: string;
31
31
  /** definition location per identifier, if the database carries them */
32
32
  readonly locations?: ReadonlyMap<string, SigDefinitionLocation>;
33
+ /** the package each re-exported name comes from (`importFrom(magrittr, "%>%")` plus `export("%>%")`), if the database carries it */
34
+ readonly reexports?: ReadonlyMap<string, string>;
33
35
  }
34
36
  export declare const SigDbMagic = "flowr-sigdb";
35
37
  export declare const SigDbSchema = 5;
@@ -92,10 +94,11 @@ export type SigParam = number | [nameIdx: number, props: number] | [nameIdx: num
92
94
  export type Sig = SigParam[];
93
95
  /**
94
96
  * One function record `[nameIdx, sigIdx, cgIdx, propBits, fileIdx, line]` (`sigIdx`/`cgIdx`/`fileIdx` are -1 when
95
- * absent), with an optional trailing `topicIdx` (the Rd help topic, present only when it differs from the name).
96
- * The trailing element is additive: readers that stop at `line` ignore it, so older bundles stay readable.
97
+ * absent), with an optional trailing `topicIdx` (the Rd help topic, -1 when it equals the name) and, after it, an
98
+ * optional `reexportIdx` (the package a re-export comes from).
99
+ * The trailing elements are additive: readers that stop at `line` ignore them, so older bundles stay readable.
97
100
  */
98
- export type SigFn = [nameIdx: number, sigIdx: number, cgIdx: number, propBits: number, fileIdx: number, line: number] | [nameIdx: number, sigIdx: number, cgIdx: number, propBits: number, fileIdx: number, line: number, topicIdx: number];
101
+ export type SigFn = [nameIdx: number, sigIdx: number, cgIdx: number, propBits: number, fileIdx: number, line: number] | [nameIdx: number, sigIdx: number, cgIdx: number, propBits: number, fileIdx: number, line: number, topicIdx: number] | [nameIdx: number, sigIdx: number, cgIdx: number, propBits: number, fileIdx: number, line: number, topicIdx: number, reexportIdx: number];
99
102
  /** the object system a class record belongs to, mirroring {@link ClassSystem} in a single on-disk byte */
100
103
  export declare const enum SigClassSystem {
101
104
  S4 = 0,
@@ -236,6 +239,8 @@ export interface SigFunctionInfo {
236
239
  readonly line?: number;
237
240
  /** the Rd help topic (man-page name) documenting this function, when it differs from {@link name} */
238
241
  readonly topic?: string;
242
+ /** the package this name is re-exported from: the package defines nothing of the name, it imports and exports it */
243
+ readonly reexportOf?: string;
239
244
  }
240
245
  /** one declared package dependency, e.g. `{ name: 'testthat', type: Suggests, constraint: '>= 2.1.0' }` */
241
246
  export interface SigDependencyInfo {
@@ -3,7 +3,7 @@
3
3
  * @module
4
4
  */
5
5
  import { SemVer } from 'semver';
6
- export declare const versionDate = "2026-11-05T14:04:12Z";
6
+ export declare const versionDate = "2026-11-06T08:48:46Z";
7
7
  /**
8
8
  * Retrieves the current flowR version as a new {@link SemVer} object.
9
9
  */
@@ -8,9 +8,9 @@ exports.flowrVersion = flowrVersion;
8
8
  */
9
9
  const semver_1 = require("semver");
10
10
  // this is automatically replaced with the current version by release-it
11
- const version = '2.17.2';
11
+ const version = '2.17.3';
12
12
  // this is automatically replaced with the release date by release-it (scripts/bump-version.ts)
13
- exports.versionDate = '2026-11-05T14:04:12Z';
13
+ exports.versionDate = '2026-11-06T08:48:46Z';
14
14
  /**
15
15
  * Retrieves the current flowR version as a new {@link SemVer} object.
16
16
  */