@eagleoutice/flowr 2.13.16 → 2.14.1

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.
Files changed (253) hide show
  1. package/README.md +36 -25
  2. package/abstract-interpretation/absint-visitor.js +1 -1
  3. package/abstract-interpretation/data-frame/mappers/access-mapper.js +4 -4
  4. package/abstract-interpretation/data-frame/mappers/arguments.js +7 -4
  5. package/abstract-interpretation/data-frame/mappers/function-mapper.js +18 -17
  6. package/abstract-interpretation/data-frame/mappers/replacement-mapper.js +6 -6
  7. package/abstract-interpretation/data-frame/resolve-args.d.ts +9 -4
  8. package/abstract-interpretation/data-frame/resolve-args.js +10 -5
  9. package/benchmark/calibration.d.ts +16 -7
  10. package/benchmark/calibration.js +44 -17
  11. package/benchmark/slicer.d.ts +3 -2
  12. package/benchmark/slicer.js +9 -5
  13. package/benchmark/stats/size-of.js +1 -1
  14. package/benchmark/summarizer/first-phase/process.d.ts +2 -0
  15. package/benchmark/summarizer/first-phase/process.js +2 -0
  16. package/cli/benchmark-app.js +4 -1
  17. package/cli/benchmark-helper-app.d.ts +1 -0
  18. package/cli/benchmark-helper-app.js +2 -2
  19. package/cli/common/options.d.ts +5 -31
  20. package/cli/common/options.js +2 -8
  21. package/cli/common/scripts-info.d.ts +5 -38
  22. package/cli/common/scripts-info.js +0 -8
  23. package/cli/repl/core.js +1 -1
  24. package/cli/repl/execute.d.ts +2 -2
  25. package/cli/repl/execute.js +2 -2
  26. package/cli/repl/parser/slice-query-parser.js +1 -1
  27. package/cli/repl/print-version.js +2 -2
  28. package/config.d.ts +16 -0
  29. package/config.js +83 -5
  30. package/control-flow/extract-cfg.js +1 -1
  31. package/control-flow/semantic-cfg-guided-visitor.d.ts +1 -1
  32. package/control-flow/semantic-cfg-guided-visitor.js +1 -1
  33. package/control-flow/useless-loop.js +1 -1
  34. package/core/print/slice-diff-ansi.js +1 -1
  35. package/core/steps/pipeline/create-pipeline.js +1 -1
  36. package/dataflow/cluster.js +2 -2
  37. package/dataflow/environments/apply-kill.js +1 -1
  38. package/dataflow/environments/built-in-props.d.ts +13 -2
  39. package/dataflow/environments/built-in-props.js +23 -1
  40. package/dataflow/environments/built-in.d.ts +7 -1
  41. package/dataflow/environments/built-in.js +42 -3
  42. package/dataflow/environments/default-builtin-config.d.ts +518 -11
  43. package/dataflow/environments/default-builtin-config.js +218 -23
  44. package/dataflow/environments/environment.d.ts +10 -2
  45. package/dataflow/environments/environment.js +25 -7
  46. package/dataflow/environments/identifier.d.ts +8 -2
  47. package/dataflow/environments/identifier.js +6 -1
  48. package/dataflow/environments/query-fn-props.d.ts +6 -0
  49. package/dataflow/environments/query-fn-props.js +22 -2
  50. package/dataflow/environments/reference-to-maybe.js +5 -5
  51. package/dataflow/environments/resolve-by-name.d.ts +3 -0
  52. package/dataflow/environments/resolve-by-name.js +44 -7
  53. package/dataflow/environments/resolve-helper.d.ts +6 -0
  54. package/dataflow/environments/resolve-helper.js +6 -0
  55. package/dataflow/eval/resolve/alias-tracking.d.ts +5 -0
  56. package/dataflow/eval/resolve/alias-tracking.js +21 -14
  57. package/dataflow/eval/resolve/node-value.d.ts +6 -0
  58. package/dataflow/eval/resolve/node-value.js +15 -9
  59. package/dataflow/eval/resolve/resolve-argument.js +2 -2
  60. package/dataflow/eval/resolve/resolve-numbers.js +2 -2
  61. package/dataflow/eval/resolve/resolve-operators.js +5 -4
  62. package/dataflow/eval/resolve/resolve-strings.js +3 -3
  63. package/dataflow/eval/resolve/resolve-working-directory.d.ts +1 -1
  64. package/dataflow/eval/resolve/resolve-working-directory.js +3 -3
  65. package/dataflow/eval/resolve/resolve.d.ts +5 -5
  66. package/dataflow/eval/resolve/resolve.js +10 -11
  67. package/dataflow/eval/values/general.d.ts +4 -1
  68. package/dataflow/eval/values/general.js +1 -1
  69. package/dataflow/extractor.js +2 -1
  70. package/dataflow/fn/exceptions-of-function.d.ts +3 -1
  71. package/dataflow/fn/exceptions-of-function.js +87 -39
  72. package/dataflow/fn/higher-order-function.js +5 -4
  73. package/dataflow/fn/strict-function.d.ts +40 -0
  74. package/dataflow/fn/strict-function.js +337 -0
  75. package/dataflow/graph/call-graph.js +14 -14
  76. package/dataflow/graph/df-helper.d.ts +24 -1
  77. package/dataflow/graph/df-helper.js +29 -7
  78. package/dataflow/graph/diff-dataflow-graph.js +6 -6
  79. package/dataflow/graph/edge.d.ts +27 -0
  80. package/dataflow/graph/edge.js +33 -0
  81. package/dataflow/graph/graph-helper.d.ts +3 -4
  82. package/dataflow/graph/graph-helper.js +4 -5
  83. package/dataflow/graph/graph.d.ts +39 -3
  84. package/dataflow/graph/graph.js +75 -7
  85. package/dataflow/graph/vertex.d.ts +42 -6
  86. package/dataflow/graph/vertex.js +42 -6
  87. package/dataflow/info.d.ts +26 -0
  88. package/dataflow/info.js +28 -1
  89. package/dataflow/internal/linker.d.ts +1 -0
  90. package/dataflow/internal/linker.js +11 -9
  91. package/dataflow/internal/process/functions/call/built-in/built-in-access.js +2 -2
  92. package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +1 -1
  93. package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +6 -5
  94. package/dataflow/internal/process/functions/call/built-in/built-in-class-generator.js +2 -2
  95. package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.js +6 -7
  96. package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +7 -6
  97. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.d.ts +1 -0
  98. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +19 -18
  99. package/dataflow/internal/process/functions/call/built-in/built-in-library.js +6 -1
  100. package/dataflow/internal/process/functions/call/built-in/built-in-list.js +2 -2
  101. package/dataflow/internal/process/functions/call/built-in/built-in-local.js +2 -2
  102. package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +2 -2
  103. package/dataflow/internal/process/functions/call/built-in/built-in-purrr-formula.js +5 -5
  104. package/dataflow/internal/process/functions/call/built-in/built-in-quote.js +1 -1
  105. package/dataflow/internal/process/functions/call/built-in/built-in-register-hook.js +3 -3
  106. package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +3 -3
  107. package/dataflow/internal/process/functions/call/built-in/built-in-rm.d.ts +1 -0
  108. package/dataflow/internal/process/functions/call/built-in/built-in-rm.js +29 -3
  109. package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.js +3 -3
  110. package/dataflow/internal/process/functions/call/built-in/built-in-source.js +1 -1
  111. package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.js +3 -3
  112. package/dataflow/internal/process/functions/call/built-in/transitive-side-effects.d.ts +3 -1
  113. package/dataflow/internal/process/functions/call/built-in/transitive-side-effects.js +44 -20
  114. package/dataflow/internal/process/functions/call/common.d.ts +9 -1
  115. package/dataflow/internal/process/functions/call/common.js +17 -6
  116. package/dataflow/internal/process/functions/call/deferred.js +2 -1
  117. package/dataflow/internal/process/functions/call/known-call-handling.d.ts +3 -1
  118. package/dataflow/internal/process/functions/call/known-call-handling.js +6 -3
  119. package/dataflow/internal/process/functions/call/named-call-handling.js +44 -12
  120. package/dataflow/internal/process/functions/call/nse.d.ts +33 -5
  121. package/dataflow/internal/process/functions/call/nse.js +113 -6
  122. package/dataflow/internal/process/functions/call/quoted.d.ts +5 -0
  123. package/dataflow/internal/process/functions/call/quoted.js +21 -9
  124. package/dataflow/origin/dfg-get-origin.d.ts +1 -0
  125. package/dataflow/origin/dfg-get-origin.js +9 -6
  126. package/documentation/data/faq/faqs.js +88 -88
  127. package/documentation/data/faq/recommended-configs.js +1 -1
  128. package/documentation/data/faq/wiki-faq-store.js +1 -1
  129. package/documentation/doc-capabilities.js +1 -1
  130. package/documentation/doc-readme.js +1 -1
  131. package/documentation/doc-util/doc-auto-gen.js +6 -2
  132. package/documentation/doc-util/doc-functions.js +1 -1
  133. package/documentation/wiki-cfg.js +2 -2
  134. package/documentation/wiki-core.js +1 -1
  135. package/documentation/wiki-create-linting-rules.js +45 -45
  136. package/documentation/wiki-dataflow-graph.js +18 -18
  137. package/documentation/wiki-linter.js +1 -0
  138. package/documentation/wiki-linting-and-testing.js +93 -5
  139. package/documentation/wiki-mk/doc-maker.js +1 -1
  140. package/documentation/wiki-overview.js +12 -1
  141. package/documentation/wiki-query.js +53 -0
  142. package/documentation/wiki-signature-database.js +3 -0
  143. package/linter/linter-output.js +1 -1
  144. package/linter/linter-rules.d.ts +24 -0
  145. package/linter/linter-rules.js +3 -1
  146. package/linter/rules/file-path-validity.js +1 -1
  147. package/linter/rules/function-finder-util.js +1 -1
  148. package/linter/rules/naming-convention.js +1 -1
  149. package/linter/rules/network-functions.d.ts +1 -1
  150. package/linter/rules/no-leaked-credentials.js +2 -1
  151. package/linter/rules/stop-with-call-arg.js +4 -4
  152. package/linter/rules/unclosed-connection.d.ts +44 -0
  153. package/linter/rules/unclosed-connection.js +200 -0
  154. package/linter/rules/undefined-symbol-util.d.ts +1 -1
  155. package/linter/rules/undefined-symbol-util.js +5 -4
  156. package/linter/rules/undefined-symbol.js +3 -3
  157. package/linter/rules/unused-definition.js +2 -1
  158. package/package.json +38 -51
  159. package/project/context/flowr-analyzer-environment-context.d.ts +23 -0
  160. package/project/context/flowr-analyzer-environment-context.js +25 -0
  161. package/project/dependency-version-space.d.ts +3 -3
  162. package/project/dependency-version-space.js +3 -4
  163. package/project/flowr-analyzer.js +1 -1
  164. package/project/plugins/file-plugins/files/flowr-description-file.d.ts +1 -1
  165. package/project/plugins/file-plugins/files/flowr-description-file.js +1 -1
  166. package/project/plugins/file-plugins/files/flowr-namespace-file.d.ts +1 -1
  167. package/project/plugins/file-plugins/files/flowr-namespace-file.js +1 -1
  168. package/project/plugins/file-plugins/files/flowr-news-file.d.ts +1 -1
  169. package/project/plugins/file-plugins/files/flowr-news-file.js +1 -1
  170. package/project/plugins/file-plugins/files/flowr-rda-file.d.ts +1 -1
  171. package/project/plugins/file-plugins/files/flowr-rda-file.js +4 -4
  172. package/project/plugins/file-plugins/files/flowr-rmarkdown-file.js +2 -2
  173. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.d.ts +5 -5
  174. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.js +36 -7
  175. package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.js +2 -2
  176. package/project/sigdb/build.js +16 -16
  177. package/project/sigdb/codec.d.ts +1 -1
  178. package/project/sigdb/codec.js +13 -13
  179. package/project/sigdb/decompress.d.ts +1 -1
  180. package/project/sigdb/decompress.js +33 -33
  181. package/project/sigdb/index-format.js +2 -2
  182. package/project/sigdb/manifest.d.ts +3 -1
  183. package/project/sigdb/manifest.js +68 -27
  184. package/project/sigdb/memory-source.d.ts +64 -0
  185. package/project/sigdb/memory-source.js +133 -0
  186. package/project/sigdb/reader.js +14 -14
  187. package/project/sigdb/schema.d.ts +2 -2
  188. package/project/sigdb/schema.js +2 -2
  189. package/queries/catalog/call-context-query/call-context-query-executor.js +1 -1
  190. package/queries/catalog/call-context-query/identify-link-to-last-call-relation.js +2 -2
  191. package/queries/catalog/dependencies-query/dependencies-query-executor.js +2 -2
  192. package/queries/catalog/dependencies-query/dependencies-query-format.js +1 -1
  193. package/queries/catalog/dependencies-query/link-devices.js +3 -9
  194. package/queries/catalog/does-call-query/does-call-query-executor.js +2 -1
  195. package/queries/catalog/input-sources-query/simple-input-classifier.js +4 -4
  196. package/queries/catalog/inspect-exceptions-query/inspect-exception-query-executor.js +2 -1
  197. package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-executor.js +1 -0
  198. package/queries/catalog/inspect-strictness-query/inspect-strictness-query-executor.d.ts +6 -0
  199. package/queries/catalog/inspect-strictness-query/inspect-strictness-query-executor.js +25 -0
  200. package/queries/catalog/inspect-strictness-query/inspect-strictness-query-format.d.ts +31 -0
  201. package/queries/catalog/inspect-strictness-query/inspect-strictness-query-format.js +56 -0
  202. package/queries/catalog/location-map-query/location-map-query-format.js +1 -1
  203. package/queries/catalog/resolve-value-query/resolve-value-query-executor.js +2 -2
  204. package/queries/catalog/signature-query/signature-query-executor.d.ts +2 -0
  205. package/queries/catalog/signature-query/signature-query-executor.js +3 -2
  206. package/queries/catalog/slice-query-options.d.ts +1 -1
  207. package/queries/catalog/slice-query-options.js +1 -1
  208. package/queries/query-function-filter.d.ts +8 -2
  209. package/queries/query-function-filter.js +11 -1
  210. package/queries/query.d.ts +11 -1
  211. package/queries/query.js +2 -0
  212. package/r-bridge/lang-4.x/ast/model/model.d.ts +4 -4
  213. package/r-bridge/lang-4.x/ast/model/model.js +4 -4
  214. package/r-bridge/lang-4.x/ast/model/processing/node-id.js +3 -3
  215. package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-call.js +1 -1
  216. package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-definition.js +1 -1
  217. package/r-bridge/retriever.d.ts +2 -1
  218. package/r-bridge/retriever.js +3 -2
  219. package/r-bridge/roxygen2/documentation-provider.d.ts +1 -0
  220. package/r-bridge/roxygen2/documentation-provider.js +1 -0
  221. package/r-bridge/roxygen2/roxygen-parse.d.ts +1 -1
  222. package/r-bridge/roxygen2/roxygen-parse.js +1 -1
  223. package/search/flowr-search-filters.d.ts +1 -1
  224. package/search/flowr-search-filters.js +2 -14
  225. package/search/search-executor/search-enrichers.js +4 -4
  226. package/search/search-executor/search-generators.js +1 -1
  227. package/slicing/criterion/parse.d.ts +2 -2
  228. package/slicing/criterion/parse.js +5 -5
  229. package/slicing/static/fingerprint.js +1 -1
  230. package/slicing/static/slice-call.d.ts +1 -1
  231. package/slicing/static/slice-call.js +2 -2
  232. package/slicing/static/static-slicer.js +4 -3
  233. package/util/assert.js +1 -1
  234. package/util/log.d.ts +4 -1
  235. package/util/log.js +15 -2
  236. package/util/logic.js +2 -2
  237. package/util/mermaid/cfg.js +1 -1
  238. package/util/mermaid/dfg.js +6 -6
  239. package/util/mermaid/mermaid.js +3 -1
  240. package/util/objects.d.ts +12 -0
  241. package/util/objects.js +48 -0
  242. package/util/quads.js +19 -6
  243. package/util/schema.js +2 -2
  244. package/util/simple-df/dfg-ascii.js +14 -3
  245. package/util/text/ansi.d.ts +2 -0
  246. package/util/text/ansi.js +8 -0
  247. package/util/text/name-rank.d.ts +29 -0
  248. package/util/text/name-rank.js +39 -0
  249. package/util/text/url-encoding.d.ts +15 -0
  250. package/util/text/url-encoding.js +59 -0
  251. package/util/version.js +1 -1
  252. package/cli/export-quads-app.d.ts +0 -7
  253. package/cli/export-quads-app.js +0 -44
