@procedures/compiler 0.0.0-stage → 0.3.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 (175) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/LICENSE +21 -0
  3. package/README.md +254 -2
  4. package/dist/.tsbuildinfo +1 -0
  5. package/dist/checks.d.ts +24 -0
  6. package/dist/checks.d.ts.map +1 -0
  7. package/dist/checks.js +123 -0
  8. package/dist/checks.js.map +1 -0
  9. package/dist/codegen-closure.d.ts +19 -0
  10. package/dist/codegen-closure.d.ts.map +1 -0
  11. package/dist/codegen-closure.js +200 -0
  12. package/dist/codegen-closure.js.map +1 -0
  13. package/dist/codegen-text.d.ts +44 -0
  14. package/dist/codegen-text.d.ts.map +1 -0
  15. package/dist/codegen-text.js +360 -0
  16. package/dist/codegen-text.js.map +1 -0
  17. package/dist/diagnostics.d.ts +67 -0
  18. package/dist/diagnostics.d.ts.map +1 -0
  19. package/dist/diagnostics.js +38 -0
  20. package/dist/diagnostics.js.map +1 -0
  21. package/dist/effects.d.ts +63 -0
  22. package/dist/effects.d.ts.map +1 -0
  23. package/dist/effects.js +185 -0
  24. package/dist/effects.js.map +1 -0
  25. package/dist/explain.d.ts +58 -0
  26. package/dist/explain.d.ts.map +1 -0
  27. package/dist/explain.js +144 -0
  28. package/dist/explain.js.map +1 -0
  29. package/dist/facts.d.ts +66 -0
  30. package/dist/facts.d.ts.map +1 -0
  31. package/dist/facts.js +102 -0
  32. package/dist/facts.js.map +1 -0
  33. package/dist/fold.d.ts +27 -0
  34. package/dist/fold.d.ts.map +1 -0
  35. package/dist/fold.js +128 -0
  36. package/dist/fold.js.map +1 -0
  37. package/dist/index.d.ts +35 -0
  38. package/dist/index.d.ts.map +1 -0
  39. package/dist/index.js +22 -0
  40. package/dist/index.js.map +1 -0
  41. package/dist/interceptor.d.ts +51 -0
  42. package/dist/interceptor.d.ts.map +1 -0
  43. package/dist/interceptor.js +116 -0
  44. package/dist/interceptor.js.map +1 -0
  45. package/dist/ir.d.ts +240 -0
  46. package/dist/ir.d.ts.map +1 -0
  47. package/dist/ir.js +74 -0
  48. package/dist/ir.js.map +1 -0
  49. package/dist/mermaid.d.ts +53 -0
  50. package/dist/mermaid.d.ts.map +1 -0
  51. package/dist/mermaid.js +423 -0
  52. package/dist/mermaid.js.map +1 -0
  53. package/dist/module.d.ts +20 -0
  54. package/dist/module.d.ts.map +1 -0
  55. package/dist/module.js +124 -0
  56. package/dist/module.js.map +1 -0
  57. package/dist/normalize.d.ts +43 -0
  58. package/dist/normalize.d.ts.map +1 -0
  59. package/dist/normalize.js +529 -0
  60. package/dist/normalize.js.map +1 -0
  61. package/dist/openrpc.d.ts +63 -0
  62. package/dist/openrpc.d.ts.map +1 -0
  63. package/dist/openrpc.js +57 -0
  64. package/dist/openrpc.js.map +1 -0
  65. package/dist/print.d.ts +8 -0
  66. package/dist/print.d.ts.map +1 -0
  67. package/dist/print.js +148 -0
  68. package/dist/print.js.map +1 -0
  69. package/dist/procedures/program/check.d.ts +14 -0
  70. package/dist/procedures/program/check.d.ts.map +1 -0
  71. package/dist/procedures/program/check.js +30 -0
  72. package/dist/procedures/program/check.js.map +1 -0
  73. package/dist/procedures/program/compile.d.ts +14 -0
  74. package/dist/procedures/program/compile.d.ts.map +1 -0
  75. package/dist/procedures/program/compile.js +35 -0
  76. package/dist/procedures/program/compile.js.map +1 -0
  77. package/dist/procedures/program/diagram.d.ts +14 -0
  78. package/dist/procedures/program/diagram.d.ts.map +1 -0
  79. package/dist/procedures/program/diagram.js +23 -0
  80. package/dist/procedures/program/diagram.js.map +1 -0
  81. package/dist/procedures/program/effects-output.d.ts +8 -0
  82. package/dist/procedures/program/effects-output.d.ts.map +1 -0
  83. package/dist/procedures/program/effects-output.js +13 -0
  84. package/dist/procedures/program/effects-output.js.map +1 -0
  85. package/dist/procedures/program/explain.d.ts +14 -0
  86. package/dist/procedures/program/explain.d.ts.map +1 -0
  87. package/dist/procedures/program/explain.js +43 -0
  88. package/dist/procedures/program/explain.js.map +1 -0
  89. package/dist/procedures/program/index.d.ts +5 -0
  90. package/dist/procedures/program/index.d.ts.map +1 -0
  91. package/dist/procedures/program/index.js +5 -0
  92. package/dist/procedures/program/index.js.map +1 -0
  93. package/dist/procedures/sdk/index.d.ts +3 -0
  94. package/dist/procedures/sdk/index.d.ts.map +1 -0
  95. package/dist/procedures/sdk/index.js +3 -0
  96. package/dist/procedures/sdk/index.js.map +1 -0
  97. package/dist/procedures/sdk/manifest.d.ts +11 -0
  98. package/dist/procedures/sdk/manifest.d.ts.map +1 -0
  99. package/dist/procedures/sdk/manifest.js +15 -0
  100. package/dist/procedures/sdk/manifest.js.map +1 -0
  101. package/dist/procedures/sdk/openrpc.d.ts +11 -0
  102. package/dist/procedures/sdk/openrpc.d.ts.map +1 -0
  103. package/dist/procedures/sdk/openrpc.js +13 -0
  104. package/dist/procedures/sdk/openrpc.js.map +1 -0
  105. package/dist/procedures/sdk/typescript.d.ts +11 -0
  106. package/dist/procedures/sdk/typescript.d.ts.map +1 -0
  107. package/dist/procedures/sdk/typescript.js +14 -0
  108. package/dist/procedures/sdk/typescript.js.map +1 -0
  109. package/dist/program.d.ts +84 -0
  110. package/dist/program.d.ts.map +1 -0
  111. package/dist/program.js +108 -0
  112. package/dist/program.js.map +1 -0
  113. package/dist/refs.d.ts +9 -0
  114. package/dist/refs.d.ts.map +1 -0
  115. package/dist/refs.js +9 -0
  116. package/dist/refs.js.map +1 -0
  117. package/dist/register.d.ts +6 -0
  118. package/dist/register.d.ts.map +1 -0
  119. package/dist/register.js +8 -0
  120. package/dist/register.js.map +1 -0
  121. package/dist/runtime.d.ts +68 -0
  122. package/dist/runtime.d.ts.map +1 -0
  123. package/dist/runtime.js +138 -0
  124. package/dist/runtime.js.map +1 -0
  125. package/dist/schema.d.ts +41 -0
  126. package/dist/schema.d.ts.map +1 -0
  127. package/dist/schema.js +325 -0
  128. package/dist/schema.js.map +1 -0
  129. package/dist/scopes.d.ts +25 -0
  130. package/dist/scopes.d.ts.map +1 -0
  131. package/dist/scopes.js +202 -0
  132. package/dist/scopes.js.map +1 -0
  133. package/dist/types.d.ts +129 -0
  134. package/dist/types.d.ts.map +1 -0
  135. package/dist/types.js +157 -0
  136. package/dist/types.js.map +1 -0
  137. package/dist/typescript-sdk.d.ts +34 -0
  138. package/dist/typescript-sdk.d.ts.map +1 -0
  139. package/dist/typescript-sdk.js +231 -0
  140. package/dist/typescript-sdk.js.map +1 -0
  141. package/package.json +83 -3
  142. package/src/checks.ts +128 -0
  143. package/src/codegen-closure.ts +224 -0
  144. package/src/codegen-text.ts +396 -0
  145. package/src/diagnostics.ts +98 -0
  146. package/src/effects.ts +231 -0
  147. package/src/explain.ts +194 -0
  148. package/src/facts.ts +161 -0
  149. package/src/fold.ts +136 -0
  150. package/src/index.ts +35 -0
  151. package/src/interceptor.ts +149 -0
  152. package/src/ir.ts +330 -0
  153. package/src/mermaid.ts +460 -0
  154. package/src/module.ts +171 -0
  155. package/src/normalize.ts +694 -0
  156. package/src/openrpc.ts +104 -0
  157. package/src/print.ts +143 -0
  158. package/src/procedures/program/check.ts +31 -0
  159. package/src/procedures/program/compile.ts +36 -0
  160. package/src/procedures/program/diagram.ts +25 -0
  161. package/src/procedures/program/effects-output.ts +16 -0
  162. package/src/procedures/program/explain.ts +46 -0
  163. package/src/procedures/program/index.ts +4 -0
  164. package/src/procedures/sdk/index.ts +2 -0
  165. package/src/procedures/sdk/manifest.ts +17 -0
  166. package/src/procedures/sdk/openrpc.ts +16 -0
  167. package/src/procedures/sdk/typescript.ts +17 -0
  168. package/src/program.ts +181 -0
  169. package/src/refs.ts +9 -0
  170. package/src/register.ts +10 -0
  171. package/src/runtime.ts +188 -0
  172. package/src/schema.ts +318 -0
  173. package/src/scopes.ts +196 -0
  174. package/src/types.ts +318 -0
  175. package/src/typescript-sdk.ts +282 -0
