@eagleoutice/flowr 1.3.13 → 1.4.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 (221) hide show
  1. package/abstract-interpretation/domain.d.ts +27 -0
  2. package/abstract-interpretation/domain.js +146 -0
  3. package/abstract-interpretation/handler/binop/binop.d.ts +16 -0
  4. package/abstract-interpretation/handler/binop/binop.js +40 -0
  5. package/abstract-interpretation/handler/binop/operators.d.ts +2 -0
  6. package/abstract-interpretation/handler/binop/operators.js +42 -0
  7. package/abstract-interpretation/handler/handler.d.ts +6 -0
  8. package/abstract-interpretation/handler/handler.js +3 -0
  9. package/abstract-interpretation/processor.d.ts +10 -0
  10. package/abstract-interpretation/processor.js +78 -0
  11. package/benchmark/slicer.d.ts +6 -5
  12. package/benchmark/slicer.js +2 -0
  13. package/benchmark/stats/print.d.ts +1 -1
  14. package/benchmark/stats/stats.d.ts +4 -4
  15. package/benchmark/stats/stats.js +1 -1
  16. package/cli/common/features.d.ts +1 -1
  17. package/cli/common/options.d.ts +1 -1
  18. package/cli/common/script.d.ts +1 -1
  19. package/cli/common/scripts-info.d.ts +2 -2
  20. package/cli/repl/commands/cfg.d.ts +1 -1
  21. package/cli/repl/commands/cfg.js +1 -1
  22. package/cli/repl/commands/commands.d.ts +1 -1
  23. package/cli/repl/commands/dataflow.d.ts +1 -1
  24. package/cli/repl/commands/execute.d.ts +2 -2
  25. package/cli/repl/commands/main.d.ts +2 -2
  26. package/cli/repl/commands/normalize.d.ts +1 -1
  27. package/cli/repl/commands/parse.d.ts +1 -1
  28. package/cli/repl/commands/quit.d.ts +1 -1
  29. package/cli/repl/commands/version.d.ts +1 -1
  30. package/cli/repl/core.d.ts +3 -5
  31. package/cli/repl/core.js +33 -6
  32. package/cli/repl/execute.d.ts +1 -1
  33. package/cli/repl/server/connection.d.ts +2 -2
  34. package/cli/repl/server/connection.js +3 -2
  35. package/cli/repl/server/messages/analysis.d.ts +3 -3
  36. package/cli/repl/server/messages/error.d.ts +1 -1
  37. package/cli/repl/server/messages/hello.d.ts +2 -2
  38. package/cli/repl/server/messages/messages.d.ts +6 -6
  39. package/cli/repl/server/messages/messages.js +26 -6
  40. package/cli/repl/server/messages/repl.d.ts +1 -1
  41. package/cli/repl/server/messages/repl.js +28 -8
  42. package/cli/repl/server/messages/slice.d.ts +3 -3
  43. package/cli/repl/server/messages/slice.js +28 -8
  44. package/cli/repl/server/net.d.ts +16 -0
  45. package/cli/repl/server/net.js +40 -1
  46. package/cli/repl/server/send.d.ts +2 -2
  47. package/cli/repl/server/server.d.ts +2 -2
  48. package/cli/repl/server/validate.d.ts +3 -3
  49. package/cli/statistics-helper-app.js +2 -2
  50. package/core/input.d.ts +6 -6
  51. package/core/output.d.ts +3 -2
  52. package/core/print/dataflow-printer.d.ts +3 -3
  53. package/core/print/normalize-printer.d.ts +2 -2
  54. package/core/print/parse-printer.d.ts +2 -2
  55. package/core/print/print.d.ts +1 -1
  56. package/core/print/slice-diff-ansi.d.ts +1 -1
  57. package/core/slicer.d.ts +5 -4
  58. package/core/slicer.js +6 -2
  59. package/core/steps.d.ts +22 -4
  60. package/core/steps.js +10 -2
  61. package/dataflow/environments/append.d.ts +1 -1
  62. package/dataflow/environments/environment.d.ts +4 -4
  63. package/dataflow/environments/overwrite.d.ts +1 -1
  64. package/dataflow/environments/register.d.ts +2 -2
  65. package/dataflow/environments/resolve-by-name.d.ts +2 -2
  66. package/dataflow/environments/scoping.d.ts +1 -1
  67. package/dataflow/extractor.d.ts +4 -4
  68. package/dataflow/graph/diff.d.ts +3 -3
  69. package/dataflow/graph/graph.d.ts +8 -7
  70. package/dataflow/graph/quads.d.ts +2 -2
  71. package/dataflow/graph/vertex.d.ts +5 -5
  72. package/dataflow/internal/info.d.ts +2 -2
  73. package/dataflow/internal/linker.d.ts +3 -3
  74. package/dataflow/internal/process/access.d.ts +3 -3
  75. package/dataflow/internal/process/expression-list.d.ts +3 -3
  76. package/dataflow/internal/process/expression-list.js +0 -4
  77. package/dataflow/internal/process/functions/argument.d.ts +4 -4
  78. package/dataflow/internal/process/functions/exit-points.d.ts +1 -1
  79. package/dataflow/internal/process/functions/function-call.d.ts +3 -3
  80. package/dataflow/internal/process/functions/function-definition.d.ts +3 -3
  81. package/dataflow/internal/process/functions/parameter.d.ts +3 -3
  82. package/dataflow/internal/process/if-then-else.d.ts +3 -3
  83. package/dataflow/internal/process/loops/for-loop.d.ts +3 -3
  84. package/dataflow/internal/process/loops/repeat-loop.d.ts +3 -3
  85. package/dataflow/internal/process/loops/while-loop.d.ts +3 -3
  86. package/dataflow/internal/process/operators/assignment.d.ts +3 -3
  87. package/dataflow/internal/process/operators/non-assignment-binary-op.d.ts +3 -3
  88. package/dataflow/internal/process/operators/pipe.d.ts +3 -3
  89. package/dataflow/internal/process/operators/unary-op.d.ts +3 -3
  90. package/dataflow/internal/process/symbol.d.ts +3 -3
  91. package/dataflow/internal/process/uninteresting-leaf.d.ts +2 -2
  92. package/dataflow/processor.d.ts +3 -3
  93. package/flowr.d.ts +3 -2
  94. package/flowr.js +5 -3
  95. package/package.json +11 -2
  96. package/r-bridge/lang-4.x/ast/model/collect.d.ts +2 -2
  97. package/r-bridge/lang-4.x/ast/model/model.d.ts +6 -6
  98. package/r-bridge/lang-4.x/ast/model/nodes/info/index.d.ts +2 -2
  99. package/r-bridge/lang-4.x/ast/model/nodes/info/r-delimiter.d.ts +3 -3
  100. package/r-bridge/lang-4.x/ast/model/nodes/r-access.d.ts +3 -3
  101. package/r-bridge/lang-4.x/ast/model/nodes/r-argument.d.ts +3 -3
  102. package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.d.ts +3 -3
  103. package/r-bridge/lang-4.x/ast/model/nodes/r-break.d.ts +2 -2
  104. package/r-bridge/lang-4.x/ast/model/nodes/r-comment.d.ts +2 -2
  105. package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.d.ts +2 -2
  106. package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.d.ts +4 -4
  107. package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.d.ts +4 -4
  108. package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.d.ts +4 -4
  109. package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.d.ts +3 -3
  110. package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.d.ts +2 -2
  111. package/r-bridge/lang-4.x/ast/model/nodes/r-logical.d.ts +2 -2
  112. package/r-bridge/lang-4.x/ast/model/nodes/r-next.d.ts +2 -2
  113. package/r-bridge/lang-4.x/ast/model/nodes/r-number.d.ts +3 -3
  114. package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.d.ts +3 -3
  115. package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.d.ts +2 -2
  116. package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.d.ts +3 -3
  117. package/r-bridge/lang-4.x/ast/model/nodes/r-string.d.ts +3 -3
  118. package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.d.ts +2 -2
  119. package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.d.ts +3 -3
  120. package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.d.ts +3 -3
  121. package/r-bridge/lang-4.x/ast/model/operators.d.ts +1 -1
  122. package/r-bridge/lang-4.x/ast/model/processing/decorate.d.ts +2 -2
  123. package/r-bridge/lang-4.x/ast/model/processing/fold.d.ts +3 -3
  124. package/r-bridge/lang-4.x/ast/model/processing/role.d.ts +1 -1
  125. package/r-bridge/lang-4.x/ast/model/processing/stateful-fold.d.ts +3 -3
  126. package/r-bridge/lang-4.x/ast/model/processing/visitor.d.ts +1 -1
  127. package/r-bridge/lang-4.x/ast/parser/xml/config.d.ts +2 -2
  128. package/r-bridge/lang-4.x/ast/parser/xml/data.d.ts +5 -5
  129. package/r-bridge/lang-4.x/ast/parser/xml/hooks.d.ts +5 -5
  130. package/r-bridge/lang-4.x/ast/parser/xml/input-format.d.ts +1 -1
  131. package/r-bridge/lang-4.x/ast/parser/xml/internal/access.d.ts +3 -3
  132. package/r-bridge/lang-4.x/ast/parser/xml/internal/control/if-then-else.d.ts +3 -3
  133. package/r-bridge/lang-4.x/ast/parser/xml/internal/control/if-then.d.ts +3 -3
  134. package/r-bridge/lang-4.x/ast/parser/xml/internal/expression/expression.d.ts +3 -3
  135. package/r-bridge/lang-4.x/ast/parser/xml/internal/functions/argument.d.ts +3 -3
  136. package/r-bridge/lang-4.x/ast/parser/xml/internal/functions/call.d.ts +3 -3
  137. package/r-bridge/lang-4.x/ast/parser/xml/internal/functions/definition.d.ts +3 -3
  138. package/r-bridge/lang-4.x/ast/parser/xml/internal/functions/parameter.d.ts +3 -3
  139. package/r-bridge/lang-4.x/ast/parser/xml/internal/loops/break.d.ts +3 -3
  140. package/r-bridge/lang-4.x/ast/parser/xml/internal/loops/for.d.ts +3 -3
  141. package/r-bridge/lang-4.x/ast/parser/xml/internal/loops/next.d.ts +3 -3
  142. package/r-bridge/lang-4.x/ast/parser/xml/internal/loops/repeat.d.ts +3 -3
  143. package/r-bridge/lang-4.x/ast/parser/xml/internal/loops/while.d.ts +3 -3
  144. package/r-bridge/lang-4.x/ast/parser/xml/internal/meta.d.ts +4 -4
  145. package/r-bridge/lang-4.x/ast/parser/xml/internal/operators/binary.d.ts +3 -3
  146. package/r-bridge/lang-4.x/ast/parser/xml/internal/operators/special.d.ts +1 -1
  147. package/r-bridge/lang-4.x/ast/parser/xml/internal/operators/unary.d.ts +3 -3
  148. package/r-bridge/lang-4.x/ast/parser/xml/internal/other/comment.d.ts +3 -3
  149. package/r-bridge/lang-4.x/ast/parser/xml/internal/other/line-directive.d.ts +3 -3
  150. package/r-bridge/lang-4.x/ast/parser/xml/internal/structure/elements.d.ts +4 -4
  151. package/r-bridge/lang-4.x/ast/parser/xml/internal/structure/root.d.ts +3 -3
  152. package/r-bridge/lang-4.x/ast/parser/xml/internal/structure/single-element.d.ts +4 -4
  153. package/r-bridge/lang-4.x/ast/parser/xml/internal/values/number.d.ts +4 -4
  154. package/r-bridge/lang-4.x/ast/parser/xml/internal/values/string.d.ts +3 -3
  155. package/r-bridge/lang-4.x/ast/parser/xml/internal/values/symbol.d.ts +3 -3
  156. package/r-bridge/lang-4.x/ast/parser/xml/internal/xml-to-json.d.ts +2 -2
  157. package/r-bridge/lang-4.x/ast/parser/xml/parser.d.ts +4 -4
  158. package/r-bridge/retriever.d.ts +2 -2
  159. package/r-bridge/shell-executor.d.ts +25 -0
  160. package/r-bridge/shell-executor.js +119 -0
  161. package/r-bridge/shell.d.ts +8 -5
  162. package/r-bridge/shell.js +6 -3
  163. package/reconstruct/reconstruct.d.ts +1 -1
  164. package/slicing/criterion/collect-all.d.ts +3 -3
  165. package/slicing/criterion/filters/all-variables.d.ts +1 -1
  166. package/slicing/criterion/parse.d.ts +1 -1
  167. package/slicing/static/static-slicer.d.ts +3 -3
  168. package/statistics/features/common-syntax-probability.d.ts +3 -2
  169. package/statistics/features/common-syntax-probability.js +0 -3
  170. package/statistics/features/feature.d.ts +6 -6
  171. package/statistics/features/post-processing.d.ts +2 -2
  172. package/statistics/features/supported/assignments/assignments.d.ts +2 -2
  173. package/statistics/features/supported/assignments/post-process.d.ts +2 -2
  174. package/statistics/features/supported/comments/comments.d.ts +2 -2
  175. package/statistics/features/supported/comments/post-process.d.ts +2 -2
  176. package/statistics/features/supported/control-flow/control-flow.d.ts +2 -2
  177. package/statistics/features/supported/control-flow/post-process.d.ts +2 -2
  178. package/statistics/features/supported/data-access/data-access.d.ts +3 -3
  179. package/statistics/features/supported/data-access/post-process.d.ts +2 -2
  180. package/statistics/features/supported/defined-functions/defined-functions.d.ts +4 -4
  181. package/statistics/features/supported/defined-functions/post-process.d.ts +2 -2
  182. package/statistics/features/supported/expression-list/expression-list.d.ts +2 -2
  183. package/statistics/features/supported/expression-list/post-process.d.ts +2 -2
  184. package/statistics/features/supported/loops/loops.d.ts +2 -2
  185. package/statistics/features/supported/loops/post-process.d.ts +2 -2
  186. package/statistics/features/supported/used-functions/post-process.d.ts +2 -2
  187. package/statistics/features/supported/used-functions/used-functions.d.ts +3 -3
  188. package/statistics/features/supported/used-packages/post-process.d.ts +2 -2
  189. package/statistics/features/supported/used-packages/used-packages.d.ts +2 -2
  190. package/statistics/features/supported/values/post-process.d.ts +2 -2
  191. package/statistics/features/supported/values/values.d.ts +2 -2
  192. package/statistics/features/supported/variables/post-process.d.ts +3 -3
  193. package/statistics/features/supported/variables/variables.d.ts +2 -2
  194. package/statistics/meta-statistics.d.ts +1 -1
  195. package/statistics/output/print-stats.d.ts +2 -2
  196. package/statistics/output/statistics-file.d.ts +1 -1
  197. package/statistics/statistics.d.ts +4 -4
  198. package/util/{cfg.d.ts → cfg/cfg.d.ts} +18 -6
  199. package/util/{cfg.js → cfg/cfg.js} +42 -37
  200. package/util/cfg/visitor.d.ts +14 -0
  201. package/util/cfg/visitor.js +64 -0
  202. package/util/diff.d.ts +1 -1
  203. package/util/files.d.ts +1 -1
  204. package/util/mermaid/ast.d.ts +1 -1
  205. package/util/mermaid/cfg.d.ts +2 -2
  206. package/util/mermaid/dfg.d.ts +3 -3
  207. package/util/objects.d.ts +1 -1
  208. package/util/quads.d.ts +2 -2
  209. package/util/summarizer/benchmark/data.d.ts +1 -1
  210. package/util/summarizer/benchmark/first-phase/process.d.ts +3 -3
  211. package/util/summarizer/benchmark/second-phase/graph.d.ts +1 -1
  212. package/util/summarizer/benchmark/second-phase/process.d.ts +1 -1
  213. package/util/summarizer/benchmark/summarizer.d.ts +3 -2
  214. package/util/summarizer/benchmark/summarizer.js +0 -4
  215. package/util/summarizer/statistics/post-process/clusterer.d.ts +2 -2
  216. package/util/summarizer/statistics/post-process/file-based-count.d.ts +1 -1
  217. package/util/summarizer/statistics/post-process/histogram.d.ts +2 -2
  218. package/util/summarizer/statistics/post-process/post-process-output.d.ts +2 -2
  219. package/util/summarizer/statistics/second-phase/process.d.ts +2 -2
  220. package/util/summarizer/statistics/summarizer.d.ts +3 -2
  221. package/util/summarizer/summarizer.d.ts +1 -1
