@eagleoutice/flowr 2.0.25 → 2.1.0

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 (381) hide show
  1. package/benchmark/slicer.js +2 -1
  2. package/benchmark/stats/print.js +3 -4
  3. package/benchmark/stats/size-of.js +9 -7
  4. package/benchmark/summarizer/first-phase/input.d.ts +0 -1
  5. package/benchmark/summarizer/first-phase/input.js +2 -3
  6. package/benchmark/summarizer/first-phase/process.js +7 -7
  7. package/benchmark/summarizer/second-phase/graph.js +1 -2
  8. package/benchmark/summarizer/second-phase/process.d.ts +0 -1
  9. package/benchmark/summarizer/second-phase/process.js +4 -5
  10. package/benchmark/summarizer/summarizer.js +7 -1
  11. package/cli/benchmark-app.js +6 -1
  12. package/cli/common/features.js +2 -3
  13. package/cli/common/script.js +2 -3
  14. package/cli/common/scripts-info.d.ts +69 -1
  15. package/cli/common/scripts-info.js +6 -6
  16. package/cli/flowr-main-options.d.ts +4 -0
  17. package/cli/flowr-main-options.js +88 -0
  18. package/cli/flowr.d.ts +3 -3
  19. package/cli/flowr.js +22 -31
  20. package/cli/repl/commands/{cfg.d.ts → repl-cfg.d.ts} +1 -1
  21. package/cli/repl/commands/{cfg.js → repl-cfg.js} +3 -3
  22. package/cli/repl/commands/{commands.d.ts → repl-commands.d.ts} +3 -1
  23. package/cli/repl/commands/{commands.js → repl-commands.js} +56 -35
  24. package/cli/repl/commands/{dataflow.d.ts → repl-dataflow.d.ts} +1 -1
  25. package/cli/repl/commands/{dataflow.js → repl-dataflow.js} +2 -2
  26. package/cli/repl/commands/{execute.d.ts → repl-execute.d.ts} +1 -1
  27. package/cli/repl/commands/{execute.js → repl-execute.js} +3 -3
  28. package/cli/repl/commands/repl-lineage.d.ts +15 -0
  29. package/cli/repl/commands/{lineage.js → repl-lineage.js} +14 -12
  30. package/cli/repl/commands/{main.js → repl-main.js} +1 -1
  31. package/cli/repl/commands/{normalize.d.ts → repl-normalize.d.ts} +1 -1
  32. package/cli/repl/commands/{normalize.js → repl-normalize.js} +3 -3
  33. package/cli/repl/commands/{parse.d.ts → repl-parse.d.ts} +1 -1
  34. package/cli/repl/commands/{parse.js → repl-parse.js} +3 -2
  35. package/cli/repl/commands/repl-query.d.ts +8 -0
  36. package/cli/repl/commands/repl-query.js +155 -0
  37. package/cli/repl/commands/repl-quit.d.ts +2 -0
  38. package/cli/repl/commands/{quit.js → repl-quit.js} +1 -1
  39. package/cli/repl/commands/{version.d.ts → repl-version.d.ts} +1 -1
  40. package/cli/repl/commands/{version.js → repl-version.js} +4 -4
  41. package/cli/repl/core.d.ts +1 -2
  42. package/cli/repl/core.js +13 -13
  43. package/cli/repl/execute.d.ts +1 -2
  44. package/cli/repl/execute.js +2 -3
  45. package/cli/repl/print-version.js +3 -4
  46. package/cli/repl/server/connection.d.ts +1 -0
  47. package/cli/repl/server/connection.js +45 -12
  48. package/cli/repl/server/messages/{messages.d.ts → all-messages.d.ts} +8 -7
  49. package/cli/repl/server/messages/{messages.js → all-messages.js} +1 -1
  50. package/cli/repl/server/messages/{analysis.d.ts → message-analysis.d.ts} +2 -1
  51. package/cli/repl/server/messages/message-analysis.js +39 -0
  52. package/cli/repl/server/messages/{error.d.ts → message-error.d.ts} +1 -1
  53. package/cli/repl/server/messages/{error.js → message-error.js} +1 -1
  54. package/cli/repl/server/messages/{hello.d.ts → message-hello.d.ts} +4 -3
  55. package/cli/repl/server/messages/message-hello.js +20 -0
  56. package/cli/repl/server/messages/{lineage.d.ts → message-lineage.d.ts} +2 -1
  57. package/cli/repl/server/messages/message-lineage.js +25 -0
  58. package/cli/repl/server/messages/message-query.d.ts +16 -0
  59. package/cli/repl/server/messages/message-query.js +26 -0
  60. package/cli/repl/server/messages/{repl.d.ts → message-repl.d.ts} +3 -1
  61. package/cli/repl/server/messages/message-repl.js +53 -0
  62. package/cli/repl/server/messages/{slice.d.ts → message-slice.d.ts} +2 -1
  63. package/cli/repl/server/messages/{slice.js → message-slice.js} +14 -6
  64. package/cli/repl/server/net.d.ts +0 -1
  65. package/cli/repl/server/send.d.ts +1 -1
  66. package/cli/repl/server/send.js +2 -3
  67. package/cli/repl/server/server.js +2 -2
  68. package/cli/repl/server/validate.d.ts +1 -1
  69. package/cli/repl/server/validate.js +5 -6
  70. package/cli/run-script.d.ts +8 -0
  71. package/cli/run-script.js +18 -0
  72. package/cli/script-core/statistics-core.d.ts +2 -0
  73. package/cli/script-core/statistics-core.js +100 -0
  74. package/cli/script-core/statistics-helper-core.d.ts +2 -0
  75. package/cli/script-core/statistics-helper-core.js +81 -0
  76. package/cli/script-core/summarizer-core.d.ts +2 -0
  77. package/cli/script-core/summarizer-core.js +51 -0
  78. package/cli/statistics-app.js +3 -87
  79. package/cli/statistics-helper-app.js +3 -77
  80. package/cli/summarizer-app.js +2 -48
  81. package/config.d.ts +20 -4
  82. package/config.js +62 -36
  83. package/core/pipeline-executor.js +11 -1
  84. package/core/print/dataflow-printer.js +4 -5
  85. package/core/print/normalize-printer.js +4 -5
  86. package/core/print/parse-printer.js +1 -2
  87. package/core/print/print.js +2 -3
  88. package/core/print/slice-diff-ansi.js +1 -2
  89. package/core/steps/pipeline/create-pipeline.js +1 -2
  90. package/core/steps/pipeline/default-pipelines.d.ts +18 -18
  91. package/core/steps/pipeline/pipeline.js +1 -2
  92. package/dataflow/environments/append.js +1 -2
  93. package/dataflow/environments/built-in-config.d.ts +47 -0
  94. package/dataflow/environments/built-in-config.js +83 -0
  95. package/dataflow/environments/built-in.d.ts +49 -6
  96. package/dataflow/environments/built-in.js +29 -97
  97. package/dataflow/environments/clone.js +2 -2
  98. package/dataflow/environments/default-builtin-config.d.ts +5 -0
  99. package/dataflow/environments/default-builtin-config.js +83 -0
  100. package/dataflow/environments/define.js +1 -2
  101. package/dataflow/environments/diff.js +5 -6
  102. package/dataflow/environments/environment.js +8 -7
  103. package/dataflow/environments/identifier.d.ts +39 -8
  104. package/dataflow/environments/identifier.js +33 -0
  105. package/dataflow/environments/overwrite.d.ts +6 -5
  106. package/dataflow/environments/overwrite.js +16 -9
  107. package/dataflow/environments/resolve-by-name.d.ts +3 -1
  108. package/dataflow/environments/resolve-by-name.js +40 -8
  109. package/dataflow/environments/scoping.js +2 -3
  110. package/dataflow/extractor.js +25 -24
  111. package/dataflow/graph/dataflowgraph-builder.d.ts +139 -0
  112. package/dataflow/graph/dataflowgraph-builder.js +247 -0
  113. package/dataflow/graph/diff.js +12 -11
  114. package/dataflow/graph/edge.d.ts +2 -2
  115. package/dataflow/graph/edge.js +46 -20
  116. package/dataflow/graph/graph.d.ts +14 -6
  117. package/dataflow/graph/graph.js +25 -21
  118. package/dataflow/graph/quads.js +1 -2
  119. package/dataflow/graph/resolve-graph.d.ts +7 -0
  120. package/dataflow/graph/resolve-graph.js +51 -0
  121. package/dataflow/graph/vertex.d.ts +12 -4
  122. package/dataflow/graph/vertex.js +19 -11
  123. package/dataflow/info.d.ts +3 -7
  124. package/dataflow/info.js +7 -8
  125. package/dataflow/internal/linker.d.ts +3 -1
  126. package/dataflow/internal/linker.js +77 -32
  127. package/dataflow/internal/process/functions/call/argument/make-argument.js +5 -5
  128. package/dataflow/internal/process/functions/call/argument/unpack-argument.js +1 -2
  129. package/dataflow/internal/process/functions/call/built-in/built-in-access.js +10 -8
  130. package/dataflow/internal/process/functions/call/built-in/built-in-apply.d.ts +5 -1
  131. package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +27 -10
  132. package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +40 -26
  133. package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +30 -20
  134. package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +10 -9
  135. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +12 -11
  136. package/dataflow/internal/process/functions/call/built-in/built-in-get.js +6 -5
  137. package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +7 -6
  138. package/dataflow/internal/process/functions/call/built-in/built-in-library.js +4 -4
  139. package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +10 -6
  140. package/dataflow/internal/process/functions/call/built-in/built-in-quote.js +7 -3
  141. package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.js +2 -3
  142. package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +5 -4
  143. package/dataflow/internal/process/functions/call/built-in/built-in-source.js +6 -6
  144. package/dataflow/internal/process/functions/call/built-in/built-in-special-bin-op.js +3 -3
  145. package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.js +6 -5
  146. package/dataflow/internal/process/functions/call/common.js +30 -19
  147. package/dataflow/internal/process/functions/call/default-call-handling.js +1 -2
  148. package/dataflow/internal/process/functions/call/known-call-handling.js +8 -6
  149. package/dataflow/internal/process/functions/call/named-call-handling.js +7 -6
  150. package/dataflow/internal/process/functions/call/unnamed-call-handling.js +11 -7
  151. package/dataflow/internal/process/functions/process-argument.js +10 -8
  152. package/dataflow/internal/process/functions/process-parameter.js +8 -6
  153. package/dataflow/internal/process/process-named-call.js +3 -3
  154. package/dataflow/internal/process/process-symbol.js +5 -4
  155. package/dataflow/internal/process/process-uninteresting-leaf.js +1 -2
  156. package/dataflow/internal/process/process-value.js +5 -4
  157. package/dataflow/processor.js +1 -2
  158. package/documentation/data/dfg/doc-data-dfg-util.d.ts +20 -0
  159. package/documentation/data/dfg/doc-data-dfg-util.js +13 -0
  160. package/documentation/data/query/example-query-code.d.ts +1 -0
  161. package/documentation/data/query/example-query-code.js +25 -0
  162. package/documentation/data/server/doc-data-server-messages.d.ts +1 -0
  163. package/documentation/data/server/doc-data-server-messages.js +508 -0
  164. package/documentation/doc-util/doc-auto-gen.d.ts +7 -0
  165. package/documentation/doc-util/doc-auto-gen.js +9 -0
  166. package/documentation/doc-util/doc-cfg.d.ts +7 -0
  167. package/documentation/doc-util/doc-cfg.js +18 -0
  168. package/documentation/doc-util/doc-cli-option.d.ts +8 -0
  169. package/documentation/doc-util/doc-cli-option.js +36 -0
  170. package/documentation/doc-util/doc-code.d.ts +1 -0
  171. package/documentation/doc-util/doc-code.js +7 -0
  172. package/documentation/doc-util/doc-dfg.d.ts +21 -0
  173. package/documentation/doc-util/doc-dfg.js +93 -0
  174. package/documentation/doc-util/doc-docker.d.ts +1 -0
  175. package/documentation/doc-util/doc-docker.js +5 -0
  176. package/documentation/doc-util/doc-env.d.ts +2 -0
  177. package/documentation/doc-util/doc-env.js +20 -0
  178. package/documentation/doc-util/doc-files.d.ts +6 -0
  179. package/documentation/doc-util/doc-files.js +25 -0
  180. package/documentation/doc-util/doc-general.d.ts +2 -0
  181. package/documentation/doc-util/doc-general.js +16 -0
  182. package/documentation/doc-util/doc-hover-over.d.ts +1 -0
  183. package/documentation/doc-util/doc-hover-over.js +7 -0
  184. package/documentation/doc-util/doc-issue.d.ts +1 -0
  185. package/documentation/doc-util/doc-issue.js +6 -0
  186. package/documentation/doc-util/doc-ms.d.ts +1 -0
  187. package/documentation/doc-util/doc-ms.js +8 -0
  188. package/documentation/doc-util/doc-normalized-ast.d.ts +11 -0
  189. package/documentation/doc-util/doc-normalized-ast.js +71 -0
  190. package/documentation/doc-util/doc-query.d.ts +24 -0
  191. package/documentation/doc-util/doc-query.js +113 -0
  192. package/documentation/doc-util/doc-repl.d.ts +13 -0
  193. package/documentation/doc-util/doc-repl.js +79 -0
  194. package/documentation/doc-util/doc-server-message.d.ts +37 -0
  195. package/documentation/doc-util/doc-server-message.js +153 -0
  196. package/documentation/doc-util/doc-structure.d.ts +12 -0
  197. package/documentation/doc-util/doc-structure.js +21 -0
  198. package/documentation/doc-util/doc-types.d.ts +38 -0
  199. package/documentation/doc-util/doc-types.js +276 -0
  200. package/{r-bridge/data/print.js → documentation/print-capabilities-markdown.js} +8 -4
  201. package/documentation/print-dataflow-graph-wiki.d.ts +1 -0
  202. package/documentation/print-dataflow-graph-wiki.js +849 -0
  203. package/documentation/print-interface-wiki.d.ts +1 -0
  204. package/documentation/print-interface-wiki.js +401 -0
  205. package/documentation/print-normalized-ast-wiki.d.ts +1 -0
  206. package/documentation/print-normalized-ast-wiki.js +98 -0
  207. package/documentation/print-query-wiki.d.ts +1 -0
  208. package/documentation/print-query-wiki.js +215 -0
  209. package/package.json +29 -33
  210. package/queries/base-query-format.d.ts +11 -0
  211. package/{cli/repl/server/messages/hello.js → queries/base-query-format.js} +1 -1
  212. package/queries/call-context-query/call-context-query-executor.d.ts +11 -0
  213. package/queries/call-context-query/call-context-query-executor.js +255 -0
  214. package/queries/call-context-query/call-context-query-format.d.ts +72 -0
  215. package/queries/call-context-query/call-context-query-format.js +17 -0
  216. package/queries/query-schema.d.ts +7 -0
  217. package/queries/query-schema.js +31 -0
  218. package/queries/query.d.ts +35 -0
  219. package/queries/query.js +57 -0
  220. package/queries/two-layer-collector.d.ts +8 -0
  221. package/queries/two-layer-collector.js +31 -0
  222. package/queries/virtual-query/compound-query.d.ts +24 -0
  223. package/queries/virtual-query/compound-query.js +18 -0
  224. package/queries/virtual-query/virtual-queries.d.ts +15 -0
  225. package/queries/virtual-query/virtual-queries.js +8 -0
  226. package/r-bridge/data/data.d.ts +5 -0
  227. package/r-bridge/data/data.js +6 -0
  228. package/r-bridge/data/get.js +2 -3
  229. package/r-bridge/init.js +2 -2
  230. package/r-bridge/lang-4.x/ast/model/collect.js +1 -2
  231. package/r-bridge/lang-4.x/ast/model/model.d.ts +1 -2
  232. package/r-bridge/lang-4.x/ast/model/nodes/r-access.d.ts +3 -0
  233. package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.d.ts +3 -0
  234. package/r-bridge/lang-4.x/ast/model/nodes/r-break.d.ts +3 -0
  235. package/r-bridge/lang-4.x/ast/model/nodes/r-comment.d.ts +5 -0
  236. package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.d.ts +4 -0
  237. package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.d.ts +1 -1
  238. package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.d.ts +10 -1
  239. package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.d.ts +5 -0
  240. package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.d.ts +3 -0
  241. package/r-bridge/lang-4.x/ast/model/nodes/r-logical.d.ts +3 -0
  242. package/r-bridge/lang-4.x/ast/model/nodes/r-next.d.ts +3 -0
  243. package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.d.ts +3 -0
  244. package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.d.ts +1 -1
  245. package/r-bridge/lang-4.x/ast/model/nodes/r-string.d.ts +3 -0
  246. package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.d.ts +3 -0
  247. package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.js +1 -2
  248. package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.d.ts +3 -0
  249. package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.d.ts +2 -2
  250. package/r-bridge/lang-4.x/ast/model/operators.js +27 -26
  251. package/r-bridge/lang-4.x/ast/model/processing/decorate.js +9 -9
  252. package/r-bridge/lang-4.x/ast/model/processing/fold.js +1 -2
  253. package/r-bridge/lang-4.x/ast/model/processing/node-id.d.ts +5 -0
  254. package/r-bridge/lang-4.x/ast/model/processing/node-id.js +26 -3
  255. package/r-bridge/lang-4.x/ast/model/processing/role.js +1 -2
  256. package/r-bridge/lang-4.x/ast/model/processing/stateful-fold.js +23 -23
  257. package/r-bridge/lang-4.x/ast/model/processing/visitor.js +23 -23
  258. package/r-bridge/lang-4.x/ast/model/type.d.ts +2 -2
  259. package/r-bridge/lang-4.x/ast/model/type.js +221 -12
  260. package/r-bridge/lang-4.x/ast/parser/json/format.js +2 -2
  261. package/r-bridge/lang-4.x/ast/parser/json/parser.js +6 -5
  262. package/r-bridge/lang-4.x/ast/parser/xml/input-format.js +3 -3
  263. package/r-bridge/lang-4.x/ast/parser/xml/internal/control/normalize-if-then-else.js +4 -4
  264. package/r-bridge/lang-4.x/ast/parser/xml/internal/control/normalize-if-then.js +7 -7
  265. package/r-bridge/lang-4.x/ast/parser/xml/internal/expression/normalize-expression.js +4 -4
  266. package/r-bridge/lang-4.x/ast/parser/xml/internal/functions/normalize-argument.js +10 -10
  267. package/r-bridge/lang-4.x/ast/parser/xml/internal/functions/normalize-call.js +18 -18
  268. package/r-bridge/lang-4.x/ast/parser/xml/internal/functions/normalize-definition.js +8 -8
  269. package/r-bridge/lang-4.x/ast/parser/xml/internal/functions/normalize-parameter.js +9 -9
  270. package/r-bridge/lang-4.x/ast/parser/xml/internal/loops/normalize-break.js +3 -3
  271. package/r-bridge/lang-4.x/ast/parser/xml/internal/loops/normalize-for.js +10 -10
  272. package/r-bridge/lang-4.x/ast/parser/xml/internal/loops/normalize-next.js +3 -3
  273. package/r-bridge/lang-4.x/ast/parser/xml/internal/loops/normalize-repeat.js +5 -5
  274. package/r-bridge/lang-4.x/ast/parser/xml/internal/loops/normalize-while.js +7 -7
  275. package/r-bridge/lang-4.x/ast/parser/xml/internal/normalize-access.js +12 -12
  276. package/r-bridge/lang-4.x/ast/parser/xml/internal/operators/normalize-binary.js +14 -14
  277. package/r-bridge/lang-4.x/ast/parser/xml/internal/operators/normalize-unary.js +4 -4
  278. package/r-bridge/lang-4.x/ast/parser/xml/internal/other/normalize-comment.js +3 -3
  279. package/r-bridge/lang-4.x/ast/parser/xml/internal/other/normalize-line-directive.js +4 -4
  280. package/r-bridge/lang-4.x/ast/parser/xml/internal/structure/normalize-delimiter.js +3 -3
  281. package/r-bridge/lang-4.x/ast/parser/xml/internal/structure/normalize-expressions.js +13 -13
  282. package/r-bridge/lang-4.x/ast/parser/xml/internal/structure/normalize-root.js +6 -6
  283. package/r-bridge/lang-4.x/ast/parser/xml/internal/structure/normalize-single-node.js +19 -19
  284. package/r-bridge/lang-4.x/ast/parser/xml/internal/values/normalize-number.js +5 -5
  285. package/r-bridge/lang-4.x/ast/parser/xml/internal/values/normalize-string.js +3 -3
  286. package/r-bridge/lang-4.x/ast/parser/xml/internal/values/normalize-symbol.js +2 -3
  287. package/r-bridge/lang-4.x/ast/parser/xml/normalize-meta.js +12 -12
  288. package/r-bridge/lang-4.x/convert-values.js +7 -7
  289. package/r-bridge/retriever.js +12 -11
  290. package/r-bridge/shell.d.ts +0 -1
  291. package/r-bridge/shell.js +6 -1
  292. package/reconstruct/auto-select/auto-select-defaults.js +1 -2
  293. package/reconstruct/auto-select/magic-comments.js +3 -3
  294. package/reconstruct/reconstruct.js +4 -3
  295. package/slicing/criterion/collect-all.js +1 -2
  296. package/slicing/criterion/parse.d.ts +1 -1
  297. package/slicing/criterion/parse.js +6 -5
  298. package/slicing/static/fingerprint.js +2 -3
  299. package/slicing/static/slice-call.js +9 -9
  300. package/slicing/static/static-slicer.js +5 -4
  301. package/statistics/features/common-syntax-probability.js +13 -13
  302. package/statistics/features/feature.d.ts +5 -9
  303. package/statistics/features/feature.js +2 -2
  304. package/statistics/features/post-processing.js +2 -3
  305. package/statistics/features/supported/assignments/assignments.js +3 -2
  306. package/statistics/features/supported/assignments/post-process.js +1 -2
  307. package/statistics/features/supported/comments/post-process.js +1 -2
  308. package/statistics/features/supported/control-flow/control-flow.js +4 -3
  309. package/statistics/features/supported/control-flow/post-process.js +1 -2
  310. package/statistics/features/supported/data-access/data-access.d.ts +2 -2
  311. package/statistics/features/supported/data-access/data-access.js +3 -2
  312. package/statistics/features/supported/data-access/post-process.js +1 -2
  313. package/statistics/features/supported/defined-functions/defined-functions.js +9 -7
  314. package/statistics/features/supported/defined-functions/post-process.d.ts +1 -1
  315. package/statistics/features/supported/defined-functions/post-process.js +2 -3
  316. package/statistics/features/supported/expression-list/post-process.js +1 -2
  317. package/statistics/features/supported/expression-list/{expression-list.js → statistics-expression-list.js} +4 -3
  318. package/statistics/features/supported/loops/loops.js +8 -7
  319. package/statistics/features/supported/loops/post-process.js +1 -2
  320. package/statistics/features/supported/used-functions/post-process.js +2 -3
  321. package/statistics/features/supported/used-functions/used-functions.d.ts +1 -1
  322. package/statistics/features/supported/used-functions/used-functions.js +4 -3
  323. package/statistics/features/supported/used-packages/post-process.js +1 -2
  324. package/statistics/features/supported/values/post-process.js +1 -2
  325. package/statistics/features/supported/variables/post-process.js +2 -3
  326. package/statistics/features/supported/variables/variables.js +2 -1
  327. package/statistics/meta-statistics.js +1 -2
  328. package/statistics/output/print-stats.js +4 -5
  329. package/statistics/output/statistics-file.js +5 -5
  330. package/statistics/statistics.js +2 -3
  331. package/statistics/summarizer/auto-detect.js +1 -2
  332. package/statistics/summarizer/post-process/clusterer.js +1 -2
  333. package/statistics/summarizer/post-process/file-based-count.js +2 -3
  334. package/statistics/summarizer/post-process/histogram.js +3 -4
  335. package/statistics/summarizer/post-process/post-process-output.js +2 -3
  336. package/statistics/summarizer/second-phase/process.d.ts +2 -0
  337. package/statistics/summarizer/second-phase/process.js +2 -2
  338. package/statistics/summarizer/summarizer.js +8 -1
  339. package/util/ansi.d.ts +1 -0
  340. package/util/ansi.js +27 -4
  341. package/util/args.js +2 -3
  342. package/util/arrays.js +8 -9
  343. package/util/assert.js +5 -6
  344. package/util/bimap.d.ts +4 -4
  345. package/util/cfg/cfg.d.ts +1 -0
  346. package/util/cfg/cfg.js +8 -5
  347. package/util/cfg/visitor.d.ts +8 -13
  348. package/util/cfg/visitor.js +22 -56
  349. package/util/diff.js +1 -2
  350. package/util/files.d.ts +0 -1
  351. package/util/files.js +11 -8
  352. package/util/json.js +2 -3
  353. package/util/mermaid/ast.js +7 -7
  354. package/util/mermaid/cfg.js +2 -3
  355. package/util/mermaid/dfg.d.ts +12 -4
  356. package/util/mermaid/dfg.js +28 -16
  357. package/util/mermaid/mermaid.js +5 -4
  358. package/util/numbers.js +1 -2
  359. package/util/objects.d.ts +7 -0
  360. package/util/objects.js +13 -3
  361. package/util/os.js +1 -2
  362. package/util/quads.js +5 -5
  363. package/util/random.js +2 -2
  364. package/util/range.js +8 -9
  365. package/util/schema.d.ts +11 -0
  366. package/util/schema.js +75 -0
  367. package/util/set.js +2 -3
  368. package/util/strings.js +3 -4
  369. package/util/summarizer.js +4 -4
  370. package/util/text.d.ts +1 -0
  371. package/util/text.js +20 -0
  372. package/util/time.js +1 -2
  373. package/util/version.js +2 -3
  374. package/cli/repl/commands/lineage.d.ts +0 -15
  375. package/cli/repl/commands/quit.d.ts +0 -2
  376. package/cli/repl/server/messages/analysis.js +0 -21
  377. package/cli/repl/server/messages/lineage.js +0 -17
  378. package/cli/repl/server/messages/repl.js +0 -37
  379. /package/cli/repl/commands/{main.d.ts → repl-main.d.ts} +0 -0
  380. /package/{r-bridge/data/print.d.ts → documentation/print-capabilities-markdown.d.ts} +0 -0
  381. /package/statistics/features/supported/expression-list/{expression-list.d.ts → statistics-expression-list.d.ts} +0 -0