package/dist/ir.d.ts ADDED
@@ -0,0 +1,240 @@
1
+ /**
2
+ * The intermediate representation (IR) of a program.
3
+ *
4
+ * The normalize pass makes the IR from the JSON of a program. Each node is one step of the
5
+ * interpreter: `hydrateInput()` or a control-flow procedure of `@procedures/client`. The code
6
+ * generation follows the IR in the order of the interpreter. Each node keeps the JSON pointer
7
+ * (RFC 6901) of its source in the program.
8
+ */
9
+ import type { ProcedurePath } from "@procedures/client/browser";
10
+ /** A JSON pointer (RFC 6901) into the program. The empty string is the root. */
11
+ export type Pointer = string;
12
+ /** This function gives the pointer of a child: the key is escaped as RFC 6901 tells. */
13
+ export declare function childPointer(pointer: Pointer, key: string | number): Pointer;
14
+ /** The kinds of a binding: the source of a name in a scope. */
15
+ export type BindingKind = "step" | "initial" | "item" | "index" | "acc" | "error" | "input";
16
+ /**
17
+ * A binding is a value that a scope gives to a name. Examples are the result of a chain step,
18
+ * the item of `client.map` and the error of `client.tryCatch`. Each binding gets one variable.
19
+ */
20
+ export interface Binding {
21
+ /** The number of the binding, unique in the program. */
22
+ readonly id: number;
23
+ readonly kind: BindingKind;
24
+ /** The name in the scope. A step without `$name` has no name: only `$last` reads it. */
25
+ readonly name: string | undefined;
26
+ /** The pointer of the source of the binding. */
27
+ readonly pointer: Pointer;
28
+ }
29
+ /** One frame of a static scope, as the interpreter has it at one point of the program. */
30
+ export interface ScopeFrame {
31
+ /** The names of the frame and their bindings, in the order of `Map.set`. */
32
+ readonly names: ReadonlyArray<readonly [string, Binding]>;
33
+ /** The binding that `$last` reads in this frame, or undefined when the frame has none. */
34
+ readonly last: Binding | undefined;
35
+ }
36
+ /** A static scope: the frames from the outermost to the innermost. Undefined: no scope. */
37
+ export type ScopeSnapshot = readonly ScopeFrame[] | undefined;
38
+ /** Where a call is: the root call, an operand of control flow, or a call in an input. */
39
+ export type CallPosition = "root" | "operand" | "nested";
40
+ interface NodeBase {
41
+ readonly pointer: Pointer;
42
+ }
43
+ /** A value that the program gives as it is. */
44
+ export interface LiteralNode extends NodeBase {
45
+ readonly kind: "literal";
46
+ /** The value. The closure code gives this object itself, as the interpreter does. */
47
+ readonly value: unknown;
48
+ /**
49
+ * The source of the value. It is plain data, a `$literal`, a `$never` call or a `$ref` outside
50
+ * each scope. It can also be a deferred call of a procedure that takes raw input, or a folded call.
51
+ */
52
+ readonly origin: "data" | "literal" | "never" | "deferred" | "unscoped-ref" | "fold";
53
+ }
54
+ /** A plain object with values that the interpreter computes. The entries keep the order of `Object.entries`. */
55
+ export interface ObjectNode extends NodeBase {
56
+ readonly kind: "object";
57
+ readonly entries: ReadonlyArray<{
58
+ readonly key: string;
59
+ readonly value: IRNode;
60
+ }>;
61
+ }
62
+ /** An array with items that the interpreter computes, from the first item to the last item. */
63
+ export interface ArrayNode extends NodeBase {
64
+ readonly kind: "array";
65
+ readonly items: readonly IRNode[];
66
+ }
67
+ /** A `$ref`: it reads a name of the scope and optional fields. */
68
+ export interface ReferenceNode extends NodeBase {
69
+ readonly kind: "reference";
70
+ /** The text of the `$ref`: a name and fields, with dots. */
71
+ readonly text: string;
72
+ readonly name: string;
73
+ readonly fields: readonly string[];
74
+ /** True in the input of a deferred call: there, an unknown name stays data for the runner. */
75
+ readonly deferred: boolean;
76
+ /** The `$ref` object of the program. A deferred input gives it for an unknown name. */
77
+ readonly source: unknown;
78
+ /** True for a reference that the compiler made (the value that `passThrough` gives). */
79
+ readonly synthetic: boolean;
80
+ /** The binding of the name. The scopes pass sets it. Undefined: no scope has the name. */
81
+ binding: Binding | undefined;
82
+ }
83
+ /** A call through the client. Its input is hydrated before the call. */
84
+ export interface CallNode extends NodeBase {
85
+ readonly kind: "call";
86
+ readonly path: ProcedurePath;
87
+ readonly key: string;
88
+ readonly position: CallPosition;
89
+ readonly input: IRNode;
90
+ /** The parent context (`cwd`, `node`) that control flow adds to the input of an operand call. */
91
+ readonly extra: Readonly<Record<string, unknown>>;
92
+ /** The `$name` of the call. Only a chain step binds it. */
93
+ readonly name: string | undefined;
94
+ }
95
+ /** A call that waits for its runner (`$parent` or a context name): it is data, with its input hydrated. */
96
+ export interface DeferredNode extends NodeBase {
97
+ readonly kind: "deferred";
98
+ readonly path: ProcedurePath;
99
+ readonly key: string;
100
+ readonly when: string;
101
+ /** The call object of the program. */
102
+ readonly source: Readonly<Record<string, unknown>>;
103
+ readonly input: IRNode;
104
+ }
105
+ /** The reasons for a dynamic node. */
106
+ export type DynamicReason =
107
+ /** The procedure runs the refs of its input (the `runs-refs` tag): `client.eval`, `dag.traverse`, `procedure.define`. */
108
+ "runs-refs"
109
+ /** The procedure takes its input as data (the `raw-input` tag): `client.export`. */
110
+ | "raw-input"
111
+ /** The input of a control-flow procedure does not agree with its schema: the call gives the validation error. */
112
+ | "invalid-control-flow"
113
+ /** The registry does not have the core control-flow procedure at the path. */
114
+ | "not-core"
115
+ /** A control-flow call contains itself. */
116
+ | "cyclic";
117
+ /**
118
+ * A call whose procedure gets its input raw, and whose operands the compiler does not model.
119
+ * The compiled code calls the procedure through the client with the raw input and the scope:
120
+ * the interpreter of the client runs it.
121
+ */
122
+ export interface DynamicNode extends NodeBase {
123
+ readonly kind: "dynamic";
124
+ readonly path: ProcedurePath;
125
+ readonly key: string;
126
+ readonly position: CallPosition;
127
+ readonly reason: DynamicReason;
128
+ /** The raw input: a literal, or a value that the compiled code computes (`passThrough`). */
129
+ readonly input: IRNode;
130
+ readonly extra: Readonly<Record<string, unknown>>;
131
+ /** What the procedure runs, when the compiler can see it (`client.eval` of a literal path). Only the checks read it. */
132
+ readonly model: IRNode | undefined;
133
+ /** The scope that the call gets (`withScope`). The scopes pass sets it. */
134
+ scope: ScopeSnapshot;
135
+ }
136
+ /** A step of the interpreter that throws: a hydration limit, or a `fn` that is not a call. */
137
+ export interface FailNode extends NodeBase {
138
+ readonly kind: "fail";
139
+ readonly message: string;
140
+ }
141
+ interface ControlBase extends NodeBase {
142
+ readonly path: ProcedurePath;
143
+ readonly key: string;
144
+ readonly position: CallPosition;
145
+ }
146
+ /** One step of a chain. */
147
+ export interface ChainStep {
148
+ readonly pointer: Pointer;
149
+ readonly node: IRNode;
150
+ /** The result of the step: `$last` and `passThrough` read it, and `$name` names it. */
151
+ readonly result: Binding;
152
+ }
153
+ /** `client.chain`, or an array of calls that runs as one chain (an implicit chain). */
154
+ export interface ChainNode extends ControlBase {
155
+ readonly kind: "chain";
156
+ readonly implicit: boolean;
157
+ readonly steps: readonly ChainStep[];
158
+ readonly passThrough: boolean;
159
+ /** The hydrated `initialInput` when `passThrough` is true. */
160
+ readonly initialInput: IRNode | undefined;
161
+ readonly initial: Binding | undefined;
162
+ }
163
+ /** `client.parallel`. */
164
+ export interface ParallelNode extends ControlBase {
165
+ readonly kind: "parallel";
166
+ readonly tasks: readonly IRNode[];
167
+ readonly concurrency: number | undefined;
168
+ readonly failFast: boolean;
169
+ }
170
+ /** `client.conditional`. An absent branch is undefined: the result is undefined, and nothing runs. */
171
+ export interface ConditionalNode extends ControlBase {
172
+ readonly kind: "conditional";
173
+ readonly condition: IRNode;
174
+ readonly then: IRNode | undefined;
175
+ readonly else: IRNode | undefined;
176
+ }
177
+ /** `client.tryCatch`. */
178
+ export interface TryNode extends ControlBase {
179
+ readonly kind: "try";
180
+ readonly try: IRNode;
181
+ readonly catch: IRNode;
182
+ readonly error: Binding;
183
+ }
184
+ /** `client.and` and `client.or`. */
185
+ export interface LogicNode extends ControlBase {
186
+ readonly kind: "and" | "or";
187
+ readonly values: readonly IRNode[];
188
+ }
189
+ /** The `items` of `client.map` and `client.reduce`: an array whose items are hydrated one by one, or one value. */
190
+ export type ItemsSpec = {
191
+ readonly kind: "list";
192
+ readonly items: readonly IRNode[];
193
+ } | {
194
+ readonly kind: "value";
195
+ readonly value: IRNode;
196
+ };
197
+ /** `client.map`. */
198
+ export interface MapNode extends ControlBase {
199
+ readonly kind: "map";
200
+ readonly items: ItemsSpec;
201
+ readonly fn: IRNode | undefined;
202
+ readonly item: Binding;
203
+ readonly index: Binding;
204
+ }
205
+ /** `client.reduce`. Without `fn`, the result is the hydrated `initial` (or `accumulated`), and the items do not run. */
206
+ export interface ReduceNode extends ControlBase {
207
+ readonly kind: "reduce";
208
+ readonly items: ItemsSpec | undefined;
209
+ readonly initial: IRNode;
210
+ readonly fn: IRNode | undefined;
211
+ readonly acc: Binding;
212
+ readonly item: Binding;
213
+ readonly index: Binding;
214
+ }
215
+ /** The nodes of the control flow. */
216
+ export type ControlNode = ChainNode | ParallelNode | ConditionalNode | TryNode | LogicNode | MapNode | ReduceNode;
217
+ /** A node of the IR. */
218
+ export type IRNode = LiteralNode | ObjectNode | ArrayNode | ReferenceNode | CallNode | DeferredNode | DynamicNode | FailNode | ControlNode;
219
+ /** The IR of a program. */
220
+ export interface ProgramIR {
221
+ /** `exec`: the program runs as `client.exec()` runs it. `body`: as the body of a defined procedure. */
222
+ readonly mode: "exec" | "body";
223
+ readonly root: IRNode;
224
+ /** The binding of `input` in the body mode. */
225
+ readonly input: Binding | undefined;
226
+ /** The number of bindings: the ids go from 0 to this number minus one. */
227
+ readonly bindingCount: number;
228
+ /** The program, as the source of the IR. */
229
+ readonly program: unknown;
230
+ }
231
+ /** True for the nodes that call a procedure (a control-flow node is a call in the interpreter). */
232
+ export declare function isCallLike(node: IRNode): node is CallNode | DynamicNode | ControlNode;
233
+ /** True for a control-flow node. */
234
+ export declare function isControl(node: IRNode): node is ControlNode;
235
+ /** The child nodes of a node, in the order of the interpreter. A dynamic node gives its input, not its model. */
236
+ export declare function childrenOf(node: IRNode): IRNode[];
237
+ /** This function calls `visit` for each node of the tree, parents before children. */
238
+ export declare function walk(node: IRNode, visit: (node: IRNode) => void): void;
239
+ export {};
240
+ //# sourceMappingURL=ir.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ir.d.ts","sourceRoot":"","sources":["../src/ir.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAEhE,gFAAgF;AAChF,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC;AAE7B,wFAAwF;AACxF,wBAAgB,YAAY,CAAC,OAAO,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AAK,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAAG,IAAI,CAGtE"}
package/dist/ir.js ADDED
@@ -0,0 +1,74 @@
1
+ /**
2
+ * The intermediate representation (IR) of a program.
3
+ *
4
+ * The normalize pass makes the IR from the JSON of a program. Each node is one step of the
5
+ * interpreter: `hydrateInput()` or a control-flow procedure of `@procedures/client`. The code
6
+ * generation follows the IR in the order of the interpreter. Each node keeps the JSON pointer
7
+ * (RFC 6901) of its source in the program.
8
+ */
9
+ /** This function gives the pointer of a child: the key is escaped as RFC 6901 tells. */
10
+ export function childPointer(pointer, key) {
11
+ return `${pointer}/${String(key).replace(/~/g, "~0").replace(/\//g, "~1")}`;
12
+ }
13
+ /** True for the nodes that call a procedure (a control-flow node is a call in the interpreter). */
14
+ export function isCallLike(node) {
15
+ return node.kind === "call" || node.kind === "dynamic" || isControl(node);
16
+ }
17
+ /** True for a control-flow node. */
18
+ export function isControl(node) {
19
+ switch (node.kind) {
20
+ case "chain":
21
+ case "parallel":
22
+ case "conditional":
23
+ case "try":
24
+ case "and":
25
+ case "or":
26
+ case "map":
27
+ case "reduce":
28
+ return true;
29
+ default:
30
+ return false;
31
+ }
32
+ }
33
+ /** The child nodes of a node, in the order of the interpreter. A dynamic node gives its input, not its model. */
34
+ export function childrenOf(node) {
35
+ switch (node.kind) {
36
+ case "literal":
37
+ case "reference":
38
+ case "fail":
39
+ return [];
40
+ case "object":
41
+ return node.entries.map((entry) => entry.value);
42
+ case "array":
43
+ return [...node.items];
44
+ case "call":
45
+ case "deferred":
46
+ case "dynamic":
47
+ return [node.input];
48
+ case "chain":
49
+ return [...(node.initialInput ? [node.initialInput] : []), ...node.steps.map((step) => step.node)];
50
+ case "parallel":
51
+ return [...node.tasks];
52
+ case "conditional":
53
+ return [node.condition, ...(node.then ? [node.then] : []), ...(node.else ? [node.else] : [])];
54
+ case "try":
55
+ return [node.try, node.catch];
56
+ case "and":
57
+ case "or":
58
+ return [...node.values];
59
+ case "map":
60
+ return [...itemsChildren(node.items), ...(node.fn ? [node.fn] : [])];
61
+ case "reduce":
62
+ return [...(node.items ? itemsChildren(node.items) : []), node.initial, ...(node.fn ? [node.fn] : [])];
63
+ }
64
+ }
65
+ function itemsChildren(items) {
66
+ return items.kind === "list" ? [...items.items] : [items.value];
67
+ }
68
+ /** This function calls `visit` for each node of the tree, parents before children. */
69
+ export function walk(node, visit) {
70
+ visit(node);
71
+ for (const child of childrenOf(node))
72
+ walk(child, visit);
73
+ }
74
+ //# sourceMappingURL=ir.js.map
package/dist/ir.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ir.js","sourceRoot":"","sources":["../src/ir.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAOH,wFAAwF;AACxF,MAAM,UAAU,YAAY,CAAC,OAAgB,EAAE,GAAoB;IACjE,OAAO,GAAG,OAAO,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC;AAC9E,CAAC;AAyPD,mGAAmG;AACnG,MAAM,UAAU,UAAU,CAAC,IAAY;IACrC,OAAO,IAAI,CAAC,IAAI,KAAK,MAAM,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,IAAI,SAAS,CAAC,IAAI,CAAC,CAAC;AAC5E,CAAC;AAED,oCAAoC;AACpC,MAAM,UAAU,SAAS,CAAC,IAAY;IACpC,QAAQ,IAAI,CAAC,IAAI,EAAE,CAAC;QAClB,KAAK,OAAO,CAAC;QACb,KAAK,UAAU,CAAC;QAChB,KAAK,aAAa,CAAC;QACnB,KAAK,KAAK,CAAC;QACX,KAAK,KAAK,CAAC;QACX,KAAK,IAAI,CAAC;QACV,KAAK,KAAK,CAAC;QACX,KAAK,QAAQ;YACX,OAAO,IAAI,CAAC;QACd;YACE,OAAO,KAAK,CAAC;IACjB,CAAC;AACH,CAAC;AAED,iHAAiH;AACjH,MAAM,U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AC,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC;QAC1B,KAAK,KAAK;YACR,OAAO,CAAC,GAAG,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACvE,KAAK,QAAQ;YACX,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,OAAO,EAAE,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC3G,CAAC;AACH,CAAC;AAED,SAAS,aAAa,CAAC,KAAgB;IACrC,OAAO,KAAK,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AAClE,CAAC;AAED,sFAAsF;AACtF,MAAM,UAAU,IAAI,CAAC,IAAY,EAAE,KAA6B;IAC9D,KAAK,CAAC,IAAI,CAAC,CAAC;IACZ,KAAK,MAAM,KAAK,IAAI,UAAU,CAAC,IAAI,CAAC;QAAE,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAC3D,CAAC"}
@@ -0,0 +1,53 @@
1
+ /**
2
+ * A Mermaid flowchart of a program (roadmap R23).
3
+ *
4
+ * The diagram comes from the IR, so it shows what the interpreter does:
5
+ *
6
+ * - A solid arrow is the order of the interpreter. A call in an input starts before its call.
7
+ * - A chain is a subgraph with its steps in order. A parallel call has a fork and a join.
8
+ * - A conditional call is a decision with a `then` arrow and an `else` arrow.
9
+ * - A `client.tryCatch` call has a `try` subgraph and an `error` arrow to its catch part.
10
+ * - A map or a reduce has a loop node: an arrow to `fn` for each item, and an arrow back.
11
+ * - The operands of `client.and` and `client.or` are in order, with a stop arrow from each operand.
12
+ * - A dotted arrow goes from the part that binds a name to each `$ref` that reads the name.
13
+ * - A dynamic call and a deferred call have their own class and a second line of text.
14
+ *
15
+ * Each label goes through `mermaidText()`, so no text of a program can break the syntax.
16
+ */
17
+ import type { ProgramIR } from "./ir.js";
18
+ import type { Diagnostic } from "./diagnostics.js";
19
+ import { type CheckOptions } from "./program.js";
20
+ /** The options of `toMermaid()`. */
21
+ export interface MermaidOptions {
22
+ /** The direction of the flowchart: `TD` (from the top down, the default) or `LR` (from left to right). */
23
+ readonly direction?: "TD" | "LR" | undefined;
24
+ /** The diagnostics of the check. A node with an error at its pointer gets the class `error`. */
25
+ readonly diagnostics?: readonly Diagnostic[] | undefined;
26
+ }
27
+ /**
28
+ * This function makes a text safe for a quoted Mermaid label. It keeps letters, digits, spaces
29
+ * and some punctuation. It writes each other character as an entity code (`#34;` for a quote).
30
+ * Thus quotes, brackets, `<`, `#`, line breaks and the Unicode line separators cannot break the
31
+ * syntax. A text longer than `limit` characters ends with three dots.
32
+ */
33
+ export declare function mermaidText(text: string, limit?: number): string;
34
+ /**
35
+ * This function gives a Mermaid flowchart of the IR of a program. The flowchart shows the order
36
+ * of the calls, the control flow and the names. The text has the same lines for the same IR.
37
+ */
38
+ export declare function toMermaid(ir: ProgramIR, options?: MermaidOptions): string;
39
+ /** The result of `diagramProgram()`. */
40
+ export interface DiagramResult {
41
+ /** True when no diagnostic is an error. */
42
+ readonly ok: boolean;
43
+ /** The text of the Mermaid flowchart. */
44
+ readonly mermaid: string;
45
+ /** The diagnostics of the check, in the order of the program. */
46
+ readonly diagnostics: Diagnostic[];
47
+ }
48
+ /**
49
+ * This function checks a program and gives the Mermaid flowchart of its IR. A node with an error
50
+ * gets the class `error`. No call of the program starts.
51
+ */
52
+ export declare function diagramProgram(program: unknown, options: CheckOptions & Pick<MermaidOptions, "direction">): DiagramResult;
53
+ //# sourceMappingURL=mermaid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mermaid.d.ts","sourceRoot":"","sources":["../src/mermaid.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,KAAK,EAAkG,SAAS,EAAsC,MAAM,SAAS,CAAC;AAC7K,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAgB,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AAE/D,oCAAoC;AACpC,MAAM,WAAW,cAAc;IAC7B,0GAA0G;IAC1G,QAAQ,CAAC,SAAS,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,SAAS,CAAC;IAC7C,gGAAgG;IAChG,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,UAAU,EAAE,GAAG,SAAS,CAAC;CAC1D;AAQD;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,GAAE,MAAmB,GAAG,MAAM,CAI5E;AAgYD;;;GAGG;AACH,wBAAgB,SAAS,CAAC,EAAE,EAAE,SAAS,EAAE,OAAO,GAAE,cAAmB,GAAG,MAAM,CAE7E;AAED,wCAAwC;AACxC,MAAM,WAAW,aAAa;IAC5B,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAC;IACrB,yCAAyC;IACzC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,iEAAiE;IACjE,QAAQ,CAAC,WAAW,EAAE,UAAU,EAAE,CAAC;CACpC;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,YAAY,GAAG,IAAI,CAAC,cAAc,EAAE,WAAW,CAAC,GAAG,aAAa,CAOzH"}