@@ -2,6 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DefaultBuiltinConfig = exports.WrittenBuiltinDefinitions = exports.RGroupGenerics = exports.GgPlotAddons = exports.GraphicsPlotAddons = exports.PlotFunctionsWithAddParam = exports.GgPlotImplicitAddons = exports.TinyPlotAddons = exports.PlotCreate = exports.GraphicsPlotCreate = exports.TinyPlotCrate = exports.GgPlotCreate = exports.PlotFunctionPackages = exports.StackEnvBuiltins = exports.StackEnvKind = void 0;
4
4
  exports.namespacePlotFunctions = namespacePlotFunctions;
5
+ exports.statedSignatures = statedSignatures;
6
+ exports.statedSignatureOf = statedSignatureOf;
5
7
  exports.getDefaultProcessor = getDefaultProcessor;
6
8
  const identify_link_to_last_call_relation_1 = require("../../queries/catalog/call-context-query/identify-link-to-last-call-relation");
7
9
  const type_1 = require("../../r-bridge/lang-4.x/ast/model/type");
@@ -162,13 +164,47 @@ exports.GgPlotAddons = [
162
164
  'ggdraw', 'last_plot'
163
165
  ];
164
166
  const PlotAddons = exports.GraphicsPlotAddons.concat(exports.GgPlotImplicitAddons, ...exports.PlotFunctionsWithAddParam);
165
- /* the argument shapes that repeat below: what the call computes its result from */
166
- const SigBinOp = [['e1', built_in_props_1.ArgProp.Value], ['e2', built_in_props_1.ArgProp.Value]];
167
+ const SigAtomicBinOp = [['e1', built_in_props_1.ArgProp.Value | built_in_props_1.ArgProp.Atomic], ['e2', built_in_props_1.ArgProp.Value | built_in_props_1.ArgProp.Atomic]];
168
+ const SigAtomicX = [['x', built_in_props_1.ArgProp.Value | built_in_props_1.ArgProp.Atomic]];
167
169
  const SigXY = [['x', built_in_props_1.ArgProp.Value], ['y', built_in_props_1.ArgProp.Value]];
168
170
  const SigX = [['x', built_in_props_1.ArgProp.Value]];
171
+ /* `f(x, ...)`, the shape of most of R's summarizing and coercing functions */
172
+ const SigXDots = [['x', built_in_props_1.ArgProp.Value], ['...', built_in_props_1.ArgProp.Value]];
173
+ /* `verb(.data, ...)`, the shape of the tidyverse verbs: the data first, the columns after */
174
+ const SigDataDots = [['.data', built_in_props_1.ArgProp.Value], ['...', built_in_props_1.ArgProp.Value]];
169
175
  const SigShape = [['x', built_in_props_1.ArgProp.Shape]];
170
176
  const SigXTable = [['x', built_in_props_1.ArgProp.Value], ['table', built_in_props_1.ArgProp.Value]];
171
177
  const SigDots = [['...', built_in_props_1.ArgProp.Value]];