@@ -1,6 +1,6 @@
1
- import { Base, Location, NoInfo, RNode } from '../model';
2
- import { RType } from '../type';
3
- import { RSymbol } from './r-symbol';
1
+ import type { Base, Location, NoInfo, RNode } from '../model';
2
+ import type { RType } from '../type';
3
+ import type { RSymbol } from './r-symbol';
4
4
  /**
5
5
  * Represents a parameter of a function definition in R.
6
6
  */
@@ -1,5 +1,5 @@
1
- import { Base, Location, NoInfo, RNode } from '../model';
2
- import { RType } from '../type';
1
+ import type { Base, Location, NoInfo, RNode } from '../model';
2
+ import type { RType } from '../type';
3
3
  export interface RPipe<Info = NoInfo> extends Base<Info>, Location {
4
4
  readonly type: RType.Pipe;
5
5
  readonly lhs: RNode<Info>;
@@ -1,6 +1,6 @@
1
- import { Base, Location, NoInfo } from '../model';
2
- import { RType } from '../type';
3
- import { RExpressionList } from './r-expression-list';
1
+ import type { Base, Location, NoInfo } from '../model';
2
+ import type { RType } from '../type';
3
+ import type { RExpressionList } from './r-expression-list';
4
4
  /**
5
5
  * ```ts
6
6
  * repeat <body>
@@ -1,6 +1,6 @@
1
- import { Leaf, Location, NoInfo } from '../model';
2
- import { RType } from '../type';
3
- import { RStringValue } from '../../../values';
1
+ import type { Leaf, Location, NoInfo } from '../model';
2
+ import type { RType } from '../type';
3
+ import type { RStringValue } from '../../../values';
4
4
  export interface RString<Info = NoInfo> extends Leaf<Info>, Location {
5
5
  readonly type: RType.String;
6
6
  content: RStringValue;
@@ -1,5 +1,5 @@
1
- import { Leaf, Location, Namespace, NoInfo } from '../model';
2
- import { RType } from '../type';
1
+ import type { Leaf, Location, Namespace, NoInfo } from '../model';
2
+ import type { RType } from '../type';
3
3
  export declare function isSpecialSymbol(symbol: RSymbol): boolean;
4
4
  export interface RSymbol<Info = NoInfo, T extends string = string> extends Leaf<Info>, Namespace, Location {
5
5
  readonly type: RType.Symbol;
@@ -1,6 +1,6 @@
1
- import { Base, Location, NoInfo, RNode } from '../model';
2
- import { RType } from '../type';
3
- import { UnaryOperatorFlavor } from '../operators';
1
+ import type { Base, Location, NoInfo, RNode } from '../model';
2
+ import type { RType } from '../type';
3
+ import type { UnaryOperatorFlavor } from '../operators';
4
4
  export interface RUnaryOp<Info = NoInfo> extends Base<Info>, Location {
5
5
  readonly type: RType.UnaryOp;
6
6
  readonly flavor: UnaryOperatorFlavor;
@@ -1,6 +1,6 @@
1
- import { Base, Location, NoInfo, RNode } from '../model';
2
- import { RType } from '../type';
3
- import { RExpressionList } from './r-expression-list';
1
+ import type { Base, Location, NoInfo, RNode } from '../model';
2
+ import type { RType } from '../type';
3
+ import type { RExpressionList } from './r-expression-list';
4
4
  /**
5
5
  * ```ts
6
6
  * while ( <condition> ) <body>
@@ -1,4 +1,4 @@
1
- import { MergeableRecord } from '../../../../util/objects';
1
+ import type { MergeableRecord } from '../../../../util/objects';
2
2
  import { RawRType } from './type';
3
3
  /**
4
4
  * Just a type-alias so that type declarations become more readable.
@@ -8,9 +8,9 @@
8
8
  *
9
9
  * @module
10
10
  */
11
- import { NoInfo, RNode } from '../model';
11
+ import type { NoInfo, RNode } from '../model';
12
12
  import { BiMap } from '../../../../../util/bimap';
13
- import { MergeableRecord } from '../../../../../util/objects';
13
+ import type { MergeableRecord } from '../../../../../util/objects';
14
14
  import { RoleInParent } from './role';
15
15
  /** The type of the id assigned to each node. Branded to avoid problematic usages with other string types. */
16
16
  export type NodeId = string & {
@@ -1,6 +1,6 @@
1
- import { DeepReadonly } from 'ts-essentials';
2
- import { RNode } from '../model';
3
- import { StatefulFoldFunctions } from './stateful-fold';
1
+ import type { DeepReadonly } from 'ts-essentials';
2
+ import type { RNode } from '../model';
3
+ import type { StatefulFoldFunctions } from './stateful-fold';
4
4
  export type FoldFunctions<Info, Out> = Omit<StatefulFoldFunctions<Info, undefined, Out>, 'down'>;
5
5
  /**
6
6
  * Folds in old functional-fashion over the AST structure.
@@ -1,4 +1,4 @@
1
- import { DecoratedAstMap, RNodeWithParent } from './decorate';
1
+ import type { DecoratedAstMap, RNodeWithParent } from './decorate';
2
2
  /**
3
3
  * Describes the role of the node in its parent. For example,
4
4
  * if we have `if(TRUE) { ... }`, the role of the `TRUE` node is `IfCondition`.
@@ -1,6 +1,6 @@
1
- import { DeepReadonly } from 'ts-essentials';
2
- import { RExpressionList, RNumber, RSymbol, RLogical, RString, RArithmeticBinaryOp, RAssignmentOp, RComparisonBinaryOp, RLogicalBinaryOp, RArithmeticUnaryOp, RLogicalUnaryOp, RIfThenElse, RForLoop, RRepeatLoop, RWhileLoop, RFunctionCall, RComment, RNext, RBreak, RParameter, RArgument, RFunctionDefinition, RAccess, RModelFormulaBinaryOp, RModelFormulaUnaryOp, RLineDirective, RPipe } from '../nodes';
3
- import { RNode } from '../model';
1
+ import type { DeepReadonly } from 'ts-essentials';
2
+ import type { RExpressionList, RNumber, RSymbol, RLogical, RString, RArithmeticBinaryOp, RAssignmentOp, RComparisonBinaryOp, RLogicalBinaryOp, RArithmeticUnaryOp, RLogicalUnaryOp, RIfThenElse, RForLoop, RRepeatLoop, RWhileLoop, RFunctionCall, RComment, RNext, RBreak, RParameter, RArgument, RFunctionDefinition, RAccess, RModelFormulaBinaryOp, RModelFormulaUnaryOp, RLineDirective, RPipe } from '../nodes';
3
+ import type { RNode } from '../model';
4
4
  /**
5
5
  * Called during the down-pass, will pe propagated to children and used in the up-pass (see {@link StatefulFoldFunctions}).
6
6
  * <p>
@@ -1,4 +1,4 @@
1
- import { NoInfo, RNode } from '../model';
1
+ import type { NoInfo, RNode } from '../model';
2
2
  /** Return `true` to stop visiting from this node (i.e., do not continue to visit this node *and* the children) */
3
3
  export type OnEnter<OtherInfo> = (node: RNode<OtherInfo>) => (boolean | void);
4
4
  /** Similar to {@link OnEnter} but called when leaving a node. Can't stop exploration as the subtree is already visited! */
@@ -1,5 +1,5 @@
1
- import { MergeableRecord } from '../../../../../util/objects';
2
- import { TokenMap } from '../../../../retriever';
1
+ import type { MergeableRecord } from '../../../../../util/objects';
2
+ import type { TokenMap } from '../../../../retriever';
3
3
  /**
4
4
  * Configures the settings for the xml parser (like what names should be used to represent the given objects,
5
5
  * and what replacements are active with `xmlparsedata` on the R-side of things).
@@ -1,8 +1,8 @@
1
- import { MergeableRecord } from '../../../../../util/objects';
2
- import { DeepReadonly } from 'ts-essentials';
3
- import { XmlParserConfig } from './config';
4
- import { XmlParserHooks } from './hooks';
5
- import { SourceRange } from '../../../../../util/range';
1
+ import type { MergeableRecord } from '../../../../../util/objects';
2
+ import type { DeepReadonly } from 'ts-essentials';
3
+ import type { XmlParserConfig } from './config';
4
+ import type { XmlParserHooks } from './hooks';
5
+ import type { SourceRange } from '../../../../../util/range';
6
6
  /**
7
7
  * Contains all information populated and present during parsing and normalization of the R AST.
8
8
  */
@@ -1,8 +1,8 @@
1
- import { NamedXmlBasedJson, XmlBasedJson } from './input-format';
2
- import { RNumber, NoInfo, RBinaryOp, RComment, RForLoop, RFunctionCall, RIfThenElse, RNode, RRepeatLoop, RString, RUnaryOp, RWhileLoop, RSymbol, RLogical, BinaryOperatorFlavor, RParameter, RFunctionDefinition, RArgument, UnaryOperatorFlavor, RBreak, RNext, RAccess, RLineDirective, RPipe } from '../../model';
3
- import { RNa } from '../../../values';
4
- import { ParserData } from './data';
5
- import { DeepReadonly, DeepRequired } from 'ts-essentials';
1
+ import type { NamedXmlBasedJson, XmlBasedJson } from './input-format';
2
+ import type { RNumber, NoInfo, RBinaryOp, RComment, RForLoop, RFunctionCall, RIfThenElse, RNode, RRepeatLoop, RString, RUnaryOp, RWhileLoop, RSymbol, RLogical, BinaryOperatorFlavor, RParameter, RFunctionDefinition, RArgument, UnaryOperatorFlavor, RBreak, RNext, RAccess, RLineDirective, RPipe } from '../../model';
3
+ import type { RNa } from '../../../values';
4
+ import type { ParserData } from './data';
5
+ import type { DeepReadonly, DeepRequired } from 'ts-essentials';
6
6
  /** Denotes that if you return `undefined`, the parser will automatically take the original arguments (unchanged) */
7
7
  type AutoIfOmit<T> = T | undefined | void;
8
8
  /**
@@ -1,4 +1,4 @@
1
- import { RawRType } from '../../model';
1
+ import type { RawRType } from '../../model';
2
2
  /**
3
3
  * Thrown if the given input xml is not valid/contains unexpected elements.
4
4
  */
@@ -1,6 +1,6 @@
1
- import { NamedXmlBasedJson } from '../input-format';
2
- import { ParserData } from '../data';
3
- import { RAccess } from '../../../model';
1
+ import type { NamedXmlBasedJson } from '../input-format';
2
+ import type { ParserData } from '../data';
3
+ import type { RAccess } from '../../../model';
4
4
  /**
5
5
  * Tries to normalize the given data as access (e.g., indexing).
6
6
  *
@@ -1,6 +1,6 @@
1
- import { NamedXmlBasedJson } from '../../input-format';
2
- import { ParserData } from '../../data';
3
- import { RIfThenElse } from '../../../../model';
1
+ import type { NamedXmlBasedJson } from '../../input-format';
2
+ import type { ParserData } from '../../data';
3
+ import type { RIfThenElse } from '../../../../model';
4
4
  /**
5
5
  * Try to parse the construct as a {@link RIfThenElse}.
6
6
  */
@@ -1,6 +1,6 @@
1
- import { NamedXmlBasedJson } from '../../input-format';
2
- import { ParserData } from '../../data';
3
- import { RIfThenElse } from '../../../../model';
1
+ import type { NamedXmlBasedJson } from '../../input-format';
2
+ import type { ParserData } from '../../data';
3
+ import type { RIfThenElse } from '../../../../model';
4
4
  /**
5
5
  * Try to parse the construct as a {@link RIfThenElse}.
6
6
  */
@@ -1,6 +1,6 @@
1
- import { XmlBasedJson } from '../../input-format';
2
- import { ParserData } from '../../data';
3
- import { RNode } from '../../../../model';
1
+ import type { XmlBasedJson } from '../../input-format';
2
+ import type { ParserData } from '../../data';
3
+ import type { RNode } from '../../../../model';
4
4
  /**
5
5
  * Returns an expression list if there are multiple children, otherwise returns the single child directly with no expr wrapper
6
6
  *
@@ -1,6 +1,6 @@
1
- import { NamedXmlBasedJson } from '../../input-format';
2
- import { RArgument } from '../../../../model';
3
- import { ParserData } from '../../data';
1
+ import type { NamedXmlBasedJson } from '../../input-format';
2
+ import type { RArgument } from '../../../../model';
3
+ import type { ParserData } from '../../data';
4
4
  /**
5
5
  * Either parses `[expr]` or `[SYMBOL_SUB, EQ_SUB, expr]` as an argument of a function call in R.
6
6
  * Probably directly called by the function call parser as otherwise, we do not expect to find arguments.
@@ -1,6 +1,6 @@
1
- import { NamedXmlBasedJson } from '../../input-format';
2
- import { ParserData } from '../../data';
3
- import { RFunctionCall, RNext, RBreak } from '../../../../model';
1
+ import type { NamedXmlBasedJson } from '../../input-format';
2
+ import type { ParserData } from '../../data';
3
+ import type { RFunctionCall, RNext, RBreak } from '../../../../model';
4
4
  /**
5
5
  * Tries to parse the given data as a function call.
6
6
  *
@@ -1,6 +1,6 @@
1
- import { ParserData } from '../../data';
2
- import { NamedXmlBasedJson } from '../../input-format';
3
- import { RFunctionDefinition } from '../../../../model';
1
+ import type { ParserData } from '../../data';
2
+ import type { NamedXmlBasedJson } from '../../input-format';
3
+ import type { RFunctionDefinition } from '../../../../model';
4
4
  /**
5
5
  * Tries to parse the given data as a function definition.
6
6
  *
@@ -1,6 +1,6 @@
1
- import { NamedXmlBasedJson } from '../../input-format';
2
- import { RParameter } from '../../../../model';
3
- import { ParserData } from '../../data';
1
+ import type { NamedXmlBasedJson } from '../../input-format';
2
+ import type { RParameter } from '../../../../model';
3
+ import type { ParserData } from '../../data';
4
4
  /**
5
5
  * Either parses `[SYMBOL_FORMALS]` or `[SYMBOL_FORMALS, EQ_FORMALS, expr]` as a parameter of a function definition in R.
6
6
  * Probably directly called by the function definition parser as otherwise, we do not expect to find parameters.
@@ -1,4 +1,4 @@
1
- import { ParserData } from '../../data';
2
- import { XmlBasedJson } from '../../input-format';
3
- import { RBreak } from '../../../../model';
1
+ import type { ParserData } from '../../data';
2
+ import type { XmlBasedJson } from '../../input-format';
3
+ import type { RBreak } from '../../../../model';
4
4
  export declare function normalizeBreak(data: ParserData, obj: XmlBasedJson): RBreak;
@@ -1,4 +1,4 @@
1
- import { NamedXmlBasedJson } from '../../input-format';
2
- import { ParserData } from '../../data';
3
- import { RForLoop } from '../../../../model';
1
+ import type { NamedXmlBasedJson } from '../../input-format';
2
+ import type { ParserData } from '../../data';
3
+ import type { RForLoop } from '../../../../model';
4
4
  export declare function tryNormalizeFor(data: ParserData, forToken: NamedXmlBasedJson, head: NamedXmlBasedJson, body: NamedXmlBasedJson): RForLoop | undefined;
@@ -1,4 +1,4 @@
1
- import { ParserData } from '../../data';
2
- import { XmlBasedJson } from '../../input-format';
3
- import { RNext } from '../../../../model';
1
+ import type { ParserData } from '../../data';
2
+ import type { XmlBasedJson } from '../../input-format';
3
+ import type { RNext } from '../../../../model';
4
4
  export declare function normalizeNext(data: ParserData, obj: XmlBasedJson): RNext;
@@ -1,6 +1,6 @@
1
- import { NamedXmlBasedJson } from '../../input-format';
2
- import { ParserData } from '../../data';
3
- import { RRepeatLoop } from '../../../../model';
1
+ import type { NamedXmlBasedJson } from '../../input-format';
2
+ import type { ParserData } from '../../data';
3
+ import type { RRepeatLoop } from '../../../../model';
4
4
  /**
5
5
  * Try to parse the construct as a {@link RRepeatLoop}.
6
6
  *
@@ -1,4 +1,4 @@
1
- import { NamedXmlBasedJson } from '../../input-format';
2
- import { ParserData } from '../../data';
3
- import { RWhileLoop } from '../../../../model';
1
+ import type { NamedXmlBasedJson } from '../../input-format';
2
+ import type { ParserData } from '../../data';
3
+ import type { RWhileLoop } from '../../../../model';
4
4
  export declare function tryNormalizeWhile(data: ParserData, whileToken: NamedXmlBasedJson, leftParen: NamedXmlBasedJson, condition: NamedXmlBasedJson, rightParen: NamedXmlBasedJson, body: NamedXmlBasedJson): RWhileLoop | undefined;
@@ -1,7 +1,7 @@
1
- import { NamedXmlBasedJson, XmlBasedJson } from '../input-format';
2
- import { SourceRange } from '../../../../../../util/range';
3
- import { XmlParserConfig } from '../config';
4
- import { RawRType, RExpressionList, RNode } from '../../../model';
1
+ import type { NamedXmlBasedJson, XmlBasedJson } from '../input-format';
2
+ import type { SourceRange } from '../../../../../../util/range';
3
+ import type { XmlParserConfig } from '../config';
4
+ import type { RawRType, RExpressionList, RNode } from '../../../model';
5
5
  /**
6
6
  * if the passed object is an array with only one element, remove the array wrapper
7
7
  */
@@ -1,6 +1,6 @@
1
- import { NamedXmlBasedJson } from '../../input-format';
2
- import { ParserData } from '../../data';
3
- import { RNode } from '../../../../model';
1
+ import type { NamedXmlBasedJson } from '../../input-format';
2
+ import type { ParserData } from '../../data';
3
+ import type { RNode } from '../../../../model';
4
4
  /**
5
5
  * Parsing binary operations includes the pipe, even though the produced PIPE construct is not a binary operation,
6
6
  * to ensure it is handled separately from the others (especially in the combination of a pipe bind)
@@ -1,4 +1,4 @@
1
- import { BinaryOperatorFlavor } from '../../../../model';
1
+ import type { BinaryOperatorFlavor } from '../../../../model';
2
2
  /**
3
3
  * Identify the flavor of a given operator, as we do not really have a use for "special"
4
4
  * operators within our internal AST.
@@ -1,6 +1,6 @@
1
- import { NamedXmlBasedJson } from '../../input-format';
2
- import { ParserData } from '../../data';
3
- import { RNode } from '../../../../model';
1
+ import type { NamedXmlBasedJson } from '../../input-format';
2
+ import type { ParserData } from '../../data';
3
+ import type { RNode } from '../../../../model';
4
4
  /**
5
5
  * Parses the construct as a {@link RUnaryOp} (automatically identifies the flavor).
6
6
  *
@@ -1,6 +1,6 @@
1
- import { XmlBasedJson } from '../../input-format';
2
- import { RComment } from '../../../../model';
3
- import { ParserData } from '../../data';
1
+ import type { XmlBasedJson } from '../../input-format';
2
+ import type { RComment } from '../../../../model';
3
+ import type { ParserData } from '../../data';
4
4
  /**
5
5
  * Normalize the given object as an R comment.
6
6
  * This requires you to check the corresponding name beforehand.
@@ -1,6 +1,6 @@
1
- import { XmlBasedJson } from '../../input-format';
2
- import { RComment, RLineDirective } from '../../../../model';
3
- import { ParserData } from '../../data';
1
+ import type { XmlBasedJson } from '../../input-format';
2
+ import type { RComment, RLineDirective } from '../../../../model';
3
+ import type { ParserData } from '../../data';
4
4
  /**
5
5
  * Normalize the given object as an R line directive (`#line <number> "<file>"`).
6
6
  * This requires you to check the corresponding name beforehand.
@@ -1,7 +1,7 @@
1
- import { NamedXmlBasedJson, XmlBasedJson } from '../../input-format';
2
- import { ParserData } from '../../data';
3
- import { RNode } from '../../../../model';
4
- import { RDelimiter } from '../../../../model/nodes/info';
1
+ import type { NamedXmlBasedJson, XmlBasedJson } from '../../input-format';
2
+ import type { ParserData } from '../../data';
3
+ import type { RNode } from '../../../../model';
4
+ import type { RDelimiter } from '../../../../model/nodes/info';
5
5
  export declare function splitComments(mappedWithName: NamedXmlBasedJson[]): {
6
6
  comments: NamedXmlBasedJson[];
7
7
  others: NamedXmlBasedJson[];
@@ -1,4 +1,4 @@
1
- import { XmlBasedJson } from '../../input-format';
2
- import { ParserData } from '../../data';
3
- import { RExpressionList } from '../../../../model';
1
+ import type { XmlBasedJson } from '../../input-format';
2
+ import type { ParserData } from '../../data';
3
+ import type { RExpressionList } from '../../../../model';
4
4
  export declare function parseRootObjToAst(data: ParserData, obj: XmlBasedJson): RExpressionList;
@@ -1,7 +1,7 @@
1
- import { NamedXmlBasedJson } from '../../input-format';
2
- import { ParserData } from '../../data';
3
- import { RNode } from '../../../../model';
4
- import { RDelimiter } from '../../../../model/nodes/info';
1
+ import type { NamedXmlBasedJson } from '../../input-format';
2
+ import type { ParserData } from '../../data';
3
+ import type { RNode } from '../../../../model';
4
+ import type { RDelimiter } from '../../../../model/nodes/info';
5
5
  /**
6
6
  * Parses a single structure in the ast based on its type (e.g., a string, a number, a symbol, ...)
7
7
  *
@@ -1,7 +1,7 @@
1
- import { XmlBasedJson } from '../../input-format';
2
- import { RNa } from '../../../../../values';
3
- import { RLogical, RSymbol, NoInfo, RNumber } from '../../../../model';
4
- import { ParserData } from '../../data';
1
+ import type { XmlBasedJson } from '../../input-format';
2
+ import type { RNa } from '../../../../../values';
3
+ import type { RLogical, RSymbol, NoInfo, RNumber } from '../../../../model';
4
+ import type { ParserData } from '../../data';
5
5
  /**
6
6
  * Normalize the given object as a R number (see {@link number2ts}), supporting booleans (see {@link boolean2ts}),
7
7
  * and special values.
@@ -1,6 +1,6 @@
1
- import { XmlBasedJson } from '../../input-format';
2
- import { RString } from '../../../../model';
3
- import { ParserData } from '../../data';
1
+ import type { XmlBasedJson } from '../../input-format';
2
+ import type { RString } from '../../../../model';
3
+ import type { ParserData } from '../../data';
4
4
  /**
5
5
  * Normalize the given object as a R string (see {@link string2ts}).
6
6
  * This requires you to check the corresponding name beforehand.
@@ -1,6 +1,6 @@
1
- import { NamedXmlBasedJson } from '../../input-format';
2
- import { RSymbol } from '../../../../model';
3
- import { ParserData } from '../../data';
1
+ import type { NamedXmlBasedJson } from '../../input-format';
2
+ import type { RSymbol } from '../../../../model';
3
+ import type { ParserData } from '../../data';
4
4
  /**
5
5
  * Normalize the given object as an R symbol (incorporating namespace information).
6
6
  * <p>
@@ -1,5 +1,5 @@
1
- import { XmlParserConfig } from '../config';
2
- import { XmlBasedJson } from '../input-format';
1
+ import type { XmlParserConfig } from '../config';
2
+ import type { XmlBasedJson } from '../input-format';
3
3
  /**
4
4
  * Parse the xml presented by R into a json object that will be used for conversion
5
5
  *
@@ -1,7 +1,7 @@
1
- import { NormalizedAst, IdGenerator, NoInfo } from '../../model';
2
- import { XmlParserHooks } from './hooks';
3
- import { DeepPartial } from 'ts-essentials';
4
- import { TokenMap } from '../../../../retriever';
1
+ import type { NormalizedAst, IdGenerator, NoInfo } from '../../model';
2
+ import type { XmlParserHooks } from './hooks';
3
+ import type { DeepPartial } from 'ts-essentials';
4
+ import type { TokenMap } from '../../../../retriever';
5
5
  export declare const parseLog: import("tslog").Logger<import("tslog").ILogObj>;
6
6
  /**
7
7
  * The main entry point to normalize the given R ast.
@@ -1,6 +1,6 @@
1
1
  import { type RShell } from './shell';
2
- import { XmlParserHooks, NormalizedAst } from './lang-4.x';
3
- import { DeepPartial, DeepReadonly } from 'ts-essentials';
2
+ import type { XmlParserHooks, NormalizedAst } from './lang-4.x';
3
+ import type { DeepPartial, DeepReadonly } from 'ts-essentials';
4
4
  export interface RParseRequestFromFile {
5
5
  request: 'file';
6
6
  /** The path to the file (absolute paths are probably best here */
@@ -0,0 +1,25 @@
1
+ import type { RShellExecutionOptions } from './shell';
2
+ import type { SemVer } from 'semver';
3
+ import type { TokenMap } from './retriever';
4
+ export declare class RShellExecutor {
5
+ readonly options: Readonly<RShellExecutionOptions>;
6
+ private readonly log;
7
+ private readonly prerequisites;
8
+ constructor(options?: Partial<RShellExecutionOptions>);
9
+ continueOnError(): RShellExecutor;
10
+ injectLibPaths(...paths: string[]): RShellExecutor;
11
+ tryToInjectHomeLibPath(): RShellExecutor;
12
+ addPrerequisites(commands: string | string[]): RShellExecutor;
13
+ usedRVersion(): SemVer | null;
14
+ allInstalledPackages(): string[];
15
+ isPackageInstalled(packageName: string): boolean;
16
+ ensurePackageInstalled(packageName: string, autoload?: boolean, force?: boolean): {
17
+ packageName: string;
18
+ packageExistedAlready: boolean;
19
+ /** the temporary directory used for the installation, undefined if none was used */
20
+ libraryLocation?: string;
21
+ };
22
+ obtainTempDir(): string;
23
+ getTokenMap(): TokenMap;
24
+ run(commands: string | string[], returnErr?: boolean): string;
25
+ }