@@ -1,11 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.tryNormalizeFunctionDefinition = void 0;
3
+ exports.tryNormalizeFunctionDefinition = tryNormalizeFunctionDefinition;
4
4
  const parser_1 = require("../../../json/parser");
5
5
  const normalize_meta_1 = require("../../normalize-meta");
6
6
  const assert_1 = require("../../../../../../../util/assert");
7
7
  const arrays_1 = require("../../../../../../../util/arrays");
8
8
  const normalize_parameter_1 = require("./normalize-parameter");
9
+ const type_1 = require("../../../../model/type");
9
10
  const normalize_expressions_1 = require("../structure/normalize-expressions");
10
11
  /**
11
12
  * Tries to parse the given data as a function definition.
@@ -17,16 +18,16 @@ const normalize_expressions_1 = require("../structure/normalize-expressions");
17
18
  */
18
19
  function tryNormalizeFunctionDefinition(data, mappedWithName) {
19
20
  const fnBase = mappedWithName[0];
20
- if (fnBase.name !== "FUNCTION" /* RawRType.Function */ && fnBase.name !== "\\\\" /* RawRType.Lambda */) {
21
+ if (fnBase.name !== type_1.RawRType.Function && fnBase.name !== type_1.RawRType.Lambda) {
21
22
  parser_1.parseLog.trace(`expected function definition to be identified by keyword, yet received ${fnBase.name}`);
22
23
  return undefined;
23
24
  }
24
25
  const { content, location } = (0, normalize_meta_1.retrieveMetaStructure)(fnBase.content);
25
26
  const openParen = mappedWithName[1];
26
- (0, assert_1.guard)(openParen.name === "(" /* RawRType.ParenLeft */, () => `expected opening parenthesis, yet received ${openParen.name}`);
27
- const closingParenIndex = mappedWithName.findIndex(x => x.name === ")" /* RawRType.ParenRight */);
27
+ (0, assert_1.guard)(openParen.name === type_1.RawRType.ParenLeft, () => `expected opening parenthesis, yet received ${openParen.name}`);
28
+ const closingParenIndex = mappedWithName.findIndex(x => x.name === type_1.RawRType.ParenRight);
28
29
  (0, assert_1.guard)(closingParenIndex !== -1, () => `expected closing parenthesis, yet received ${JSON.stringify(mappedWithName)}`);
29
- const splitParameters = (0, arrays_1.splitArrayOn)(mappedWithName.slice(2, closingParenIndex), x => x.name === "," /* RawRType.Comma */);
30
+ const splitParameters = (0, arrays_1.splitArrayOn)(mappedWithName.slice(2, closingParenIndex), x => x.name === type_1.RawRType.Comma);
30
31
  parser_1.parseLog.trace(`function definition has ${splitParameters.length} parameters (by comma split)`);
31
32
  const parameters = splitParameters.map(x => (0, normalize_parameter_1.tryNormalizeParameter)(data, x));
32
33
  if (parameters.some(p => p === undefined)) {
@@ -37,9 +38,9 @@ function tryNormalizeFunctionDefinition(data, mappedWithName) {
37
38
  const bodyStructure = mappedWithName.slice(closingParenIndex + 1);
38
39
  (0, assert_1.guard)(bodyStructure.length === 1, () => `expected function body to be unique, yet received ${bodyStructure.length}`);
39
40
  const body = (0, normalize_expressions_1.normalizeExpressions)(data, bodyStructure);
40
- (0, assert_1.guard)(body.length === 1 && body[0].type !== "RDelimiter" /* RType.Delimiter */, () => `expected function body to yield one normalized expression, but ${body.length}`);
41
+ (0, assert_1.guard)(body.length === 1 && body[0].type !== type_1.RType.Delimiter, () => `expected function body to yield one normalized expression, but ${body.length}`);
41
42
  return {
42
- type: "RFunctionDefinition" /* RType.FunctionDefinition */,
43
+ type: type_1.RType.FunctionDefinition,
43
44
  location,
44
45
  lexeme: content,
45
46
  parameters: parameters,
@@ -51,5 +52,4 @@ function tryNormalizeFunctionDefinition(data, mappedWithName) {
51
52
  }
52
53
  };
53
54
  }
54
- exports.tryNormalizeFunctionDefinition = tryNormalizeFunctionDefinition;
55
55
  //# sourceMappingURL=normalize-definition.js.map
@@ -1,9 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.tryNormalizeParameter = void 0;
3
+ exports.tryNormalizeParameter = tryNormalizeParameter;
4
4
  const parser_1 = require("../../../json/parser");
5
5
  const normalize_meta_1 = require("../../normalize-meta");
6
6
  const assert_1 = require("../../../../../../../util/assert");
7
+ const type_1 = require("../../../../model/type");
7
8
  const normalize_single_node_1 = require("../structure/normalize-single-node");
8
9
  /**
9
10
  * Either parses `[SYMBOL_FORMALS]` or `[SYMBOL_FORMALS, EQ_FORMALS, expr]` as a parameter of a function definition in R.
@@ -21,19 +22,19 @@ function tryNormalizeParameter(data, objs) {
21
22
  return undefined;
22
23
  }
23
24
  const symbol = objs[0];
24
- if (symbol.name !== "SYMBOL_FORMALS" /* RawRType.SymbolFormals */) {
25
+ if (symbol.name !== type_1.RawRType.SymbolFormals) {
25
26
  parser_1.parseLog.warn(`expected symbol for parameter, yet received ${JSON.stringify(objs)}`);
26
27
  return undefined;
27
28
  }
28
29
  const defaultValue = objs.length === 3 ? parseWithDefaultValue(data, objs) : undefined;
29
30
  const { location, content } = (0, normalize_meta_1.retrieveMetaStructure)(symbol.content);
30
31
  return {
31
- type: "RParameter" /* RType.Parameter */,
32
+ type: type_1.RType.Parameter,
32
33
  location,
33
34
  special: content === '...',
34
35
  lexeme: content,
35
36
  name: {
36
- type: "RSymbol" /* RType.Symbol */,
37
+ type: type_1.RType.Symbol,
37
38
  location, content,
38
39
  namespace: undefined,
39
40
  lexeme: content,
@@ -43,18 +44,17 @@ function tryNormalizeParameter(data, objs) {
43
44
  fullLexeme: content
44
45
  }
45
46
  },
46
- defaultValue: defaultValue?.type === "RDelimiter" /* RType.Delimiter */ ? undefined : defaultValue,
47
+ defaultValue: defaultValue?.type === type_1.RType.Delimiter ? undefined : defaultValue,
47
48
  info: {
48
49
  fullRange: location,
49
50
  fullLexeme: content,
50
- additionalTokens: defaultValue?.type === "RDelimiter" /* RType.Delimiter */ ? [defaultValue] : []
51
+ additionalTokens: defaultValue?.type === type_1.RType.Delimiter ? [defaultValue] : []
51
52
  }
52
53
  };
53
54
  }
54
- exports.tryNormalizeParameter = tryNormalizeParameter;
55
55
  function parseWithDefaultValue(data, objs) {
56
- (0, assert_1.guard)(objs[1].name === "EQ_FORMALS" /* RawRType.EqualFormals */, () => `[arg-default] second element of parameter must be ${"EQ_FORMALS" /* RawRType.EqualFormals */}, but: ${JSON.stringify(objs)}`);
57
- (0, assert_1.guard)(objs[2].name === "expr" /* RawRType.Expression */, () => `[arg-default] third element of parameter must be an Expression but: ${JSON.stringify(objs)}`);
56
+ (0, assert_1.guard)(objs[1].name === type_1.RawRType.EqualFormals, () => `[arg-default] second element of parameter must be ${type_1.RawRType.EqualFormals}, but: ${JSON.stringify(objs)}`);
57
+ (0, assert_1.guard)(objs[2].name === type_1.RawRType.Expression, () => `[arg-default] third element of parameter must be an Expression but: ${JSON.stringify(objs)}`);
58
58
  return (0, normalize_single_node_1.normalizeSingleNode)(data, objs[2]);
59
59
  }
60
60
  //# sourceMappingURL=normalize-parameter.js.map
@@ -1,14 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.normalizeBreak = void 0;
3
+ exports.normalizeBreak = normalizeBreak;
4
4
  const parser_1 = require("../../../json/parser");
5
5
  const log_1 = require("../../../../../../../util/log");
6
6
  const normalize_meta_1 = require("../../normalize-meta");
7
+ const type_1 = require("../../../../model/type");
7
8
  function normalizeBreak(data, obj) {
8
9
  (0, log_1.expensiveTrace)(parser_1.parseLog, () => `[break] ${JSON.stringify(obj)}`);
9
10
  const { location, content } = (0, normalize_meta_1.retrieveMetaStructure)(obj);
10
11
  return {
11
- type: "RBreak" /* RType.Break */,
12
+ type: type_1.RType.Break,
12
13
  location,
13
14
  lexeme: content,
14
15
  info: {
@@ -18,5 +19,4 @@ function normalizeBreak(data, obj) {
18
19
  }
19
20
  };
20
21
  }
21
- exports.normalizeBreak = normalizeBreak;
22
22
  //# sourceMappingURL=normalize-break.js.map
@@ -1,24 +1,25 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.tryNormalizeFor = void 0;
3
+ exports.tryNormalizeFor = tryNormalizeFor;
4
4
  const input_format_1 = require("../../input-format");
5
5
  const parser_1 = require("../../../json/parser");
6
6
  const normalize_meta_1 = require("../../normalize-meta");
7
7
  const assert_1 = require("../../../../../../../util/assert");
8
+ const type_1 = require("../../../../model/type");
8
9
  const normalize_single_node_1 = require("../structure/normalize-single-node");
9
10
  const normalize_expressions_1 = require("../structure/normalize-expressions");
10
11
  const normalize_symbol_1 = require("../values/normalize-symbol");
11
12
  const normalize_comment_1 = require("../other/normalize-comment");
12
13
  function tryNormalizeFor(data, [forToken, head, body]) {
13
14
  // funny, for does not use top-level parenthesis
14
- if (forToken.name !== "FOR" /* RawRType.For */) {
15
+ if (forToken.name !== type_1.RawRType.For) {
15
16
  parser_1.parseLog.debug('encountered non-for token for supposed for-loop structure');
16
17
  return undefined;
17
18
  }
18
- else if (head.name !== "forcond" /* RawRType.ForCondition */) {
19
+ else if (head.name !== type_1.RawRType.ForCondition) {
19
20
  throw new input_format_1.XmlParseError(`expected condition for for-loop but found ${JSON.stringify(head)}`);
20
21
  }
21
- else if (body.name !== "expr" /* RawRType.Expression */ && body.name !== "expr_or_assign_or_help" /* RawRType.ExprOfAssignOrHelp */ && body.name !== "equal_assign" /* RawRType.LegacyEqualAssign */) {
22
+ else if (body.name !== type_1.RawRType.Expression && body.name !== type_1.RawRType.ExprOfAssignOrHelp && body.name !== type_1.RawRType.LegacyEqualAssign) {
22
23
  throw new input_format_1.XmlParseError(`expected expr body for for-loop but found ${JSON.stringify(body)}`);
23
24
  }
24
25
  parser_1.parseLog.debug('trying to parse for-loop');
@@ -27,7 +28,7 @@ function tryNormalizeFor(data, [forToken, head, body]) {
27
28
  const parseBody = (0, normalize_single_node_1.normalizeSingleNode)(newParseData, body);
28
29
  if (parsedVariable === undefined ||
29
30
  parsedVector === undefined ||
30
- parseBody.type === "RDelimiter" /* RType.Delimiter */) {
31
+ parseBody.type === type_1.RType.Delimiter) {
31
32
  throw new input_format_1.XmlParseError(`unexpected under-sided for-loop, received ${JSON.stringify([
32
33
  parsedVariable,
33
34
  parsedVariable,
@@ -36,7 +37,7 @@ function tryNormalizeFor(data, [forToken, head, body]) {
36
37
  }
37
38
  const { location, content } = (0, normalize_meta_1.retrieveMetaStructure)(forToken.content);
38
39
  return {
39
- type: "RForLoop" /* RType.ForLoop */,
40
+ type: type_1.RType.ForLoop,
40
41
  variable: parsedVariable,
41
42
  vector: parsedVector,
42
43
  body: (0, normalize_meta_1.ensureExpressionList)(parseBody),
@@ -49,18 +50,17 @@ function tryNormalizeFor(data, [forToken, head, body]) {
49
50
  location
50
51
  };
51
52
  }
52
- exports.tryNormalizeFor = tryNormalizeFor;
53
53
  function normalizeForHead(data, forCondition) {
54
54
  // must have a child which is `in`, a variable on the left, and a vector on the right
55
55
  const children = (0, input_format_1.getKeyGuarded)(forCondition, input_format_1.childrenKey).map(content => ({ name: (0, normalize_meta_1.getTokenType)(content), content }));
56
56
  const { comments, others } = (0, normalize_expressions_1.splitComments)(children);
57
- const inPosition = others.findIndex(elem => elem.name === "IN" /* RawRType.ForIn */);
57
+ const inPosition = others.findIndex(elem => elem.name === type_1.RawRType.ForIn);
58
58
  (0, assert_1.guard)(inPosition > 0 && inPosition < others.length - 1, () => `for loop searched in and found at ${inPosition}, but this is not in legal bounds for ${JSON.stringify(children)}`);
59
59
  const variable = (0, normalize_symbol_1.tryNormalizeSymbol)(data, [others[inPosition - 1]]);
60
60
  (0, assert_1.guard)(variable !== undefined, () => `for loop variable should have been parsed to a symbol but was ${JSON.stringify(variable)}`);
61
- (0, assert_1.guard)(variable.type === "RSymbol" /* RType.Symbol */, () => `for loop variable should have been parsed to a symbol but was ${JSON.stringify(variable)}`);
61
+ (0, assert_1.guard)(variable.type === type_1.RType.Symbol, () => `for loop variable should have been parsed to a symbol but was ${JSON.stringify(variable)}`);
62
62
  const vector = (0, normalize_expressions_1.normalizeExpressions)(data, [others[inPosition + 1]]);
63
- (0, assert_1.guard)(vector.length === 1 && vector[0].type !== "RDelimiter" /* RType.Delimiter */, () => `for loop vector should have been parsed to a single element but was ${JSON.stringify(vector)}`);
63
+ (0, assert_1.guard)(vector.length === 1 && vector[0].type !== type_1.RType.Delimiter, () => `for loop vector should have been parsed to a single element but was ${JSON.stringify(vector)}`);
64
64
  const parsedComments = comments.map(c => (0, normalize_comment_1.normalizeComment)(data, c.content));
65
65
  return { variable, vector: vector[0], comments: parsedComments };
66
66
  }
@@ -1,14 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.normalizeNext = void 0;
3
+ exports.normalizeNext = normalizeNext;
4
4
  const log_1 = require("../../../../../../../util/log");
5
5
  const parser_1 = require("../../../json/parser");
6
6
  const normalize_meta_1 = require("../../normalize-meta");
7
+ const type_1 = require("../../../../model/type");
7
8
  function normalizeNext(data, obj) {
8
9
  (0, log_1.expensiveTrace)(parser_1.parseLog, () => `[next] ${JSON.stringify(obj)}`);
9
10
  const { location, content } = (0, normalize_meta_1.retrieveMetaStructure)(obj);
10
11
  return {
11
- type: "RNext" /* RType.Next */,
12
+ type: type_1.RType.Next,
12
13
  location,
13
14
  lexeme: content,
14
15
  info: {
@@ -18,5 +19,4 @@ function normalizeNext(data, obj) {
18
19
  }
19
20
  };
20
21
  }
21
- exports.normalizeNext = normalizeNext;
22
22
  //# sourceMappingURL=normalize-next.js.map
@@ -1,9 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.tryNormalizeRepeat = void 0;
3
+ exports.tryNormalizeRepeat = tryNormalizeRepeat;
4
4
  const parser_1 = require("../../../json/parser");
5
5
  const assert_1 = require("../../../../../../../util/assert");
6
6
  const normalize_meta_1 = require("../../normalize-meta");
7
+ const type_1 = require("../../../../model/type");
7
8
  const normalize_single_node_1 = require("../structure/normalize-single-node");
8
9
  /**
9
10
  * Try to parse the construct as a {@link RRepeatLoop}.
@@ -15,16 +16,16 @@ const normalize_single_node_1 = require("../structure/normalize-single-node");
15
16
  * @returns The parsed {@link RRepeatLoop} or `undefined` if the given construct is not a repeat-loop
16
17
  */
17
18
  function tryNormalizeRepeat(data, [repeatToken, bodyToken]) {
18
- if (repeatToken.name !== "REPEAT" /* RawRType.Repeat */) {
19
+ if (repeatToken.name !== type_1.RawRType.Repeat) {
19
20
  parser_1.parseLog.debug('encountered non-repeat token for supposed repeat-loop structure');
20
21
  return undefined;
21
22
  }
22
23
  parser_1.parseLog.debug('trying to parse repeat-loop');
23
24
  const parseBody = (0, normalize_single_node_1.normalizeSingleNode)(data, bodyToken);
24
- (0, assert_1.guard)(parseBody.type !== "RDelimiter" /* RType.Delimiter */, () => `no body for repeat-loop ${JSON.stringify(repeatToken)} (${JSON.stringify(bodyToken)})`);
25
+ (0, assert_1.guard)(parseBody.type !== type_1.RType.Delimiter, () => `no body for repeat-loop ${JSON.stringify(repeatToken)} (${JSON.stringify(bodyToken)})`);
25
26
  const { location, content } = (0, normalize_meta_1.retrieveMetaStructure)(repeatToken.content);
26
27
  return {
27
- type: "RRepeatLoop" /* RType.RepeatLoop */,
28
+ type: type_1.RType.RepeatLoop,
28
29
  location,
29
30
  lexeme: content,
30
31
  body: (0, normalize_meta_1.ensureExpressionList)(parseBody),
@@ -35,5 +36,4 @@ function tryNormalizeRepeat(data, [repeatToken, bodyToken]) {
35
36
  }
36
37
  };
37
38
  }
38
- exports.tryNormalizeRepeat = tryNormalizeRepeat;
39
39
  //# sourceMappingURL=normalize-repeat.js.map
@@ -1,25 +1,26 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.tryNormalizeWhile = void 0;
3
+ exports.tryNormalizeWhile = tryNormalizeWhile;
4
4
  const input_format_1 = require("../../input-format");
5
5
  const parser_1 = require("../../../json/parser");
6
6
  const normalize_meta_1 = require("../../normalize-meta");
7
+ const type_1 = require("../../../../model/type");
7
8
  const normalize_single_node_1 = require("../structure/normalize-single-node");
8
9
  function tryNormalizeWhile(data, [whileToken, leftParen, condition, rightParen, body]) {
9
- if (whileToken.name !== "WHILE" /* RawRType.While */) {
10
+ if (whileToken.name !== type_1.RawRType.While) {
10
11
  parser_1.parseLog.debug('encountered non-while token for supposed while-loop structure');
11
12
  return undefined;
12
13
  }
13
- else if (leftParen.name !== "(" /* RawRType.ParenLeft */) {
14
+ else if (leftParen.name !== type_1.RawRType.ParenLeft) {
14
15
  throw new input_format_1.XmlParseError(`expected left-parenthesis for while but found ${JSON.stringify(leftParen)}`);
15
16
  }
16
- else if (rightParen.name !== ")" /* RawRType.ParenRight */) {
17
+ else if (rightParen.name !== type_1.RawRType.ParenRight) {
17
18
  throw new input_format_1.XmlParseError(`expected right-parenthesis for while but found ${JSON.stringify(rightParen)}`);
18
19
  }
19
20
  parser_1.parseLog.debug('trying to parse while-loop');
20
21
  const parsedCondition = (0, normalize_single_node_1.normalizeSingleNode)(data, condition);
21
22
  const parseBody = (0, normalize_single_node_1.normalizeSingleNode)(data, body);
22
- if (parsedCondition.type === "RDelimiter" /* RType.Delimiter */ || parseBody.type === "RDelimiter" /* RType.Delimiter */) {
23
+ if (parsedCondition.type === type_1.RType.Delimiter || parseBody.type === type_1.RType.Delimiter) {
23
24
  throw new input_format_1.XmlParseError(`unexpected under-sided while-loop, received ${JSON.stringify([
24
25
  parsedCondition,
25
26
  parseBody,
@@ -27,7 +28,7 @@ function tryNormalizeWhile(data, [whileToken, leftParen, condition, rightParen,
27
28
  }
28
29
  const { location, content } = (0, normalize_meta_1.retrieveMetaStructure)(whileToken.content);
29
30
  return {
30
- type: "RWhileLoop" /* RType.WhileLoop */,
31
+ type: type_1.RType.WhileLoop,
31
32
  condition: parsedCondition,
32
33
  body: (0, normalize_meta_1.ensureExpressionList)(parseBody),
33
34
  lexeme: content,
@@ -39,5 +40,4 @@ function tryNormalizeWhile(data, [whileToken, leftParen, condition, rightParen,
39
40
  }
40
41
  };
41
42
  }
42
- exports.tryNormalizeWhile = tryNormalizeWhile;
43
43
  //# sourceMappingURL=normalize-while.js.map
@@ -1,11 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.tryNormalizeAccess = void 0;
3
+ exports.tryNormalizeAccess = tryNormalizeAccess;
4
4
  const normalize_argument_1 = require("./functions/normalize-argument");
5
5
  const parser_1 = require("../../json/parser");
6
6
  const arrays_1 = require("../../../../../../util/arrays");
7
7
  const assert_1 = require("../../../../../../util/assert");
8
8
  const normalize_meta_1 = require("../normalize-meta");
9
+ const type_1 = require("../../../model/type");
9
10
  const normalize_single_node_1 = require("./structure/normalize-single-node");
10
11
  const r_function_call_1 = require("../../../model/nodes/r-function-call");
11
12
  const normalize_expressions_1 = require("./structure/normalize-expressions");
@@ -13,16 +14,16 @@ function normalizeAbstractArgument(x, data, operator) {
13
14
  if (x.length === 0) {
14
15
  return r_function_call_1.EmptyArgument;
15
16
  }
16
- else if (x.length !== 1 || x[0].name === "expr" /* RawRType.Expression */) {
17
+ else if (x.length !== 1 || x[0].name === type_1.RawRType.Expression) {
17
18
  const gotAccess = (0, normalize_argument_1.tryToNormalizeArgument)(data, x);
18
19
  (0, assert_1.guard)(gotAccess !== undefined, () => `expected one access result in access as argument, yet received ${JSON.stringify(gotAccess)} for ${JSON.stringify([operator, x])}`);
19
20
  return gotAccess;
20
21
  }
21
22
  else {
22
23
  const node = (0, normalize_single_node_1.normalizeSingleNode)(data, x[0]);
23
- (0, assert_1.guard)(node.type !== "RExpressionList" /* RType.ExpressionList */, () => `expected expression list to be parsed as argument, yet received ${JSON.stringify(node)} for ${JSON.stringify(x)}`);
24
+ (0, assert_1.guard)(node.type !== type_1.RType.ExpressionList, () => `expected expression list to be parsed as argument, yet received ${JSON.stringify(node)} for ${JSON.stringify(x)}`);
24
25
  return {
25
- type: "RArgument" /* RType.Argument */,
26
+ type: type_1.RType.Argument,
26
27
  location: node.location,
27
28
  lexeme: node.lexeme,
28
29
  name: undefined,
@@ -53,17 +54,17 @@ function tryNormalizeAccess(data, mappedWithName) {
53
54
  let operator;
54
55
  let closingLength = 0;
55
56
  switch (accessOp.name) {
56
- case "[" /* RawRType.BracketLeft */:
57
+ case type_1.RawRType.BracketLeft:
57
58
  operator = '[';
58
59
  closingLength = 1;
59
60
  break;
60
- case "$" /* RawRType.Dollar */:
61
+ case type_1.RawRType.Dollar:
61
62
  operator = '$';
62
63
  break;
63
- case "@" /* RawRType.At */:
64
+ case type_1.RawRType.At:
64
65
  operator = '@';
65
66
  break;
66
- case "LBB" /* RawRType.DoubleBracketLeft */:
67
+ case type_1.RawRType.DoubleBracketLeft:
67
68
  operator = '[[';
68
69
  closingLength = 2;
69
70
  break;
@@ -72,7 +73,7 @@ function tryNormalizeAccess(data, mappedWithName) {
72
73
  return undefined;
73
74
  }
74
75
  const accessed = mappedWithName[0];
75
- if (accessed.name !== "expr" /* RawRType.Expression */ && accessed.name !== "expr_or_assign_or_help" /* RawRType.ExprOfAssignOrHelp */ && accessed.name !== "equal_assign" /* RawRType.LegacyEqualAssign */) {
76
+ if (accessed.name !== type_1.RawRType.Expression && accessed.name !== type_1.RawRType.ExprOfAssignOrHelp && accessed.name !== type_1.RawRType.LegacyEqualAssign) {
76
77
  parser_1.parseLog.trace(`expected accessed element to be wrapped an expression, yet received ${accessed.name}`);
77
78
  return undefined;
78
79
  }
@@ -83,13 +84,13 @@ function tryNormalizeAccess(data, mappedWithName) {
83
84
  }
84
85
  const remaining = mappedWithName.slice(2, mappedWithName.length - closingLength);
85
86
  parser_1.parseLog.trace(`${remaining.length} remaining arguments for access`);
86
- const splitAccessOnComma = (0, arrays_1.splitArrayOn)(remaining, x => x.name === "," /* RawRType.Comma */);
87
+ const splitAccessOnComma = (0, arrays_1.splitArrayOn)(remaining, x => x.name === type_1.RawRType.Comma);
87
88
  const parsedAccess = splitAccessOnComma.map(x => {
88
89
  return normalizeAbstractArgument(x, data, operator);
89
90
  });
90
91
  const { content, location } = (0, normalize_meta_1.retrieveMetaStructure)(accessOp.content);
91
92
  return {
92
- type: "RAccess" /* RType.Access */,
93
+ type: type_1.RType.Access,
93
94
  location,
94
95
  lexeme: content,
95
96
  accessed: parsedAccessed[0],
@@ -102,5 +103,4 @@ function tryNormalizeAccess(data, mappedWithName) {
102
103
  }
103
104
  };
104
105
  }
105
- exports.tryNormalizeAccess = tryNormalizeAccess;
106
106
  //# sourceMappingURL=normalize-access.js.map
@@ -1,12 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.tryNormalizeBinary = void 0;
3
+ exports.tryNormalizeBinary = tryNormalizeBinary;
4
4
  const input_format_1 = require("../../input-format");
5
5
  const parser_1 = require("../../../json/parser");
6
6
  const normalize_meta_1 = require("../../normalize-meta");
7
7
  const assert_1 = require("../../../../../../../util/assert");
8
8
  const log_1 = require("../../../../../../../util/log");
9
9
  const strings_1 = require("../../../../../../../util/strings");
10
+ const type_1 = require("../../../../model/type");
10
11
  const operators_1 = require("../../../../model/operators");
11
12
  const normalize_single_node_1 = require("../structure/normalize-single-node");
12
13
  /**
@@ -15,36 +16,35 @@ const normalize_single_node_1 = require("../structure/normalize-single-node");
15
16
  */
16
17
  function tryNormalizeBinary(data, [lhs, operator, rhs]) {
17
18
  (0, log_1.expensiveTrace)(parser_1.parseLog, () => `binary op for ${lhs.name} [${operator.name}] ${rhs.name}`);
18
- if (operator.name === "SPECIAL" /* RawRType.Special */ || operators_1.OperatorsInRAst.has(operator.name) || operator.name === "PIPE" /* RawRType.Pipe */) {
19
+ if (operator.name === type_1.RawRType.Special || operators_1.OperatorsInRAst.has(operator.name) || operator.name === type_1.RawRType.Pipe) {
19
20
  return parseBinaryOp(data, lhs, operator, rhs);
20
21
  }
21
22
  else {
22
23
  return undefined;
23
24
  }
24
25
  }
25
- exports.tryNormalizeBinary = tryNormalizeBinary;
26
26
  function parseBinaryOp(data, lhs, operator, rhs) {
27
27
  (0, normalize_meta_1.ensureChildrenAreLhsAndRhsOrdered)(lhs.content, rhs.content);
28
28
  const parsedLhs = (0, normalize_single_node_1.normalizeSingleNode)(data, lhs);
29
29
  const parsedRhs = (0, normalize_single_node_1.normalizeSingleNode)(data, rhs);
30
- if (parsedLhs.type === "RDelimiter" /* RType.Delimiter */ || parsedRhs.type === "RDelimiter" /* RType.Delimiter */) {
30
+ if (parsedLhs.type === type_1.RType.Delimiter || parsedRhs.type === type_1.RType.Delimiter) {
31
31
  throw new input_format_1.XmlParseError(`unexpected under-sided binary op, received ${JSON.stringify([parsedLhs, parsedRhs])} for ${JSON.stringify([lhs, operator, rhs])}`);
32
32
  }
33
33
  const operationName = (0, normalize_meta_1.retrieveOpName)(operator);
34
34
  const { location, content } = (0, normalize_meta_1.retrieveMetaStructure)(operator.content);
35
35
  if ((0, strings_1.startAndEndsWith)(operationName, '%')) {
36
- const lhsLoc = parsedLhs.type === "RExpressionList" /* RType.ExpressionList */ ? parsedLhs.grouping?.[0].location : parsedLhs.location;
37
- const rhsLoc = parsedRhs.type === "RExpressionList" /* RType.ExpressionList */ ? parsedRhs.grouping?.[0].location : parsedRhs.location;
36
+ const lhsLoc = parsedLhs.type === type_1.RType.ExpressionList ? parsedLhs.grouping?.[0].location : parsedLhs.location;
37
+ const rhsLoc = parsedRhs.type === type_1.RType.ExpressionList ? parsedRhs.grouping?.[0].location : parsedRhs.location;
38
38
  (0, assert_1.guard)(lhsLoc !== undefined && rhsLoc !== undefined, () => `special op lhs and rhs must have a locations, but ${JSON.stringify(parsedLhs)} || ${JSON.stringify(lhsLoc)} and ${JSON.stringify(parsedRhs)} || || ${JSON.stringify(rhsLoc)})`);
39
39
  // parse as infix function call!
40
40
  return {
41
- type: "RFunctionCall" /* RType.FunctionCall */,
41
+ type: type_1.RType.FunctionCall,
42
42
  named: true,
43
43
  infixSpecial: true,
44
44
  lexeme: data.currentLexeme ?? content,
45
45
  location,
46
46
  functionName: {
47
- type: "RSymbol" /* RType.Symbol */,
47
+ type: type_1.RType.Symbol,
48
48
  location,
49
49
  lexeme: content,
50
50
  content,
@@ -53,7 +53,7 @@ function parseBinaryOp(data, lhs, operator, rhs) {
53
53
  },
54
54
  arguments: [
55
55
  {
56
- type: "RArgument" /* RType.Argument */,
56
+ type: type_1.RType.Argument,
57
57
  location: lhsLoc,
58
58
  value: parsedLhs,
59
59
  name: undefined,
@@ -61,7 +61,7 @@ function parseBinaryOp(data, lhs, operator, rhs) {
61
61
  info: {}
62
62
  },
63
63
  {
64
- type: "RArgument" /* RType.Argument */,
64
+ type: type_1.RType.Argument,
65
65
  location: rhsLoc,
66
66
  value: parsedRhs,
67
67
  name: undefined,
@@ -72,14 +72,14 @@ function parseBinaryOp(data, lhs, operator, rhs) {
72
72
  info: {}
73
73
  };
74
74
  }
75
- else if (operator.name === "PIPE" /* RawRType.Pipe */) {
75
+ else if (operator.name === type_1.RawRType.Pipe) {
76
76
  (0, assert_1.guard)(parsedLhs.location !== undefined, () => `pipe lhs must have a location, but ${JSON.stringify(parsedLhs)})`);
77
77
  (0, assert_1.guard)(parsedLhs.lexeme !== undefined, () => `pipe lhs must have a full lexeme, but ${JSON.stringify(parsedLhs)})`);
78
78
  return {
79
- type: "RPipe" /* RType.Pipe */,
79
+ type: type_1.RType.Pipe,
80
80
  location,
81
81
  lhs: {
82
- type: "RArgument" /* RType.Argument */,
82
+ type: type_1.RType.Argument,
83
83
  location: parsedLhs.location,
84
84
  value: parsedLhs,
85
85
  name: undefined,
@@ -97,7 +97,7 @@ function parseBinaryOp(data, lhs, operator, rhs) {
97
97
  }
98
98
  else {
99
99
  return {
100
- type: "RBinaryOp" /* RType.BinaryOp */,
100
+ type: type_1.RType.BinaryOp,
101
101
  location,
102
102
  lhs: parsedLhs,
103
103
  rhs: parsedRhs,
@@ -1,12 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.tryNormalizeUnary = void 0;
3
+ exports.tryNormalizeUnary = tryNormalizeUnary;
4
4
  const parser_1 = require("../../../json/parser");
5
5
  const normalize_meta_1 = require("../../normalize-meta");
6
6
  const assert_1 = require("../../../../../../../util/assert");
7
7
  const log_1 = require("../../../../../../../util/log");
8
8
  const operators_1 = require("../../../../model/operators");
9
9
  const normalize_single_node_1 = require("../structure/normalize-single-node");
10
+ const type_1 = require("../../../../model/type");
10
11
  /**
11
12
  * Parses the construct as a {@link RUnaryOp}.
12
13
  *
@@ -25,14 +26,13 @@ function tryNormalizeUnary(data, [operator, operand]) {
25
26
  return undefined;
26
27
  }
27
28
  }
28
- exports.tryNormalizeUnary = tryNormalizeUnary;
29
29
  function parseUnaryOp(data, operator, operand) {
30
30
  const parsedOperand = (0, normalize_single_node_1.normalizeSingleNode)(data, operand);
31
- (0, assert_1.guard)(parsedOperand.type !== "RDelimiter" /* RType.Delimiter */, 'unexpected under-sided unary op');
31
+ (0, assert_1.guard)(parsedOperand.type !== type_1.RType.Delimiter, 'unexpected under-sided unary op');
32
32
  const operationName = (0, normalize_meta_1.retrieveOpName)(operator);
33
33
  const { location, content } = (0, normalize_meta_1.retrieveMetaStructure)(operator.content);
34
34
  return {
35
- type: "RUnaryOp" /* RType.UnaryOp */,
35
+ type: type_1.RType.UnaryOp,
36
36
  location,
37
37
  operator: operationName,
38
38
  lexeme: content,
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.normalizeComment = void 0;
3
+ exports.normalizeComment = normalizeComment;
4
4
  const normalize_meta_1 = require("../../normalize-meta");
5
5
  const assert_1 = require("../../../../../../../util/assert");
6
+ const type_1 = require("../../../../model/type");
6
7
  /**
7
8
  * Normalize the given object as an R comment.
8
9
  * This requires you to check the corresponding name beforehand.
@@ -14,7 +15,7 @@ function normalizeComment(data, obj) {
14
15
  const { location, content } = (0, normalize_meta_1.retrieveMetaStructure)(obj);
15
16
  (0, assert_1.guard)(content.startsWith('#'), 'comment must start with #');
16
17
  return {
17
- type: "RComment" /* RType.Comment */,
18
+ type: type_1.RType.Comment,
18
19
  location,
19
20
  content: content.slice(1),
20
21
  lexeme: content,
@@ -25,5 +26,4 @@ function normalizeComment(data, obj) {
25
26
  }
26
27
  };
27
28
  }
28
- exports.normalizeComment = normalizeComment;
29
29
  //# sourceMappingURL=normalize-comment.js.map
@@ -1,9 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.normalizeLineDirective = void 0;
3
+ exports.normalizeLineDirective = normalizeLineDirective;
4
4
  const parser_1 = require("../../../json/parser");
5
5
  const normalize_meta_1 = require("../../normalize-meta");
6
6
  const assert_1 = require("../../../../../../../util/assert");
7
+ const type_1 = require("../../../../model/type");
7
8
  const LineDirectiveRegex = /^#line\s+(\d+)\s+"([^"]+)"\s*$/;
8
9
  /**
9
10
  * Normalize the given object as an R line directive (`#line <number> "<file>"`).
@@ -20,7 +21,7 @@ function normalizeLineDirective(data, obj) {
20
21
  if (match === null) {
21
22
  parser_1.parseLog.debug(`[line-directive] does not match the regex ${LineDirectiveRegex.source} given ${JSON.stringify(content)}`);
22
23
  return {
23
- type: "RComment" /* RType.Comment */,
24
+ type: type_1.RType.Comment,
24
25
  location,
25
26
  lexeme: content,
26
27
  info: {
@@ -33,7 +34,7 @@ function normalizeLineDirective(data, obj) {
33
34
  }
34
35
  else {
35
36
  return {
36
- type: "RLineDirective" /* RType.LineDirective */,
37
+ type: type_1.RType.LineDirective,
37
38
  location,
38
39
  line: parseInt(match[1]),
39
40
  file: match[2],
@@ -46,5 +47,4 @@ function normalizeLineDirective(data, obj) {
46
47
  };
47
48
  }
48
49
  }
49
- exports.normalizeLineDirective = normalizeLineDirective;
50
50
  //# sourceMappingURL=normalize-line-directive.js.map
@@ -1,15 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.normalizeDelimiter = void 0;
3
+ exports.normalizeDelimiter = normalizeDelimiter;
4
4
  const normalize_meta_1 = require("../../normalize-meta");
5
+ const type_1 = require("../../../../model/type");
5
6
  function normalizeDelimiter(elem) {
6
7
  const { location, content } = (0, normalize_meta_1.retrieveMetaStructure)(elem.content);
7
8
  return {
8
- type: "RDelimiter" /* RType.Delimiter */,
9
+ type: type_1.RType.Delimiter,
9
10
  location,
10
11
  lexeme: content,
11
12
  subtype: elem.name
12
13
  };
13
14
  }
14
- exports.normalizeDelimiter = normalizeDelimiter;
15
15
  //# sourceMappingURL=normalize-delimiter.js.map