178
+ /**
179
+ * What flowR states about every function it carries a definition for, as `name -> signatures`. A name may be
180
+ * defined for several packages (`filter` is dplyr's and cohortBuilder's), so all of them are here and the
181
+ * caller picks by package; {@link statedSignatureOf} does that. The signature browser and the playground both
182
+ * show this next to what a database says, so both read it from here.
183
+ */
184
+ function statedSignatures(definitions = exports.DefaultBuiltinConfig) {
185
+ const stated = new Map();
186
+ for (const definition of definitions) {
187
+ const info = definition.config;
188
+ for (const id of definition.names) {
189
+ const name = String(identifier_1.Identifier.getName(id));
190
+ const pkg = String(identifier_1.Identifier.getNamespace(id) ?? "base" /* PkgName.Base */);
191
+ const declared = (info?.sig ?? []).map(([param]) => param);
192
+ const entry = { pkg, params: declared.length > 0 ? declared.join(', ') : undefined, props: (0, built_in_props_1.callPropWords)(info?.props) };
193
+ const known = stated.get(name) ?? [];
194
+ /* the last definition for a package is the one that resolves, so it is the one stated */
195
+ stated.set(name, [...known.filter(other => other.pkg !== pkg), entry]);
196
+ }
197
+ }
198
+ return stated;
199
+ }
200
+ /**
201
+ * The one of {@link statedSignatures} a reader means: the definition for `pkg` when there is one, else base
202
+ * R's, else whichever came first. `undefined` when flowR states nothing about the name at all.
203
+ */
204
+ function statedSignatureOf(stated, name, pkg) {
205
+ const known = stated.get(name);
206
+ return known?.find(entry => entry.pkg === pkg) ?? known?.find(entry => entry.pkg === "base" /* PkgName.Base */) ?? known?.[0];
207
+ }
172
208
  const RegexConvIn = /[-/\\^$*+?.()|[\]{}]/g;
173
209
  /** Builds a regex from an array of plain names or namespaced {@link Identifier}s, deduplicating by name. */
174
210
  function toRegex(n) {
@@ -313,17 +349,17 @@ exports.WrittenBuiltinDefinitions = [
313
349
  },
314
350
  /* an {@link BuiltInEvalName} marks what the value solver folds; a test checks the names against the handler tables */
315
351
  { type: 'function', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['+', '-', '*', '/', '^', '**', '%%', '%/%']),
316
- processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure, sig: SigBinOp }, assumePrimitive: true, evalHandler: built_in_eval_name_1.BuiltInEvalName.Numeric },
352
+ processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure, sig: SigAtomicBinOp }, assumePrimitive: true, evalHandler: built_in_eval_name_1.BuiltInEvalName.Numeric },
317
353
  { type: 'function', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['==', '!=', '>', '<', '>=', '<=']),
318
- processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure, sig: SigBinOp }, assumePrimitive: true, evalHandler: built_in_eval_name_1.BuiltInEvalName.Comparison },
354
+ processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure, sig: SigAtomicBinOp }, assumePrimitive: true, evalHandler: built_in_eval_name_1.BuiltInEvalName.Comparison },
319
355
  { type: 'function', names: [identifier_1.Identifier.from(['%*%', "base" /* PkgName.Base */])],
320
356
  processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure, sig: SigXY }, assumePrimitive: true },
321
357
  { type: 'function', names: [identifier_1.Identifier.from(['%in%', "base" /* PkgName.Base */])],
322
358
  processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure, sig: SigXTable }, assumePrimitive: true },
323
359
  { type: 'function', names: [identifier_1.Identifier.from([':', "base" /* PkgName.Base */])],
324
- processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure, sig: [['from', built_in_props_1.ArgProp.Value], ['to', built_in_props_1.ArgProp.Value]] }, assumePrimitive: true, evalHandler: built_in_eval_name_1.BuiltInEvalName.Seq },
360
+ processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure, sig: [['from', built_in_props_1.ArgProp.Value | built_in_props_1.ArgProp.Atomic], ['to', built_in_props_1.ArgProp.Value | built_in_props_1.ArgProp.Atomic]] }, assumePrimitive: true, evalHandler: built_in_eval_name_1.BuiltInEvalName.Seq },
325
361
  { type: 'function', names: [identifier_1.Identifier.from(['!', "base" /* PkgName.Base */])],
326
- processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure, sig: SigX }, assumePrimitive: true, evalHandler: built_in_eval_name_1.BuiltInEvalName.Logical },
362
+ processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure, sig: SigAtomicX }, assumePrimitive: true, evalHandler: built_in_eval_name_1.BuiltInEvalName.Logical },
327
363
  { type: 'function', names: [identifier_1.Identifier.from(['?', "utils" /* PkgName.Utils */])], /* shows the help page of what it is given */
328
364
  processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { sig: [['e1', built_in_props_1.ArgProp.Nse], ['e2', built_in_props_1.ArgProp.Nse]] }, assumePrimitive: true },
329
365
  /* the result follows from how large the argument is, not from what is in it, so it is bounded (`Narrows`) */
@@ -364,7 +400,7 @@ exports.WrittenBuiltinDefinitions = [
364
400
  ...identifier_1.Identifier.fromAll("stats" /* PkgName.Stats */, ['var', 'sd', 'median', 'quantile']),
365
401
  ],
366
402
  processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
367
- config: { props: built_in_props_1.CallProp.Pure, sig: SigX },
403
+ config: { props: built_in_props_1.CallProp.Pure, sig: SigXDots },
368
404
  assumePrimitive: true
369
405
  },
370
406
  /* they read the values but answer only with a logical, so nothing those values carry reaches the result */
@@ -388,7 +424,7 @@ exports.WrittenBuiltinDefinitions = [
388
424
  { type: 'function', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['numeric', 'character', 'logical', 'integer', 'double', 'raw']),
389
425
  processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure, sig: [['length', built_in_props_1.ArgProp.Value]] }, assumePrimitive: true },
390
426
  { type: 'function', names: [identifier_1.Identifier.from(['na.omit', "stats" /* PkgName.Stats */])],
391
- processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure, sig: [['object', built_in_props_1.ArgProp.Value]] }, assumePrimitive: true },
427
+ processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure, sig: [['object', built_in_props_1.ArgProp.Value], ['...', built_in_props_1.ArgProp.Value]] }, assumePrimitive: true },
392
428
  /* two data arguments, under the names R gives them */
393
429
  { type: 'function', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['xor', 'crossprod', 'tcrossprod', 'intersect', 'union', 'setdiff']),
394
430
  processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure, sig: SigXY }, assumePrimitive: true },
@@ -440,29 +476,52 @@ exports.WrittenBuiltinDefinitions = [
440
476
  /* they open a device that writes the plot to the file they are given, under the name each of them uses */
441
477
  { type: 'function', names: [...identifier_1.Identifier.fromAll("grDevices" /* PkgName.GrDevices */, ['png', 'jpeg', 'bmp', 'tiff', 'svg', 'cairo_pdf']), identifier_1.Identifier.from(['raster_pdf', "rasterpdf" /* PkgName.RasterPdf */]), ...identifier_1.Identifier.fromAll("ragg" /* PkgName.Ragg */, ['agg_png', 'agg_jpeg', 'agg_tiff', 'agg_ppm', 'agg_webp'])],
442
478
  processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
443
- config: { props: built_in_props_1.CallProp.Invisible | built_in_props_1.CallProp.Graphics | built_in_props_1.CallProp.File | built_in_props_1.CallProp.Writes, sig: [['filename', built_in_props_1.ArgProp.Resource]] }, assumePrimitive: true },
479
+ config: { props: built_in_props_1.CallProp.Invisible | built_in_props_1.CallProp.Graphics | built_in_props_1.CallProp.File | built_in_props_1.CallProp.Writes, sig: [['filename', built_in_props_1.ArgProp.Resource], ['width', built_in_props_1.ArgProp.Value], ['height', built_in_props_1.ArgProp.Value], ['...', built_in_props_1.ArgProp.Value]] }, assumePrimitive: true },
444
480
  { type: 'function', names: identifier_1.Identifier.fromAll("grDevices" /* PkgName.GrDevices */, ['pdf', 'postscript', 'xfig', 'bitmap', 'pictex']),
445
481
  processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
446
- config: { props: built_in_props_1.CallProp.Invisible | built_in_props_1.CallProp.Graphics | built_in_props_1.CallProp.File | built_in_props_1.CallProp.Writes, sig: [['file', built_in_props_1.ArgProp.Resource]] }, assumePrimitive: true },
482
+ config: { props: built_in_props_1.CallProp.Invisible | built_in_props_1.CallProp.Graphics | built_in_props_1.CallProp.File | built_in_props_1.CallProp.Writes, sig: [['file', built_in_props_1.ArgProp.Resource], ['type', built_in_props_1.ArgProp.Value], ['height', built_in_props_1.ArgProp.Value], ['width', built_in_props_1.ArgProp.Value], ['...', built_in_props_1.ArgProp.Value]] }, assumePrimitive: true },
447
483
  /* devices that draw on the screen or into memory instead */
448
484
  { type: 'function', names: [...identifier_1.Identifier.fromAll("grDevices" /* PkgName.GrDevices */, ['X11', 'windows', 'quartz', 'dev.new']), identifier_1.Identifier.from(['trellis.device', "lattice" /* PkgName.Lattice */]), ...identifier_1.Identifier.fromAll("magick" /* PkgName.Magick */, ['image_graph', 'image_draw'])],
449
485
  processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Graphics }, assumePrimitive: true },
450
486
  { type: 'function', names: [identifier_1.Identifier.from(['read.csv', "utils" /* PkgName.Utils */])],
451
487
  processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
452
- config: { props: built_in_props_1.CallProp.File | built_in_props_1.CallProp.Reads, sig: [['file', built_in_props_1.ArgProp.Resource]] }, assumePrimitive: true },
488
+ config: { props: built_in_props_1.CallProp.File | built_in_props_1.CallProp.Reads, sig: [['file', built_in_props_1.ArgProp.Resource], ['header', built_in_props_1.ArgProp.Flag], ['sep', built_in_props_1.ArgProp.Value], ['quote', built_in_props_1.ArgProp.Value], ['dec', built_in_props_1.ArgProp.Value], ['fill', built_in_props_1.ArgProp.Flag], ['comment.char', built_in_props_1.ArgProp.Value], ['...', built_in_props_1.ArgProp.Value]] }, assumePrimitive: true },
453
489
  { type: 'function', names: [identifier_1.Identifier.from(['scan', "base" /* PkgName.Base */])],
454
490
  processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
455
491
  config: { props: built_in_props_1.CallProp.File | built_in_props_1.CallProp.Reads | built_in_props_1.CallProp.User, sig: [['file', built_in_props_1.ArgProp.Resource]] }, assumePrimitive: false },
456
492
  /* the connections and the calls that move data through them, so anything reaching them inherits it */
457
493
  { type: 'function', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['file', 'gzfile', 'bzfile', 'xzfile', 'unz', 'fifo']),
458
494
  processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
459
- config: { props: built_in_props_1.CallProp.File | built_in_props_1.CallProp.Reads | built_in_props_1.CallProp.Writes, sig: [['description', built_in_props_1.ArgProp.Resource]] }, assumePrimitive: false },
495
+ config: { props: built_in_props_1.CallProp.Opens | built_in_props_1.CallProp.File | built_in_props_1.CallProp.Reads | built_in_props_1.CallProp.Writes, sig: [['description', built_in_props_1.ArgProp.Resource]] }, assumePrimitive: false },
460
496
  { type: 'function', names: [identifier_1.Identifier.from(['url', "base" /* PkgName.Base */])],
461
497
  processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
462
- config: { props: built_in_props_1.CallProp.Network | built_in_props_1.CallProp.Reads, sig: [['description', built_in_props_1.ArgProp.Resource]] }, assumePrimitive: false },
463
- { type: 'function', names: [identifier_1.Identifier.from(['socketConnection', "base" /* PkgName.Base */])],
498
+ config: { props: built_in_props_1.CallProp.Opens | built_in_props_1.CallProp.Network | built_in_props_1.CallProp.Reads, sig: [['description', built_in_props_1.ArgProp.Resource]] }, assumePrimitive: false },
499
+ { type: 'function', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['socketConnection', 'serverSocket']),
500
+ processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
501
+ config: { props: built_in_props_1.CallProp.Opens | built_in_props_1.CallProp.Network | built_in_props_1.CallProp.Reads, sig: [['host', built_in_props_1.ArgProp.Resource]] }, assumePrimitive: false },
502
+ { type: 'function', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['textConnection', 'rawConnection']),
503
+ processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
504
+ config: { props: built_in_props_1.CallProp.Opens, sig: [['object', built_in_props_1.ArgProp.Value]] }, assumePrimitive: false },
505
+ { type: 'function', names: [identifier_1.Identifier.from(['dbConnect', "DBI" /* PkgName.Dbi */])],
506
+ processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
507
+ config: { libFn: true, props: built_in_props_1.CallProp.Opens | built_in_props_1.CallProp.Database }, assumePrimitive: false },
508
+ /* the calls ending what an opener started, each stating the argument holding the handle */
509
+ { type: 'function', names: [identifier_1.Identifier.from(['close', "base" /* PkgName.Base */])],
510
+ processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
511
+ config: { props: built_in_props_1.CallProp.Closes | built_in_props_1.CallProp.Invisible | built_in_props_1.CallProp.Generic, sig: [['con', built_in_props_1.ArgProp.Handle], ['...', built_in_props_1.ArgProp.Value]] }, assumePrimitive: false },
512
+ { type: 'function', names: [identifier_1.Identifier.from(['closeAllConnections', "base" /* PkgName.Base */])],
513
+ processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
514
+ config: { props: built_in_props_1.CallProp.Closes | built_in_props_1.CallProp.Invisible }, assumePrimitive: false },
515
+ { type: 'function', names: [identifier_1.Identifier.from(['dbDisconnect', "DBI" /* PkgName.Dbi */])],
464
516
  processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
465
- config: { props: built_in_props_1.CallProp.Network | built_in_props_1.CallProp.Reads, sig: [['host', built_in_props_1.ArgProp.Resource]] }, assumePrimitive: false },
517
+ config: { libFn: true, props: built_in_props_1.CallProp.Closes | built_in_props_1.CallProp.Invisible | built_in_props_1.CallProp.Database, sig: [['conn', built_in_props_1.ArgProp.Handle], ['...', built_in_props_1.ArgProp.Value]] }, assumePrimitive: false },
518
+ /* withr closes the connection it is handed when the scope it is called in ends */
519
+ { type: 'function', names: [identifier_1.Identifier.from(['local_connection', "withr" /* PkgName.Withr */])],
520
+ processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
521
+ config: { libFn: true, props: built_in_props_1.CallProp.Closes, sig: [['con', built_in_props_1.ArgProp.Handle], ['.local_envir', built_in_props_1.ArgProp.Written]] }, assumePrimitive: false },
522
+ { type: 'function', names: [identifier_1.Identifier.from(['with_connection', "withr" /* PkgName.Withr */])],
523
+ processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
524
+ config: { libFn: true, props: built_in_props_1.CallProp.Closes | built_in_props_1.CallProp.MayPure, sig: [['con', built_in_props_1.ArgProp.Handle], ['code', built_in_props_1.ArgProp.Value | built_in_props_1.ArgProp.Forced]] }, assumePrimitive: false },
466
525
  { type: 'function', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['readLines', 'readBin', 'readChar']),
467
526
  processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
468
527
  config: { props: built_in_props_1.CallProp.File | built_in_props_1.CallProp.Reads, sig: [['con', built_in_props_1.ArgProp.Resource]] }, assumePrimitive: false },
@@ -480,19 +539,22 @@ exports.WrittenBuiltinDefinitions = [
480
539
  config: { props: built_in_props_1.CallProp.Invisible | built_in_props_1.CallProp.File | built_in_props_1.CallProp.Writes, sig: [['object', built_in_props_1.ArgProp.Value], ['file', built_in_props_1.ArgProp.Resource]] }, assumePrimitive: false },
481
540
  { type: 'function', names: [identifier_1.Identifier.from(['save', "base" /* PkgName.Base */])],
482
541
  processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
483
- config: { props: built_in_props_1.CallProp.Invisible | built_in_props_1.CallProp.File | built_in_props_1.CallProp.Writes, sig: [['...', built_in_props_1.ArgProp.Value], ['file', built_in_props_1.ArgProp.Resource]] }, assumePrimitive: false },
542
+ config: { props: built_in_props_1.CallProp.Invisible | built_in_props_1.CallProp.File | built_in_props_1.CallProp.Writes, sig: [['...', built_in_props_1.ArgProp.Value], ['list', built_in_props_1.ArgProp.Value], ['file', built_in_props_1.ArgProp.Resource]] }, assumePrimitive: false },
484
543
  { type: 'function', names: [identifier_1.Identifier.from(['save.image', "base" /* PkgName.Base */])],
485
544
  processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
486
545
  config: { props: built_in_props_1.CallProp.Invisible | built_in_props_1.CallProp.File | built_in_props_1.CallProp.Writes, sig: [['file', built_in_props_1.ArgProp.Resource]] }, assumePrimitive: false },
487
546
  { type: 'function', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['dput', 'write']),
488
547
  processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
489
548
  config: { props: built_in_props_1.CallProp.Invisible | built_in_props_1.CallProp.File | built_in_props_1.CallProp.Writes | built_in_props_1.CallProp.Prints, sig: [['x', built_in_props_1.ArgProp.Value], ['file', built_in_props_1.ArgProp.Resource]] }, assumePrimitive: false },
549
+ { type: 'function', names: [identifier_1.Identifier.from(['write.dcf', "base" /* PkgName.Base */])],
550
+ processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
551
+ config: { props: built_in_props_1.CallProp.Invisible | built_in_props_1.CallProp.File | built_in_props_1.CallProp.Writes, sig: [['x', built_in_props_1.ArgProp.Value], ['file', built_in_props_1.ArgProp.Resource]] }, assumePrimitive: false },
490
552
  { type: 'function', names: [identifier_1.Identifier.from(['write.table', "utils" /* PkgName.Utils */])],
491
553
  processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
492
554
  config: { props: built_in_props_1.CallProp.Invisible | built_in_props_1.CallProp.File | built_in_props_1.CallProp.Writes, sig: [['x', built_in_props_1.ArgProp.Value], ['file', built_in_props_1.ArgProp.Resource]] }, assumePrimitive: false },
493
555
  { type: 'function', names: identifier_1.Identifier.fromAll("utils" /* PkgName.Utils */, ['write.csv', 'write.csv2']),
494
556
  processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
495
- config: { props: built_in_props_1.CallProp.Invisible | built_in_props_1.CallProp.File | built_in_props_1.CallProp.Writes }, assumePrimitive: false },
557
+ config: { props: built_in_props_1.CallProp.Invisible | built_in_props_1.CallProp.File | built_in_props_1.CallProp.Writes, sig: [['x', built_in_props_1.ArgProp.Value], ['file', built_in_props_1.ArgProp.Resource]] }, assumePrimitive: false },
496
558
  { type: 'function', names: identifier_1.Identifier.fromAll("utils" /* PkgName.Utils */, ['read.table', 'read.delim', 'read.csv2', 'read.delim2']),
497
559
  processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
498
560
  config: { props: built_in_props_1.CallProp.File | built_in_props_1.CallProp.Reads, sig: [['file', built_in_props_1.ArgProp.Resource]] }, assumePrimitive: false },
@@ -526,21 +588,28 @@ exports.WrittenBuiltinDefinitions = [
526
588
  { type: 'function', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['Sys.setenv', 'Sys.unsetenv', 'Sys.setlocale', 'Sys.putenv', 'Sys.setLanguage']),
527
589
  processor: built_in_proc_name_1.BuiltInProcName.Default, config: { hasUnknownSideEffects: true, forceArgs: 'all', props: built_in_props_1.CallProp.Invisible | built_in_props_1.CallProp.Configures }, assumePrimitive: false },
528
590
  { type: 'function', names: [identifier_1.Identifier.from(['mapply', "base" /* PkgName.Base */]), identifier_1.Identifier.from(['Mapply', "functools" /* PkgName.Functools */])],
529
- processor: built_in_proc_name_1.BuiltInProcName.Apply, config: { indexOfFunction: 0, nameOfFunctionArgument: 'FUN', unquoteFunction: true, props: built_in_props_1.CallProp.MayPure, sig: [['FUN', built_in_props_1.ArgProp.Callee]] }, assumePrimitive: false },
591
+ processor: built_in_proc_name_1.BuiltInProcName.Apply, config: { indexOfFunction: 0, nameOfFunctionArgument: 'FUN', unquoteFunction: true, props: built_in_props_1.CallProp.MayPure, sig: [['FUN', built_in_props_1.ArgProp.Callee], ['...', built_in_props_1.ArgProp.Value]] }, assumePrimitive: false },
530
592
  { type: 'function', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['lapply', 'sapply', 'vapply']),
531
- processor: built_in_proc_name_1.BuiltInProcName.Apply, config: { indexOfFunction: 1, nameOfFunctionArgument: 'FUN', unquoteFunction: true, props: built_in_props_1.CallProp.MayPure, sig: [['X', built_in_props_1.ArgProp.Value], ['FUN', built_in_props_1.ArgProp.Callee]] }, assumePrimitive: false },
593
+ processor: built_in_proc_name_1.BuiltInProcName.Apply, config: { indexOfFunction: 1, nameOfFunctionArgument: 'FUN', unquoteFunction: true, props: built_in_props_1.CallProp.MayPure, sig: [['X', built_in_props_1.ArgProp.Value], ['FUN', built_in_props_1.ArgProp.Callee], ['...', built_in_props_1.ArgProp.Value]] }, assumePrimitive: false },
594
+ /* `vapply` takes the shape of the result before its `...`, so naming it keeps the positions honest */
595
+ { type: 'function', names: [identifier_1.Identifier.from(['vapply', "base" /* PkgName.Base */])],
596
+ processor: built_in_proc_name_1.BuiltInProcName.Apply, config: { indexOfFunction: 1, nameOfFunctionArgument: 'FUN', unquoteFunction: true, props: built_in_props_1.CallProp.MayPure, sig: [['X', built_in_props_1.ArgProp.Value], ['FUN', built_in_props_1.ArgProp.Callee], ['FUN.VALUE', built_in_props_1.ArgProp.Shape], ['...', built_in_props_1.ArgProp.Value]] }, assumePrimitive: false },
532
597
  { type: 'function', names: identifier_1.Identifier.fromAll("functools" /* PkgName.Functools */, ['Lapply', 'Sapply', 'Vapply']),
533
598
  processor: built_in_proc_name_1.BuiltInProcName.Apply, config: { indexOfFunction: 1, nameOfFunctionArgument: 'FUN', unquoteFunction: true, props: built_in_props_1.CallProp.MayPure }, assumePrimitive: false },
534
599
  { type: 'function', names: [...identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['apply', 'tapply']), identifier_1.Identifier.from(['Tapply', "functools" /* PkgName.Functools */])],
535
600
  processor: built_in_proc_name_1.BuiltInProcName.Apply, config: { indexOfFunction: 2, nameOfFunctionArgument: 'FUN', unquoteFunction: true, props: built_in_props_1.CallProp.MayPure }, assumePrimitive: false },
536
- { type: 'function', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['Map', 'Filter', 'Find', 'Position']),
537
- processor: built_in_proc_name_1.BuiltInProcName.Apply, config: { indexOfFunction: 0, nameOfFunctionArgument: 'f', unquoteFunction: true, props: built_in_props_1.CallProp.MayPure, sig: [['f', built_in_props_1.ArgProp.Callee]] }, assumePrimitive: false },
601
+ { type: 'function', names: [identifier_1.Identifier.from(['Map', "base" /* PkgName.Base */])],
602
+ processor: built_in_proc_name_1.BuiltInProcName.Apply, config: { indexOfFunction: 0, nameOfFunctionArgument: 'f', unquoteFunction: true, props: built_in_props_1.CallProp.MayPure, sig: [['f', built_in_props_1.ArgProp.Callee], ['...', built_in_props_1.ArgProp.Value]] }, assumePrimitive: false },
603
+ { type: 'function', names: [identifier_1.Identifier.from(['Filter', "base" /* PkgName.Base */])],
604
+ processor: built_in_proc_name_1.BuiltInProcName.Apply, config: { indexOfFunction: 0, nameOfFunctionArgument: 'f', unquoteFunction: true, props: built_in_props_1.CallProp.MayPure, sig: [['f', built_in_props_1.ArgProp.Callee], ['x', built_in_props_1.ArgProp.Value]] }, assumePrimitive: false },
605
+ { type: 'function', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['Find', 'Position']),
606
+ processor: built_in_proc_name_1.BuiltInProcName.Apply, config: { indexOfFunction: 0, nameOfFunctionArgument: 'f', unquoteFunction: true, props: built_in_props_1.CallProp.MayPure, sig: [['f', built_in_props_1.ArgProp.Callee], ['x', built_in_props_1.ArgProp.Value], ['right', built_in_props_1.ArgProp.Flag], ['nomatch', built_in_props_1.ArgProp.Value]] }, assumePrimitive: false },
538
607
  { type: 'function', names: [identifier_1.Identifier.from(['Reduce', "base" /* PkgName.Base */])],
539
608
  processor: built_in_proc_name_1.BuiltInProcName.Apply, config: { indexOfFunction: 0, nameOfFunctionArgument: 'f', unquoteFunction: true, props: built_in_props_1.CallProp.MayPure, sig: [['f', built_in_props_1.ArgProp.Callee]] }, assumePrimitive: false },
540
609
  { type: 'function', names: [identifier_1.Identifier.from(['rapply', "base" /* PkgName.Base */])],
541
610
  processor: built_in_proc_name_1.BuiltInProcName.Apply, config: { indexOfFunction: 1, nameOfFunctionArgument: 'f', unquoteFunction: true, props: built_in_props_1.CallProp.MayPure }, assumePrimitive: false },
542
611
  { type: 'function', names: [identifier_1.Identifier.from(['print', "base" /* PkgName.Base */])],
543
- processor: built_in_proc_name_1.BuiltInProcName.Default, config: { forceArgs: 'all', keepArgumentOut: true, hasUnknownSideEffects: { type: 'link-to-last-call', callName: /^sink$/ }, props: built_in_props_1.CallProp.Invisible | built_in_props_1.CallProp.Generic | built_in_props_1.CallProp.Prints, sig: [['x', built_in_props_1.ArgProp.Alias | built_in_props_1.ArgProp.Forced]] }, assumePrimitive: false },
612
+ processor: built_in_proc_name_1.BuiltInProcName.Default, config: { forceArgs: 'all', keepArgumentOut: true, hasUnknownSideEffects: { type: 'link-to-last-call', callName: /^sink$/ }, props: built_in_props_1.CallProp.Invisible | built_in_props_1.CallProp.Generic | built_in_props_1.CallProp.Prints, sig: [['x', built_in_props_1.ArgProp.Alias | built_in_props_1.ArgProp.Forced], ['...', built_in_props_1.ArgProp.Value | built_in_props_1.ArgProp.Forced]] }, assumePrimitive: false },
544
613
  { type: 'function', names: [...identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['message', 'warning']), identifier_1.Identifier.from(['warn', "rlang" /* PkgName.Rlang */]), identifier_1.Identifier.from(['warn', "R.utils" /* PkgName.Rutils */]), identifier_1.Identifier.from(['info', "msgr" /* PkgName.Msgr */])],
545
614
  processor: built_in_proc_name_1.BuiltInProcName.Default, config: { forceArgs: 'all', keepArgumentOut: true, hasUnknownSideEffects: { type: 'link-to-last-call', callName: /^sink$/ }, props: built_in_props_1.CallProp.Invisible | built_in_props_1.CallProp.Prints, sig: [['...', built_in_props_1.ArgProp.Alias | built_in_props_1.ArgProp.Forced]] }, assumePrimitive: false },
546
615
  { type: 'function', names: [identifier_1.Identifier.from(['invisible', "base" /* PkgName.Base */])],
@@ -1132,8 +1201,10 @@ exports.WrittenBuiltinDefinitions = [
1132
1201
  { type: 'function', names: [identifier_1.Identifier.from(['commandArgs', "base" /* PkgName.Base */])],
1133
1202
  processor: built_in_proc_name_1.BuiltInProcName.Default, config: { forceArgs: 'all', props: built_in_props_1.CallProp.Ambient | built_in_props_1.CallProp.CommandLine }, assumePrimitive: false },
1134
1203
  /* system commands */
1135
- { type: 'function', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['system', 'system2', 'pipe', 'shell', 'shell.exec']),
1204
+ { type: 'function', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['system', 'system2', 'shell', 'shell.exec']),
1136
1205
  processor: built_in_proc_name_1.BuiltInProcName.Default, config: { forceArgs: 'all', props: built_in_props_1.CallProp.Process }, assumePrimitive: false },
1206
+ { type: 'function', names: [identifier_1.Identifier.from(['pipe', "base" /* PkgName.Base */])],
1207
+ processor: built_in_proc_name_1.BuiltInProcName.Default, config: { forceArgs: 'all', props: built_in_props_1.CallProp.Opens | built_in_props_1.CallProp.Process, sig: [['description', built_in_props_1.ArgProp.Resource]] }, assumePrimitive: false },
1137
1208
  { type: 'function', names: [identifier_1.Identifier.from(['runjs', "shinyjs" /* PkgName.ShinyJs */])],
1138
1209
  processor: built_in_proc_name_1.BuiltInProcName.Default, config: { forceArgs: 'all', libFn: true, props: built_in_props_1.CallProp.Process }, assumePrimitive: false },
1139
1210
  /* whatever the user types, picks, or sends along with a request */
@@ -1217,6 +1288,130 @@ exports.WrittenBuiltinDefinitions = [
1217
1288
  names: ['$', '@'],
1218
1289
  config: { readIndices: false, props: built_in_props_1.CallProp.Scope }
1219
1290
  },
1291
+ /* the string and shape functions R declares formals for, restated one by one: the group above gives them
1292
+ what they do, this gives them the arguments they do it with (the names are R's own) */
1293
+ { type: 'function', names: [identifier_1.Identifier.from(['sprintf', "base" /* PkgName.Base */])],
1294
+ processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure, sig: [['fmt', built_in_props_1.ArgProp.Value], ['...', built_in_props_1.ArgProp.Value]] }, assumePrimitive: true },
1295
+ { type: 'function', names: [identifier_1.Identifier.from(['format', "base" /* PkgName.Base */])],
1296
+ processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure, sig: SigXDots }, assumePrimitive: true },
1297
+ { type: 'function', names: [identifier_1.Identifier.from(['grep', "base" /* PkgName.Base */])],
1298
+ processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure, sig: [['pattern', built_in_props_1.ArgProp.Value], ['x', built_in_props_1.ArgProp.Value], ['ignore.case', built_in_props_1.ArgProp.Flag], ['perl', built_in_props_1.ArgProp.Flag], ['value', built_in_props_1.ArgProp.Flag], ['fixed', built_in_props_1.ArgProp.Flag], ['useBytes', built_in_props_1.ArgProp.Flag], ['invert', built_in_props_1.ArgProp.Flag]] }, assumePrimitive: true },
1299
+ { type: 'function', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['sub', 'gsub']),
1300
+ processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure, sig: [['pattern', built_in_props_1.ArgProp.Value], ['replacement', built_in_props_1.ArgProp.Value], ['x', built_in_props_1.ArgProp.Value], ['ignore.case', built_in_props_1.ArgProp.Flag], ['perl', built_in_props_1.ArgProp.Flag], ['fixed', built_in_props_1.ArgProp.Flag], ['useBytes', built_in_props_1.ArgProp.Flag]] }, assumePrimitive: true },
1301
+ { type: 'function', names: [identifier_1.Identifier.from(['substr', "base" /* PkgName.Base */])],
1302
+ processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure, sig: [['x', built_in_props_1.ArgProp.Value], ['start', built_in_props_1.ArgProp.Value], ['stop', built_in_props_1.ArgProp.Value]] }, assumePrimitive: true },
1303
+ { type: 'function', names: [identifier_1.Identifier.from(['substring', "base" /* PkgName.Base */])],
1304
+ processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure, sig: [['text', built_in_props_1.ArgProp.Value], ['first', built_in_props_1.ArgProp.Value], ['last', built_in_props_1.ArgProp.Value]] }, assumePrimitive: true },
1305
+ { type: 'function', names: [identifier_1.Identifier.from(['strsplit', "base" /* PkgName.Base */])],
1306
+ processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure, sig: [['x', built_in_props_1.ArgProp.Value], ['split', built_in_props_1.ArgProp.Value], ['fixed', built_in_props_1.ArgProp.Flag], ['perl', built_in_props_1.ArgProp.Flag], ['useBytes', built_in_props_1.ArgProp.Flag]] }, assumePrimitive: true },
1307
+ { type: 'function', names: [identifier_1.Identifier.from(['trimws', "base" /* PkgName.Base */])],
1308
+ processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure, sig: [['x', built_in_props_1.ArgProp.Value], ['which', built_in_props_1.ArgProp.Flag], ['whitespace', built_in_props_1.ArgProp.Value]] }, assumePrimitive: true, evalHandler: built_in_eval_name_1.BuiltInEvalName.StringFn },
1309
+ { type: 'function', names: [identifier_1.Identifier.from(['strtoi', "base" /* PkgName.Base */])],
1310
+ processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure, sig: [['x', built_in_props_1.ArgProp.Value], ['base', built_in_props_1.ArgProp.Value]] }, assumePrimitive: true },
1311
+ { type: 'function', names: [identifier_1.Identifier.from(['matrix', "base" /* PkgName.Base */])],
1312
+ processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure, sig: [['data', built_in_props_1.ArgProp.Value], ['nrow', built_in_props_1.ArgProp.Value], ['ncol', built_in_props_1.ArgProp.Value], ['byrow', built_in_props_1.ArgProp.Flag], ['dimnames', built_in_props_1.ArgProp.Value]] }, assumePrimitive: true },
1313
+ /* the tidyverse verbs, under the names R declares them with. They keep the data mask the group above
1314
+ gives them; what this adds is which argument is the data and what the further ones are called */
1315
+ { type: 'function', names: identifier_1.Identifier.fromAll("dplyr" /* PkgName.Dplyr */, ['mutate', 'transmute', 'select', 'rename']),
1316
+ processor: built_in_proc_name_1.BuiltInProcName.Default,
1317
+ config: { markArgsAsMasked: known_call_handling_1.NseArguments.AllButFirst, props: built_in_props_1.CallProp.Pure, sig: SigDataDots }, assumePrimitive: false },
1318
+ { type: 'function', names: [identifier_1.Identifier.from(['filter', "dplyr" /* PkgName.Dplyr */]), identifier_1.Identifier.from(['slice', "dplyr" /* PkgName.Dplyr */])],
1319
+ processor: built_in_proc_name_1.BuiltInProcName.Default,
1320
+ config: { markArgsAsMasked: known_call_handling_1.NseArguments.AllButFirst, props: built_in_props_1.CallProp.Pure,
1321
+ sig: [...SigDataDots, ['.by', built_in_props_1.ArgProp.Value], ['.preserve', built_in_props_1.ArgProp.Flag]] }, assumePrimitive: false },
1322
+ { type: 'function', names: identifier_1.Identifier.fromAll("dplyr" /* PkgName.Dplyr */, ['summarise', 'summarize']),
1323
+ processor: built_in_proc_name_1.BuiltInProcName.Default,
1324
+ config: { markArgsAsMasked: known_call_handling_1.NseArguments.AllButFirst, props: built_in_props_1.CallProp.Pure,
1325
+ sig: [...SigDataDots, ['.by', built_in_props_1.ArgProp.Value], ['.groups', built_in_props_1.ArgProp.Flag]] }, assumePrimitive: false },
1326
+ { type: 'function', names: [identifier_1.Identifier.from(['arrange', "dplyr" /* PkgName.Dplyr */])],
1327
+ processor: built_in_proc_name_1.BuiltInProcName.Default,
1328
+ config: { markArgsAsMasked: known_call_handling_1.NseArguments.AllButFirst, props: built_in_props_1.CallProp.Pure,
1329
+ sig: [...SigDataDots, ['.by_group', built_in_props_1.ArgProp.Flag]] }, assumePrimitive: false },
1330
+ { type: 'function', names: [identifier_1.Identifier.from(['group_by', "dplyr" /* PkgName.Dplyr */])],
1331
+ processor: built_in_proc_name_1.BuiltInProcName.Default,
1332
+ config: { markArgsAsMasked: known_call_handling_1.NseArguments.AllButFirst, props: built_in_props_1.CallProp.Pure,
1333
+ sig: [...SigDataDots, ['.add', built_in_props_1.ArgProp.Flag], ['.drop', built_in_props_1.ArgProp.Flag]] }, assumePrimitive: false },
1334
+ { type: 'function', names: [identifier_1.Identifier.from(['distinct', "dplyr" /* PkgName.Dplyr */])],
1335
+ processor: built_in_proc_name_1.BuiltInProcName.Default,
1336
+ config: { markArgsAsMasked: known_call_handling_1.NseArguments.AllButFirst, props: built_in_props_1.CallProp.Pure,
1337
+ sig: [...SigDataDots, ['.keep_all', built_in_props_1.ArgProp.Flag]] }, assumePrimitive: false },
1338
+ { type: 'function', names: [identifier_1.Identifier.from(['relocate', "dplyr" /* PkgName.Dplyr */])],
1339
+ processor: built_in_proc_name_1.BuiltInProcName.Default,
1340
+ config: { markArgsAsMasked: known_call_handling_1.NseArguments.AllButFirst, props: built_in_props_1.CallProp.Pure,
1341
+ sig: [...SigDataDots, ['.before', built_in_props_1.ArgProp.Value], ['.after', built_in_props_1.ArgProp.Value]] }, assumePrimitive: false },
1342
+ { type: 'function', names: [identifier_1.Identifier.from(['count', "dplyr" /* PkgName.Dplyr */])],
1343
+ processor: built_in_proc_name_1.BuiltInProcName.Default,
1344
+ config: { markArgsAsMasked: known_call_handling_1.NseArguments.AllButFirst, props: built_in_props_1.CallProp.Pure,
1345
+ sig: [['x', built_in_props_1.ArgProp.Value], ['...', built_in_props_1.ArgProp.Value], ['wt', built_in_props_1.ArgProp.Value], ['sort', built_in_props_1.ArgProp.Flag], ['name', built_in_props_1.ArgProp.Value]] }, assumePrimitive: false },
1346
+ { type: 'function', names: [identifier_1.Identifier.from(['pull', "dplyr" /* PkgName.Dplyr */])],
1347
+ processor: built_in_proc_name_1.BuiltInProcName.Default,
1348
+ config: { markArgsAsMasked: known_call_handling_1.NseArguments.AllButFirst, props: built_in_props_1.CallProp.Pure,
1349
+ sig: [['.data', built_in_props_1.ArgProp.Value], ['var', built_in_props_1.ArgProp.Value], ['name', built_in_props_1.ArgProp.Value], ['...', built_in_props_1.ArgProp.Value]] }, assumePrimitive: false },
1350
+ { type: 'function', names: [identifier_1.Identifier.from(['nest', "tidyr" /* PkgName.TidyR */])],
1351
+ processor: built_in_proc_name_1.BuiltInProcName.Default,
1352
+ config: { markArgsAsMasked: known_call_handling_1.NseArguments.AllButFirst, props: built_in_props_1.CallProp.Pure, sig: SigDataDots }, assumePrimitive: false },
1353
+ /* `drop_na` names its first argument `data`, not `.data`, so it gets a line of its own */
1354
+ { type: 'function', names: [identifier_1.Identifier.from(['drop_na', "tidyr" /* PkgName.TidyR */])],
1355
+ processor: built_in_proc_name_1.BuiltInProcName.Default,
1356
+ config: { markArgsAsMasked: known_call_handling_1.NseArguments.AllButFirst, props: built_in_props_1.CallProp.Pure, sig: [['data', built_in_props_1.ArgProp.Value], ['...', built_in_props_1.ArgProp.Value]] }, assumePrimitive: false },
1357
+ { type: 'function', names: [identifier_1.Identifier.from(['pivot_longer', "tidyr" /* PkgName.TidyR */])],
1358
+ processor: built_in_proc_name_1.BuiltInProcName.Default,
1359
+ config: { markArgsAsMasked: known_call_handling_1.NseArguments.AllButFirst, props: built_in_props_1.CallProp.Pure,
1360
+ sig: [['data', built_in_props_1.ArgProp.Value], ['cols', built_in_props_1.ArgProp.Value], ['...', built_in_props_1.ArgProp.Value], ['names_to', built_in_props_1.ArgProp.Value], ['values_to', built_in_props_1.ArgProp.Value]] }, assumePrimitive: false },
1361
+ { type: 'function', names: [identifier_1.Identifier.from(['pivot_wider', "tidyr" /* PkgName.TidyR */])],
1362
+ processor: built_in_proc_name_1.BuiltInProcName.Default,
1363
+ config: { markArgsAsMasked: known_call_handling_1.NseArguments.AllButFirst, props: built_in_props_1.CallProp.Pure,
1364
+ sig: [['data', built_in_props_1.ArgProp.Value], ['...', built_in_props_1.ArgProp.Value], ['names_from', built_in_props_1.ArgProp.Value], ['values_from', built_in_props_1.ArgProp.Value]] }, assumePrimitive: false },
1365
+ { type: 'function', names: [identifier_1.Identifier.from(['separate', "tidyr" /* PkgName.TidyR */])],
1366
+ processor: built_in_proc_name_1.BuiltInProcName.Default,
1367
+ config: { markArgsAsMasked: known_call_handling_1.NseArguments.AllButFirst, props: built_in_props_1.CallProp.Pure,
1368
+ sig: [['data', built_in_props_1.ArgProp.Value], ['col', built_in_props_1.ArgProp.Value], ['into', built_in_props_1.ArgProp.Value], ['sep', built_in_props_1.ArgProp.Value], ['remove', built_in_props_1.ArgProp.Flag], ['convert', built_in_props_1.ArgProp.Flag]] }, assumePrimitive: false },
1369
+ { type: 'function', names: [identifier_1.Identifier.from(['unite', "tidyr" /* PkgName.TidyR */])],
1370
+ processor: built_in_proc_name_1.BuiltInProcName.Default,
1371
+ config: { markArgsAsMasked: known_call_handling_1.NseArguments.AllButFirst, props: built_in_props_1.CallProp.Pure,
1372
+ sig: [['data', built_in_props_1.ArgProp.Value], ['col', built_in_props_1.ArgProp.Value], ['...', built_in_props_1.ArgProp.Value], ['sep', built_in_props_1.ArgProp.Value], ['remove', built_in_props_1.ArgProp.Flag]] }, assumePrimitive: false },
1373
+ { type: 'function', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['subset', 'transform']),
1374
+ processor: built_in_proc_name_1.BuiltInProcName.Default,
1375
+ config: { markArgsAsMasked: known_call_handling_1.NseArguments.AllButFirst, props: built_in_props_1.CallProp.Pure, sig: [['x', built_in_props_1.ArgProp.Value], ['...', built_in_props_1.ArgProp.Value]] }, assumePrimitive: false },
1376
+ /* these share the `f(x, ...)` shape above, but R puts one more formal before the `...`: leaving it out
1377
+ would shift every position after it, so each names its own */
1378
+ { type: 'function', names: [identifier_1.Identifier.from(['sort', "base" /* PkgName.Base */])],
1379
+ processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
1380
+ config: { props: built_in_props_1.CallProp.Pure, sig: [['x', built_in_props_1.ArgProp.Value], ['decreasing', built_in_props_1.ArgProp.Flag], ['...', built_in_props_1.ArgProp.Value]] }, assumePrimitive: true },
1381
+ { type: 'function', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['unique', 'duplicated']),
1382
+ processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
1383
+ config: { props: built_in_props_1.CallProp.Pure, sig: [['x', built_in_props_1.ArgProp.Value], ['incomparables', built_in_props_1.ArgProp.Value], ['...', built_in_props_1.ArgProp.Value]] }, assumePrimitive: true },
1384
+ { type: 'function', names: [identifier_1.Identifier.from(['as.data.frame', "base" /* PkgName.Base */])],
1385
+ processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
1386
+ config: { props: built_in_props_1.CallProp.Pure, sig: [['x', built_in_props_1.ArgProp.Value], ['row.names', built_in_props_1.ArgProp.Value], ['optional', built_in_props_1.ArgProp.Flag], ['...', built_in_props_1.ArgProp.Value]] }, assumePrimitive: true },
1387
+ { type: 'function', names: [identifier_1.Identifier.from(['median', "stats" /* PkgName.Stats */])],
1388
+ processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
1389
+ config: { props: built_in_props_1.CallProp.Pure, sig: [['x', built_in_props_1.ArgProp.Value], ['na.rm', built_in_props_1.ArgProp.Flag], ['...', built_in_props_1.ArgProp.Value]] }, assumePrimitive: true },
1390
+ /* the ones the earlier list left short where a reader would notice */
1391
+ { type: 'function', names: [identifier_1.Identifier.from(['nchar', "base" /* PkgName.Base */])],
1392
+ processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
1393
+ config: { props: built_in_props_1.CallProp.Pure | built_in_props_1.CallProp.Narrows, sig: [['x', built_in_props_1.ArgProp.Shape], ['type', built_in_props_1.ArgProp.Value], ['allowNA', built_in_props_1.ArgProp.Flag], ['keepNA', built_in_props_1.ArgProp.Flag]] }, assumePrimitive: true, evalHandler: built_in_eval_name_1.BuiltInEvalName.StringFn },
1394
+ { type: 'function', names: [identifier_1.Identifier.from(['grepl', "base" /* PkgName.Base */])],
1395
+ processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
1396
+ config: { props: built_in_props_1.CallProp.Pure, sig: [['pattern', built_in_props_1.ArgProp.Value], ['x', built_in_props_1.ArgProp.Value], ['ignore.case', built_in_props_1.ArgProp.Flag], ['perl', built_in_props_1.ArgProp.Flag], ['fixed', built_in_props_1.ArgProp.Flag], ['useBytes', built_in_props_1.ArgProp.Flag]] }, assumePrimitive: true },
1397
+ { type: 'function', names: [identifier_1.Identifier.from(['match', "base" /* PkgName.Base */])],
1398
+ processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
1399
+ config: { props: built_in_props_1.CallProp.Pure, sig: [['x', built_in_props_1.ArgProp.Value], ['table', built_in_props_1.ArgProp.Value], ['nomatch', built_in_props_1.ArgProp.Value], ['incomparables', built_in_props_1.ArgProp.Value]] }, assumePrimitive: true },
1400
+ { type: 'function', names: [identifier_1.Identifier.from(['lengths', "base" /* PkgName.Base */])],
1401
+ processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
1402
+ config: { props: built_in_props_1.CallProp.Pure | built_in_props_1.CallProp.Narrows, sig: [['x', built_in_props_1.ArgProp.Shape], ['use.names', built_in_props_1.ArgProp.Flag]] }, assumePrimitive: true },
1403
+ { type: 'function', names: [identifier_1.Identifier.from(['readLines', "base" /* PkgName.Base */])],
1404
+ processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
1405
+ config: { props: built_in_props_1.CallProp.File | built_in_props_1.CallProp.Reads, sig: [['con', built_in_props_1.ArgProp.Resource], ['n', built_in_props_1.ArgProp.Value], ['ok', built_in_props_1.ArgProp.Flag], ['warn', built_in_props_1.ArgProp.Flag], ['encoding', built_in_props_1.ArgProp.Value], ['skipNul', built_in_props_1.ArgProp.Flag]] }, assumePrimitive: false },
1406
+ { type: 'function', names: [identifier_1.Identifier.from(['writeLines', "base" /* PkgName.Base */])],
1407
+ processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
1408
+ config: { props: built_in_props_1.CallProp.Invisible | built_in_props_1.CallProp.File | built_in_props_1.CallProp.Writes, sig: [['text', built_in_props_1.ArgProp.Value], ['con', built_in_props_1.ArgProp.Resource], ['sep', built_in_props_1.ArgProp.Value], ['useBytes', built_in_props_1.ArgProp.Flag]] }, assumePrimitive: false },
1409
+ { type: 'function', names: [identifier_1.Identifier.from(['write.table', "utils" /* PkgName.Utils */])],
1410
+ processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
1411
+ config: { props: built_in_props_1.CallProp.Invisible | built_in_props_1.CallProp.File | built_in_props_1.CallProp.Writes, sig: [['x', built_in_props_1.ArgProp.Value], ['file', built_in_props_1.ArgProp.Resource], ['append', built_in_props_1.ArgProp.Flag], ['quote', built_in_props_1.ArgProp.Flag], ['sep', built_in_props_1.ArgProp.Value]] }, assumePrimitive: false },
1412
+ { type: 'function', names: [identifier_1.Identifier.from(['download.file', "utils" /* PkgName.Utils */])],
1413
+ processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
1414
+ config: { props: built_in_props_1.CallProp.Network | built_in_props_1.CallProp.File | built_in_props_1.CallProp.Writes, sig: [['url', built_in_props_1.ArgProp.Resource], ['destfile', built_in_props_1.ArgProp.Resource], ['method', built_in_props_1.ArgProp.Value], ['quiet', built_in_props_1.ArgProp.Flag], ['mode', built_in_props_1.ArgProp.Value], ['cacheOK', built_in_props_1.ArgProp.Flag], ['extra', built_in_props_1.ArgProp.Value], ['headers', built_in_props_1.ArgProp.Value], ['...', built_in_props_1.ArgProp.Value]] }, assumePrimitive: false },
1220
1415
  ];
1221
1416
  /**
1222
1417
  * Contains the built-in definitions recognized by flowR
@@ -48,9 +48,11 @@ export declare class Environment implements IEnvironment {
48
48
  builtInEnv?: true;
49
49
  /** {@link memory} is shared with a clone; writing needs {@link writableMemory} to unshare it first */
50
50
  private sharedMemory?;
51
+ /** {@link parent} is shared with the environment this was cloned from; writing through it needs {@link writableParent} */
52
+ private sharedParent?;
51
53
  /** marks the global environment (`.GlobalEnv`); attached packages (see {@link EnvType}) live below it */
52
54
  globalEnv?: true;
53
- constructor(parent: Environment, isBuiltInDefault?: true | undefined);
55
+ constructor(parent: Environment, isBuiltInDefault?: true | undefined, memory?: BuiltInMemory);
54
56
  /** Marks this as an attached-package layer (see {@link EnvType}) for package `name`. */
55
57
  asLibrary(name: string, type: EnvType): this;
56
58
  /** Marks this as the global environment (`.GlobalEnv`); see {@link globalEnv}. */
@@ -64,6 +66,12 @@ export declare class Environment implements IEnvironment {
64
66
  * rather than through {@link memory} directly, as {@link clone} hands the map itself to the clone and only
65
67
  * the first writer of either side copies it (copy-on-write).
66
68
  */
69
+ /**
70
+ * The parent, unshared first when a write is about to go through it. A `clone(true)` hands out the original
71
+ * chain and lets it materialize one frame at a time here, because a removal usually reaches a frame or two,
72
+ * not the ~20 an attached-package search path is deep.
73
+ */
74
+ get writableParent(): Environment;
67
75
  get writableMemory(): BuiltInMemory;
68
76
  /**
69
77
  * Create a clone of this environment.
@@ -166,7 +174,7 @@ export declare const REnvironment: {
166
174
  *
167
175
  * The {@link BuiltIns|BuiltInEnvironment} holds R's built-in functions and constants; during serialization use {@link builtInEnvJsonReplacer} to avoid inlining it.
168
176
  * @see {@link define} - to define a new {@link IdentifierDefinition|identifier definition} within an environment
169
- * @see {@link resolveByName} - to resolve an {@link Identifier|identifier/name} to its {@link IdentifierDefinition|definitions} within an environment
177
+ * @see {@link Resolve.byNameAndType} - to resolve an {@link Identifier|identifier/name} to its {@link IdentifierDefinition|definitions} within an environment
170
178
  * @see {@link makeReferenceMaybe} - to attach control dependencies to a reference
171
179
  * @see {@link pushLocalEnvironment} - to create a new local scope
172
180
  * @see {@link popLocalEnvironment} - to remove the current local scope
@@ -42,12 +42,15 @@ class Environment {
42
42
  builtInEnv;
43
43
  /** {@link memory} is shared with a clone; writing needs {@link writableMemory} to unshare it first */
44
44
  sharedMemory;
45
+ /** {@link parent} is shared with the environment this was cloned from; writing through it needs {@link writableParent} */
46
+ sharedParent;
45
47
  /** marks the global environment (`.GlobalEnv`); attached packages (see {@link EnvType}) live below it */
46
48
  globalEnv;
47
- constructor(parent, isBuiltInDefault = undefined) {
49
+ constructor(parent, isBuiltInDefault = undefined, memory) {
48
50
  this.id = isBuiltInDefault ? 0 : environmentIdCounter++;
49
51
  this.parent = parent;
50
- this.memory = new Map();
52
+ /* a clone hands its own (then shared) memory in, so the fresh map a new frame needs is not allocated to be dropped */
53
+ this.memory = memory ?? new Map();
51
54
  // do not store if not needed!
52
55
  if (isBuiltInDefault) {
53
56
  this.builtInEnv = isBuiltInDefault;
@@ -77,6 +80,20 @@ class Environment {
77
80
  * rather than through {@link memory} directly, as {@link clone} hands the map itself to the clone and only
78
81
  * the first writer of either side copies it (copy-on-write).
79
82
  */
83
+ /**
84
+ * The parent, unshared first when a write is about to go through it. A `clone(true)` hands out the original
85
+ * chain and lets it materialize one frame at a time here, because a removal usually reaches a frame or two,
86
+ * not the ~20 an attached-package search path is deep.
87
+ */
88
+ get writableParent() {
89
+ if (this.sharedParent) {
90
+ const parent = this.parent.clone(false);
91
+ parent.sharedParent = true;
92
+ this.parent = parent;
93
+ this.sharedParent = undefined;
94
+ }
95
+ return this.parent;
96
+ }
80
97
  get writableMemory() {
81
98
  if (this.sharedMemory) {
82
99
  this.memory = new Map(this.memory);
@@ -96,14 +113,15 @@ class Environment {
96
113
  if (this.builtInEnv) {
97
114
  return this; // do not clone the built-in environment
98
115
  }
99
- const parent = recurseParents ? this.parent.clone(recurseParents) : this.parent;
100
- const clone = new Environment(parent, this.builtInEnv);
116
+ const clone = new Environment(this.parent, this.builtInEnv, this.memory);
101
117
  clone.c = this.c;
102
118
  clone.n = this.n;
103
119
  clone.t = this.t;
104
120
  clone.globalEnv = this.globalEnv;
105
- clone.memory = this.memory;
106
121
  clone.sharedMemory = this.sharedMemory = true;
122
+ if (recurseParents && !this.parent.builtInEnv) {
123
+ clone.sharedParent = true;
124
+ }
107
125
  return clone;
108
126
  }
109
127
  /**
@@ -380,7 +398,7 @@ class Environment {
380
398
  }
381
399
  const [name, ns] = identifier_1.Identifier.toArray(id);
382
400
  if (ns !== undefined && this.n !== ns) {
383
- this.parent.remove(id);
401
+ this.writableParent.remove(id);
384
402
  return this;
385
403
  }
386
404
  const definition = this.memory.get(name);
@@ -391,7 +409,7 @@ class Environment {
391
409
  cont = !definition.every(d => (0, info_1.happensInEveryBranch)(d.cds));
392
410
  }
393
411
  if (cont) {
394
- this.parent.remove(name);
412
+ this.writableParent.remove(name);
395
413
  }
396
414
  return this;
397
415
  }
@@ -155,6 +155,7 @@ export declare const enum PkgName {
155
155
  Cli = "cli",
156
156
  CohortBuilder = "cohortBuilder",
157
157
  DataTable = "data.table",
158
+ Dbi = "DBI",
158
159
  Devtools = "devtools",
159
160
  Dplyr = "dplyr",
160
161
  Fs = "fs",
@@ -231,7 +232,12 @@ export declare enum ReferenceType {
231
232
  /** Prefix to identify S3 methods, use this, to for example dispatch a call to `f` which will then link to `f.*` */
232
233
  S3MethodPrefix = 256,
233
234
  /** Prefix to identify S7 methods, use this, to for example dispatch a call to `f` which will then link to `f<7>*` */
234
- S7MethodPrefix = 512
235
+ S7MethodPrefix = 512,
236
+ /**
237
+ * Only ever a lookup target, never the type of a definition: everything a value position may see.
238
+ * `id` in `id > 2` names data, so a function `id` in scope is not what the comparison reads.
239
+ */
240
+ NonFunction = 1024
235
241
  }
236
242
  /** Reverse mapping of the reference types so you can get the name from the bitmask (useful for debugging) */
237
243
  export declare const ReferenceTypeReverseMapping: Map<ReferenceType, string>;
@@ -244,7 +250,7 @@ export declare function isReferenceType(t: ReferenceType, target: ReferenceType)
244
250
  * default definition for the assignment operator `<-`).
245
251
  * @see {@link InGraphIdentifierDefinition} - for the definition of an identifier within the graph
246
252
  */
247
- export type InGraphReferenceType = Exclude<ReferenceType, ReferenceType.BuiltInConstant | ReferenceType.BuiltInFunction>;
253
+ export type InGraphReferenceType = Exclude<ReferenceType, ReferenceType.BuiltInConstant | ReferenceType.BuiltInFunction | ReferenceType.NonFunction>;
248
254
  /**
249
255
  * An identifier reference points to a variable like `a` in `b <- a`.
250
256
  * Without any surrounding code, `a` will produce the identifier reference `a`.
@@ -26,7 +26,7 @@ exports.Identifier = {
26
26
  */
27
27
  make(name, namespace, internal = false) {
28
28
  if ((0, strings_1.startAndEndsWith)(name, '`')) {
29
- name = name.substring(1, name.length - 1);
29
+ name = name.slice(1, -1);
30
30
  }
31
31
  if (namespace) {
32
32
  return [name, namespace, internal];
@@ -304,6 +304,11 @@ var ReferenceType;
304
304
  ReferenceType[ReferenceType["S3MethodPrefix"] = 256] = "S3MethodPrefix";
305
305
  /** Prefix to identify S7 methods, use this, to for example dispatch a call to `f` which will then link to `f<7>*` */
306
306
  ReferenceType[ReferenceType["S7MethodPrefix"] = 512] = "S7MethodPrefix";
307
+ /**
308
+ * Only ever a lookup target, never the type of a definition: everything a value position may see.
309
+ * `id` in `id > 2` names data, so a function `id` in scope is not what the comparison reads.
310
+ */
311
+ ReferenceType[ReferenceType["NonFunction"] = 1024] = "NonFunction";
307
312
  })(ReferenceType || (exports.ReferenceType = ReferenceType = {}));
308
313
  /** Reverse mapping of the reference types so you can get the name from the bitmask (useful for debugging) */
309
314
  exports.ReferenceTypeReverseMapping = new Map(Object.entries(ReferenceType).map(([k, v]) => [v, k]));
@@ -3,7 +3,9 @@ import type { BuiltIns } from './built-in';
3
3
  import type { BuiltInDefinition, BuiltInDefinitions } from './built-in-config';
4
4
  import type { REnvironmentInformation } from './environment';
5
5
  import { Identifier } from './identifier';
6
+ import { NodeId } from '../../r-bridge/lang-4.x/ast/model/processing/node-id';
6
7
  import type { PackageSignatureSource } from '../../project/sigdb/reader';
8
+ import type { DataflowInformation } from '../info';
7
9
  /**
8
10
  * Where to look up what flowR knows about a function, in that order:
9
11
  * the name as it resolves here, the built-in definitions, and the signature database for the rest.
@@ -25,6 +27,10 @@ export interface FnPropsSource {
25
27
  * in the analyzed code, which shadows any built-in.
26
28
  */
27
29
  export declare function queryFnProps(name: Identifier, { environment, builtIns, signatures, version }: FnPropsSource): BuiltInFnInfo | undefined;
30
+ /** What flowR states about the call `id` makes, together with the name the call resolved to. */
31
+ export declare function callFnProps(id: NodeId, { graph, environment }: Pick<DataflowInformation, 'graph' | 'environment'>): (BuiltInFnInfo & {
32
+ name: Identifier;
33
+ }) | undefined;
28
34
  /**
29
35
  * What the signature database implies for a package function: what its own entry states
30
36
  * (see {@link fnInfoFromSignature}) plus the {@link PropagatedProps} of everything it calls, transitively.