@tsplc/compiler 0.5.13 → 0.5.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -8
- package/dist/cli.js +794 -621
- package/dist/cli.js.map +19 -16
- package/dist/clock.js +5 -2
- package/dist/clock.js.map +5 -4
- package/dist/codesys.js +4162 -4157
- package/dist/codesys.js.map +43 -29
- package/dist/index.js +7852 -6549
- package/dist/index.js.map +53 -50
- package/dist/ir.js +2482 -2277
- package/dist/ir.js.map +28 -25
- package/dist/retain.js +3 -1
- package/dist/retain.js.map +3 -3
- package/dist/signals.js +115 -0
- package/dist/signals.js.map +10 -0
- package/dist/telemetry.js +25 -20
- package/dist/telemetry.js.map +6 -6
- package/package.json +19 -39
- package/src/codesys/config.ts +3 -3
- package/src/codesys/debug.ts +92 -108
- package/src/codesys/emit.ts +100 -88
- package/src/codesys/endpoints.ts +111 -0
- package/src/codesys/engineering.ts +30 -54
- package/src/codesys/explain/expressions.ts +445 -0
- package/src/codesys/explain/flags.ts +134 -0
- package/src/codesys/explain/parameters.ts +53 -0
- package/src/codesys/explain/rows.ts +182 -0
- package/src/codesys/explain/tables.ts +79 -0
- package/src/codesys/explain/tasks.ts +68 -0
- package/src/codesys/explain/writes.ts +497 -0
- package/src/codesys/explain.ts +85 -1401
- package/src/codesys/expressions.ts +41 -33
- package/src/codesys/global-lists.ts +114 -94
- package/src/codesys/global-names.ts +12 -14
- package/src/codesys/http.ts +428 -388
- package/src/codesys/instrumentation.ts +142 -148
- package/src/codesys/io-paths.ts +31 -23
- package/src/codesys/loops.ts +101 -0
- package/src/codesys/manifest.ts +269 -269
- package/src/codesys/names.ts +10 -33
- package/src/codesys/numeric.ts +89 -42
- package/src/codesys/plan.ts +202 -190
- package/src/codesys/programs.ts +23 -16
- package/src/codesys/publication.ts +13 -86
- package/src/codesys/required.ts +8 -0
- package/src/codesys/routines.ts +103 -489
- package/src/codesys/scheduling.ts +96 -0
- package/src/codesys/service-channels.ts +23 -0
- package/src/codesys/sources.ts +34 -28
- package/src/codesys/st-files.ts +112 -105
- package/src/codesys/statements.ts +409 -0
- package/src/codesys/storage.ts +41 -23
- package/src/codesys/symbols.ts +130 -119
- package/src/codesys/task-access.ts +65 -221
- package/src/codesys/telemetry-settings.ts +19 -0
- package/src/codesys/telemetry.ts +185 -148
- package/src/codesys/types.ts +69 -109
- package/src/codesys/vendor.ts +13 -50
- package/src/frontend/analyzer.ts +66 -111
- package/src/frontend/async.ts +316 -128
- package/src/frontend/blocks.ts +178 -154
- package/src/frontend/configuration.ts +49 -153
- package/src/frontend/const-functions.ts +50 -40
- package/src/frontend/control-flow.ts +164 -129
- package/src/frontend/cooperative.ts +17 -9
- package/src/frontend/coroutines.ts +539 -441
- package/src/frontend/dialect-names.ts +104 -0
- package/src/frontend/elaborate/array-searches.ts +77 -69
- package/src/frontend/elaborate/assignments.ts +68 -77
- package/src/frontend/elaborate/calls.ts +878 -512
- package/src/frontend/elaborate/capture-protocol.ts +118 -21
- package/src/frontend/elaborate/capture.ts +196 -109
- package/src/frontend/elaborate/declarations.ts +124 -0
- package/src/frontend/elaborate/dialect.ts +119 -46
- package/src/frontend/elaborate/expressions.ts +763 -442
- package/src/frontend/elaborate/filtered-arrays.ts +127 -91
- package/src/frontend/elaborate/frame.ts +50 -2
- package/src/frontend/elaborate/generics.ts +20 -34
- package/src/frontend/elaborate/graph.ts +13 -87
- package/src/frontend/elaborate/imports.ts +0 -5
- package/src/frontend/elaborate/index.ts +416 -169
- package/src/frontend/elaborate/initializers.ts +64 -42
- package/src/frontend/elaborate/iterators.ts +228 -364
- package/src/frontend/elaborate/layouts.ts +477 -116
- package/src/frontend/elaborate/model.ts +113 -55
- package/src/frontend/elaborate/references.ts +116 -138
- package/src/frontend/elaborate/retention.ts +137 -59
- package/src/frontend/elaborate/specialize.ts +617 -308
- package/src/frontend/elaborate/statements.ts +436 -247
- package/src/frontend/elaborate/storage.ts +280 -213
- package/src/frontend/elaborate/time-constructors.ts +34 -0
- package/src/frontend/elaborate/values.ts +77 -7
- package/src/frontend/elaborate/writes.ts +98 -84
- package/src/frontend/expressions.ts +149 -151
- package/src/frontend/generated-names.ts +3 -3
- package/src/frontend/intrinsics.ts +31 -17
- package/src/frontend/lowering-key.ts +23 -0
- package/src/frontend/module-graph.ts +105 -43
- package/src/frontend/positions.ts +43 -35
- package/src/frontend/promise-chains.ts +226 -266
- package/src/frontend/promises.ts +88 -67
- package/src/frontend/routines.ts +122 -65
- package/src/frontend/sdk.ts +104 -5
- package/src/frontend/services.ts +149 -102
- package/src/frontend/statements.ts +60 -64
- package/src/frontend/tasks.ts +151 -96
- package/src/frontend/telemetry.ts +1 -1
- package/src/frontend/types.ts +366 -181
- package/src/frontend/typescript.ts +239 -112
- package/src/index.ts +2 -1
- package/src/ir/aggregates.ts +90 -75
- package/src/ir/allocation.ts +29 -18
- package/src/ir/conditions.ts +38 -78
- package/src/ir/core-model.ts +128 -11
- package/src/ir/declarations.ts +18 -32
- package/src/ir/diagnostics.ts +25 -18
- package/src/ir/domains.ts +26 -23
- package/src/ir/fold.ts +55 -50
- package/src/ir/identity.ts +10 -0
- package/src/ir/index.ts +31 -7
- package/src/ir/job-errors.ts +30 -8
- package/src/ir/layouts.ts +63 -34
- package/src/ir/link.ts +11 -46
- package/src/ir/model.ts +25 -6
- package/src/ir/normalize.ts +3 -28
- package/src/ir/numeric.ts +45 -18
- package/src/ir/operands.ts +102 -0
- package/src/ir/ranges.ts +242 -67
- package/src/ir/routine.ts +126 -183
- package/src/ir/scalars.ts +29 -25
- package/src/ir/share.ts +323 -343
- package/src/ir/short-circuit.ts +140 -0
- package/src/ir/tables.ts +111 -0
- package/src/ir/temporaries.ts +15 -113
- package/src/ir/types.ts +32 -8
- package/src/project/artifacts.ts +143 -71
- package/src/project/cli.ts +104 -87
- package/src/project/debugger.ts +48 -34
- package/src/project/deployments.ts +12 -68
- package/src/project/flags.ts +14 -0
- package/src/project/plant.ts +293 -225
- package/src/project/project-commands.ts +254 -192
- package/src/project/project.ts +184 -141
- package/src/project/release.ts +22 -28
- package/src/project/server.ts +22 -26
- package/src/project/terminal.ts +13 -2
- package/src/runtime/async.ts +17 -13
- package/src/runtime/launch.ts +5 -2
- package/src/runtime/main.ts +8 -3
- package/src/runtime/missing-file.ts +3 -0
- package/src/runtime/process.ts +24 -19
- package/src/runtime/program.ts +20 -53
- package/src/runtime/retain.ts +18 -10
- package/src/runtime/runtime.ts +47 -60
- package/src/runtime/settings.ts +27 -0
- package/src/runtime/storage.ts +49 -74
- package/src/runtime/symbols.ts +19 -75
- package/src/runtime/telemetry.ts +37 -14
- package/src/runtime/transport.ts +26 -30
- package/stdlib/clock.ts +4 -2
- package/stdlib/plc-time.ts +2 -0
- package/stdlib/retain.ts +2 -0
- package/stdlib/signals.ts +142 -0
- package/stdlib/telemetry.ts +5 -12
- package/types/dialect.d.ts +49 -0
- package/types/globals.d.ts +2 -42
- package/types/index.d.ts +3 -1
- package/types/retain.d.ts +8 -2
- package/types/telemetry.d.ts +3 -0
- package/dist/bun-runtime.js +0 -1472
- package/dist/bun-runtime.js.map +0 -26
- package/dist/elaborate-capture.js +0 -304
- package/dist/elaborate-capture.js.map +0 -11
- package/dist/math.js +0 -24
- package/dist/math.js.map +0 -10
- package/dist/project.js +0 -626
- package/dist/project.js.map +0 -12
- package/dist/server-check.js +0 -59
- package/dist/server-check.js.map +0 -11
- package/src/frontend/exposure.ts +0 -181
- package/src/project/index.ts +0 -6
- package/src/runtime/.runtime-65O4JH/server/router.ts +0 -17
- package/src/runtime/.runtime-65O4JH/src/cell.ts +0 -45
- package/src/runtime/.runtime-65O4JH/src/controller.ts +0 -58
- package/src/runtime/.runtime-65O4JH/src/lane.ts +0 -6
- package/src/runtime/.runtime-65O4JH/src/main.ts +0 -11
- package/src/runtime/.runtime-65O4JH/src/services.ts +0 -8
- package/src/runtime/.runtime-65O4JH/tsconfig.json +0 -13
- package/src/runtime/.runtime-65O4JH/tsplc.config.ts +0 -31
- package/src/runtime/.runtime-Brw2kO/server/router.ts +0 -17
- package/src/runtime/.runtime-Brw2kO/src/cell.ts +0 -45
- package/src/runtime/.runtime-Brw2kO/src/controller.ts +0 -58
- package/src/runtime/.runtime-Brw2kO/src/lane.ts +0 -6
- package/src/runtime/.runtime-Brw2kO/src/main.ts +0 -11
- package/src/runtime/.runtime-Brw2kO/src/services.ts +0 -8
- package/src/runtime/.runtime-Brw2kO/tsconfig.json +0 -13
- package/src/runtime/.runtime-Brw2kO/tsplc.config.ts +0 -31
- package/src/runtime/.runtime-NHfu1D/server/router.ts +0 -17
- package/src/runtime/.runtime-NHfu1D/src/cell.ts +0 -45
- package/src/runtime/.runtime-NHfu1D/src/controller.ts +0 -58
- package/src/runtime/.runtime-NHfu1D/src/lane.ts +0 -6
- package/src/runtime/.runtime-NHfu1D/src/main.ts +0 -11
- package/src/runtime/.runtime-NHfu1D/src/services.ts +0 -8
- package/src/runtime/.runtime-NHfu1D/tsconfig.json +0 -13
- package/src/runtime/.runtime-NHfu1D/tsplc.config.ts +0 -31
- package/src/runtime/.runtime-VaUSOu/server/router.ts +0 -17
- package/src/runtime/.runtime-VaUSOu/src/cell.ts +0 -45
- package/src/runtime/.runtime-VaUSOu/src/controller.ts +0 -58
- package/src/runtime/.runtime-VaUSOu/src/lane.ts +0 -6
- package/src/runtime/.runtime-VaUSOu/src/main.ts +0 -11
- package/src/runtime/.runtime-VaUSOu/src/services.ts +0 -8
- package/src/runtime/.runtime-VaUSOu/tsconfig.json +0 -13
- package/src/runtime/.runtime-VaUSOu/tsplc.config.ts +0 -31
- package/src/runtime/.runtime-WbtNvR/server/router.ts +0 -17
- package/src/runtime/.runtime-WbtNvR/src/cell.ts +0 -45
- package/src/runtime/.runtime-WbtNvR/src/controller.ts +0 -58
- package/src/runtime/.runtime-WbtNvR/src/lane.ts +0 -6
- package/src/runtime/.runtime-WbtNvR/src/main.ts +0 -11
- package/src/runtime/.runtime-WbtNvR/src/services.ts +0 -8
- package/src/runtime/.runtime-WbtNvR/tsconfig.json +0 -13
- package/src/runtime/.runtime-WbtNvR/tsplc.config.ts +0 -31
- package/src/runtime/.runtime-opcua-GMPUt8/server/router.ts +0 -17
- package/src/runtime/.runtime-opcua-GMPUt8/src/cell.ts +0 -45
- package/src/runtime/.runtime-opcua-GMPUt8/src/controller.ts +0 -58
- package/src/runtime/.runtime-opcua-GMPUt8/src/lane.ts +0 -6
- package/src/runtime/.runtime-opcua-GMPUt8/src/main.ts +0 -11
- package/src/runtime/.runtime-opcua-GMPUt8/src/services.ts +0 -8
- package/src/runtime/.runtime-opcua-GMPUt8/tsconfig.json +0 -13
- package/src/runtime/.runtime-opcua-GMPUt8/tsplc.config.ts +0 -31
- package/src/runtime/.runtime-opcua-UwafxO/server/router.ts +0 -17
- package/src/runtime/.runtime-opcua-UwafxO/src/cell.ts +0 -45
- package/src/runtime/.runtime-opcua-UwafxO/src/controller.ts +0 -58
- package/src/runtime/.runtime-opcua-UwafxO/src/lane.ts +0 -6
- package/src/runtime/.runtime-opcua-UwafxO/src/main.ts +0 -11
- package/src/runtime/.runtime-opcua-UwafxO/src/services.ts +0 -8
- package/src/runtime/.runtime-opcua-UwafxO/tsconfig.json +0 -13
- package/src/runtime/.runtime-opcua-UwafxO/tsplc.config.ts +0 -31
- package/src/runtime/.runtime-opcua-ecaSee/server/router.ts +0 -17
- package/src/runtime/.runtime-opcua-ecaSee/src/cell.ts +0 -45
- package/src/runtime/.runtime-opcua-ecaSee/src/controller.ts +0 -58
- package/src/runtime/.runtime-opcua-ecaSee/src/lane.ts +0 -6
- package/src/runtime/.runtime-opcua-ecaSee/src/main.ts +0 -11
- package/src/runtime/.runtime-opcua-ecaSee/src/services.ts +0 -8
- package/src/runtime/.runtime-opcua-ecaSee/tsconfig.json +0 -13
- package/src/runtime/.runtime-opcua-ecaSee/tsplc.config.ts +0 -31
- package/src/runtime/.runtime-opcua-y91UCm/server/router.ts +0 -17
- package/src/runtime/.runtime-opcua-y91UCm/src/cell.ts +0 -45
- package/src/runtime/.runtime-opcua-y91UCm/src/controller.ts +0 -58
- package/src/runtime/.runtime-opcua-y91UCm/src/lane.ts +0 -6
- package/src/runtime/.runtime-opcua-y91UCm/src/main.ts +0 -11
- package/src/runtime/.runtime-opcua-y91UCm/src/services.ts +0 -8
- package/src/runtime/.runtime-opcua-y91UCm/tsconfig.json +0 -13
- package/src/runtime/.runtime-opcua-y91UCm/tsplc.config.ts +0 -31
- package/src/runtime/.runtime-ybIxYh/server/router.ts +0 -17
- package/src/runtime/.runtime-ybIxYh/src/cell.ts +0 -45
- package/src/runtime/.runtime-ybIxYh/src/controller.ts +0 -58
- package/src/runtime/.runtime-ybIxYh/src/lane.ts +0 -6
- package/src/runtime/.runtime-ybIxYh/src/main.ts +0 -11
- package/src/runtime/.runtime-ybIxYh/src/services.ts +0 -8
- package/src/runtime/.runtime-ybIxYh/tsconfig.json +0 -13
- package/src/runtime/.runtime-ybIxYh/tsplc.config.ts +0 -31
- package/stdlib/math.ts +0 -23
- package/types/plc.d.ts +0 -4
package/src/codesys/debug.ts
CHANGED
|
@@ -1,20 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import {
|
|
2
|
+
type CoreExpression,
|
|
3
|
+
type CoreFunction,
|
|
4
|
+
type CoreFunctionBlock,
|
|
5
|
+
type CorePath,
|
|
6
|
+
type CoreStatement,
|
|
7
|
+
type CoreTables,
|
|
8
|
+
constantIndex,
|
|
9
|
+
coreTables,
|
|
10
|
+
type Deployment,
|
|
11
|
+
directWrites,
|
|
12
|
+
instancedBlock,
|
|
13
|
+
isBlockRoutine,
|
|
14
|
+
isTemporary,
|
|
15
|
+
nestedBodies,
|
|
16
|
+
type SourceSpan,
|
|
17
|
+
type Variable,
|
|
18
|
+
type VerifiedCoreModule,
|
|
13
19
|
} from "@tsplc/compiler/ir";
|
|
14
|
-
import { directWrites, instancedBlock, nestedBodies } from "@tsplc/compiler/ir";
|
|
15
20
|
import type { ResolvedDebugConfig } from "@tsplc/config";
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
21
|
+
import { neverWrittenSlot } from "@tsplc/debug/manifest";
|
|
22
|
+
import { required } from "./required";
|
|
23
|
+
import { storagePath } from "./storage";
|
|
24
|
+
import { routineTasks } from "./task-access";
|
|
18
25
|
|
|
19
26
|
type Routine = CoreFunction | CoreFunctionBlock;
|
|
20
27
|
|
|
@@ -66,7 +73,7 @@ interface WriterSite {
|
|
|
66
73
|
}
|
|
67
74
|
|
|
68
75
|
/** An output the program drives: a logical output, or a storage path bound to a %Q address. */
|
|
69
|
-
interface Output {
|
|
76
|
+
export interface Output {
|
|
70
77
|
key: string;
|
|
71
78
|
root: Variable;
|
|
72
79
|
segments: readonly (
|
|
@@ -80,12 +87,8 @@ export type InstancePath = readonly { variable: Variable; index?: number }[];
|
|
|
80
87
|
|
|
81
88
|
type Load = CoreExpression & { kind: "load" };
|
|
82
89
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
const constantIndex = (value: CoreExpression): number | undefined =>
|
|
86
|
-
value.kind === "constant" && value.value.kind === "integer"
|
|
87
|
-
? Number(value.value.value)
|
|
88
|
-
: undefined;
|
|
90
|
+
/** A call in a loop may run any number of times a scan: counted as two, it is never the only call. */
|
|
91
|
+
const callsInLoop = 2;
|
|
89
92
|
|
|
90
93
|
/** The place a statement writes directly: an assignment's, or a call's stored result, written as directly. */
|
|
91
94
|
const writtenPlace = (
|
|
@@ -111,8 +114,7 @@ const wholeTarget = (item: CoreStatement): string | undefined => {
|
|
|
111
114
|
export function blockInstances(
|
|
112
115
|
core: VerifiedCoreModule,
|
|
113
116
|
): Map<string, InstancePath[]> {
|
|
114
|
-
const types =
|
|
115
|
-
const blocks = new Map(core.blocks.map((block) => [block.id, block]));
|
|
117
|
+
const { types, blockOf } = coreTables(core);
|
|
116
118
|
const instances = new Map<string, InstancePath[]>(
|
|
117
119
|
core.blocks.map((block) => [block.id, []]),
|
|
118
120
|
);
|
|
@@ -130,8 +132,8 @@ export function blockInstances(
|
|
|
130
132
|
])
|
|
131
133
|
: [[...path, { variable }]];
|
|
132
134
|
for (const instance of declared) {
|
|
133
|
-
instances.get(block)
|
|
134
|
-
for (const child of
|
|
135
|
+
required(instances.get(block)).push(instance);
|
|
136
|
+
for (const child of blockOf(block).state) {
|
|
135
137
|
const instanced = instancedBlock(child.type, types);
|
|
136
138
|
if (instanced) {
|
|
137
139
|
visit(child, instanced.block, instance);
|
|
@@ -149,7 +151,7 @@ export function blockInstances(
|
|
|
149
151
|
}
|
|
150
152
|
|
|
151
153
|
/** The TypeScript path of a module storage place, when every index is constant. */
|
|
152
|
-
export function
|
|
154
|
+
export function typescriptPath(
|
|
153
155
|
root: Variable,
|
|
154
156
|
path: CorePath = [],
|
|
155
157
|
): string | undefined {
|
|
@@ -157,21 +159,33 @@ export function storagePath(
|
|
|
157
159
|
if (!logical && root.storage !== "module" && root.storage !== "instance") {
|
|
158
160
|
return undefined;
|
|
159
161
|
}
|
|
160
|
-
|
|
162
|
+
const segments: string[] = [];
|
|
161
163
|
for (const segment of path) {
|
|
162
164
|
if (segment.kind === "field") {
|
|
163
|
-
|
|
165
|
+
segments.push(`.${segment.name}`);
|
|
164
166
|
continue;
|
|
165
167
|
}
|
|
166
168
|
const index = constantIndex(segment.value);
|
|
167
169
|
if (index === undefined) {
|
|
168
170
|
return undefined;
|
|
169
171
|
}
|
|
170
|
-
|
|
172
|
+
segments.push(`[${index}]`);
|
|
171
173
|
}
|
|
172
|
-
return
|
|
174
|
+
return `${logical ? root.name : storagePath(root)}${segments.join("")}`;
|
|
173
175
|
}
|
|
174
176
|
|
|
177
|
+
/** The TypeScript path of a block instance. */
|
|
178
|
+
export const instanceText = (path: InstancePath): string =>
|
|
179
|
+
path
|
|
180
|
+
.map(({ variable, index }, position) => {
|
|
181
|
+
const name =
|
|
182
|
+
position === 0
|
|
183
|
+
? (typescriptPath(variable) ?? variable.name)
|
|
184
|
+
: `.${variable.name}`;
|
|
185
|
+
return index === undefined ? name : `${name}[${index}]`;
|
|
186
|
+
})
|
|
187
|
+
.join("");
|
|
188
|
+
|
|
175
189
|
/**
|
|
176
190
|
* Where the debugger looks: which task runs each routine, every block instance, and the
|
|
177
191
|
* probes each instrumented statement gets. Probes follow `debug`; with no settings there are none.
|
|
@@ -196,16 +210,14 @@ export class DebugAnalysis {
|
|
|
196
210
|
private readonly callSites = new Map<string, number>();
|
|
197
211
|
/** Blocks that contain a service call, so they carry the requesting job's id down to it. */
|
|
198
212
|
readonly carriers = new Set<string>();
|
|
199
|
-
readonly
|
|
200
|
-
private readonly types;
|
|
201
|
-
private readonly routines;
|
|
202
|
-
private readonly blocks;
|
|
213
|
+
private readonly tables: CoreTables;
|
|
203
214
|
private readonly routineWrites = new Map<string, ReadonlySet<string>>();
|
|
204
215
|
private readonly temporaries = new Map<
|
|
205
216
|
string,
|
|
206
217
|
ReadonlyMap<string, readonly CoreStatement[]>
|
|
207
218
|
>();
|
|
208
|
-
|
|
219
|
+
/** The last writer site id given out; the first follows the id of a slot never written. */
|
|
220
|
+
private writerSites = neverWrittenSlot;
|
|
209
221
|
|
|
210
222
|
constructor(
|
|
211
223
|
private readonly core: VerifiedCoreModule,
|
|
@@ -213,15 +225,7 @@ export class DebugAnalysis {
|
|
|
213
225
|
settings: ResolvedDebugConfig | undefined,
|
|
214
226
|
readonly outputs: readonly Output[],
|
|
215
227
|
) {
|
|
216
|
-
this.
|
|
217
|
-
this.blocks = new Map(core.blocks.map((block) => [block.id, block]));
|
|
218
|
-
this.routines = new Map<string, Routine>(
|
|
219
|
-
[...core.functions, ...core.blocks].map((routine) => [
|
|
220
|
-
routine.id,
|
|
221
|
-
routine,
|
|
222
|
-
]),
|
|
223
|
-
);
|
|
224
|
-
this.variables = variablesById(core);
|
|
228
|
+
this.tables = coreTables(core);
|
|
225
229
|
this.writers = outputs.map(() => []);
|
|
226
230
|
this.tasks = routineTasks(core, deployment);
|
|
227
231
|
this.instances = blockInstances(core);
|
|
@@ -266,15 +270,15 @@ export class DebugAnalysis {
|
|
|
266
270
|
|
|
267
271
|
/** The instance path of a job declaration, when it declares exactly one instance. */
|
|
268
272
|
owningPath(variable: Variable): InstancePath | undefined {
|
|
269
|
-
const type = this.types.get(variable.type);
|
|
273
|
+
const type = this.tables.types.get(variable.type);
|
|
270
274
|
const block =
|
|
271
|
-
type?.kind === "block" ? this.
|
|
275
|
+
type?.kind === "block" ? this.tables.blockOf(type.block) : undefined;
|
|
272
276
|
if (!block?.job) {
|
|
273
277
|
return undefined;
|
|
274
278
|
}
|
|
275
|
-
const paths = this.instances
|
|
276
|
-
.
|
|
277
|
-
|
|
279
|
+
const paths = required(this.instances.get(block.id)).filter(
|
|
280
|
+
(path) => path.at(-1)?.variable.id === variable.id,
|
|
281
|
+
);
|
|
278
282
|
return paths.length === 1 ? paths[0] : undefined;
|
|
279
283
|
}
|
|
280
284
|
|
|
@@ -288,12 +292,12 @@ export class DebugAnalysis {
|
|
|
288
292
|
|
|
289
293
|
private findCarriers(): void {
|
|
290
294
|
const carries = (id: string): boolean => {
|
|
291
|
-
const block = this.
|
|
295
|
+
const block = this.tables.blockOf(id);
|
|
292
296
|
if (block.runtime?.kind === "http") {
|
|
293
297
|
return true;
|
|
294
298
|
}
|
|
295
299
|
return block.state.some((child) => {
|
|
296
|
-
const type = instancedBlock(child.type, this.types);
|
|
300
|
+
const type = instancedBlock(child.type, this.tables.types);
|
|
297
301
|
return type !== undefined && carries(type.block);
|
|
298
302
|
});
|
|
299
303
|
};
|
|
@@ -304,22 +308,6 @@ export class DebugAnalysis {
|
|
|
304
308
|
}
|
|
305
309
|
}
|
|
306
310
|
|
|
307
|
-
private placeType(root: Variable, path: CorePath = []): PlcType | undefined {
|
|
308
|
-
let type = this.types.get(root.type);
|
|
309
|
-
for (const segment of path) {
|
|
310
|
-
if (segment.kind === "field" && type?.kind === "record") {
|
|
311
|
-
type = this.types.get(
|
|
312
|
-
type.fields.find((field) => field.name === segment.name)!.type,
|
|
313
|
-
);
|
|
314
|
-
} else if (segment.kind === "index" && type?.kind === "array") {
|
|
315
|
-
type = this.types.get(type.element);
|
|
316
|
-
} else {
|
|
317
|
-
return undefined;
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
return type;
|
|
321
|
-
}
|
|
322
|
-
|
|
323
311
|
private countCalls(items: readonly CoreStatement[], weight: number): void {
|
|
324
312
|
for (const item of items) {
|
|
325
313
|
if (item.kind === "invoke") {
|
|
@@ -329,22 +317,20 @@ export class DebugAnalysis {
|
|
|
329
317
|
);
|
|
330
318
|
}
|
|
331
319
|
for (const body of nestedBodies(item)) {
|
|
332
|
-
this.countCalls(body, item.kind === "for" ?
|
|
320
|
+
this.countCalls(body, item.kind === "for" ? callsInLoop : weight);
|
|
333
321
|
}
|
|
334
322
|
}
|
|
335
323
|
}
|
|
336
324
|
|
|
337
325
|
/** Storage a routine can assign, including through every routine it calls. */
|
|
338
|
-
private writes(
|
|
339
|
-
const cached = this.routineWrites.get(id);
|
|
326
|
+
private writes(routine: Routine): ReadonlySet<string> {
|
|
327
|
+
const cached = this.routineWrites.get(routine.id);
|
|
340
328
|
if (cached) {
|
|
341
329
|
return cached;
|
|
342
330
|
}
|
|
343
331
|
const result = new Set<string>();
|
|
344
|
-
this.routineWrites.set(id, result);
|
|
345
|
-
for (const root of this.statementWrites(
|
|
346
|
-
this.routines.get(id)?.body ?? [],
|
|
347
|
-
)) {
|
|
332
|
+
this.routineWrites.set(routine.id, result);
|
|
333
|
+
for (const root of this.statementWrites(routine.body)) {
|
|
348
334
|
result.add(root);
|
|
349
335
|
}
|
|
350
336
|
return result;
|
|
@@ -356,22 +342,12 @@ export class DebugAnalysis {
|
|
|
356
342
|
for (const root of directWrites(item)) {
|
|
357
343
|
result.add(root);
|
|
358
344
|
}
|
|
359
|
-
|
|
360
|
-
|
|
345
|
+
const called = this.tables.calledRoutineOf(item);
|
|
346
|
+
if (called) {
|
|
347
|
+
for (const root of this.writes(called)) {
|
|
361
348
|
result.add(root);
|
|
362
349
|
}
|
|
363
350
|
}
|
|
364
|
-
if (item.kind === "blockUpdate") {
|
|
365
|
-
const block = instancedBlock(
|
|
366
|
-
this.variables.get(item.instance)!.type,
|
|
367
|
-
this.types,
|
|
368
|
-
);
|
|
369
|
-
if (block) {
|
|
370
|
-
for (const root of this.writes(block.block)) {
|
|
371
|
-
result.add(root);
|
|
372
|
-
}
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
351
|
for (const body of nestedBodies(item)) {
|
|
376
352
|
for (const root of this.statementWrites(body)) {
|
|
377
353
|
result.add(root);
|
|
@@ -424,29 +400,33 @@ export class DebugAnalysis {
|
|
|
424
400
|
const task = this.tasks.get(routine.id);
|
|
425
401
|
const probes: Probe[] = [];
|
|
426
402
|
const written = writtenPlace(item);
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
403
|
+
const reached =
|
|
404
|
+
written && settings.writers
|
|
405
|
+
? this.outputs.flatMap((output, index) => {
|
|
406
|
+
const when = this.reaches(written.root, written.path, output);
|
|
407
|
+
return when ? [{ index, when }] : [];
|
|
408
|
+
})
|
|
409
|
+
: [];
|
|
410
|
+
if (reached.length) {
|
|
411
|
+
const site = ++this.writerSites;
|
|
412
|
+
for (const { index, when } of reached) {
|
|
413
|
+
required(this.writers[index]).push({
|
|
436
414
|
id: site,
|
|
437
415
|
routine: routine.id,
|
|
438
416
|
span: item.span,
|
|
439
417
|
statement: item,
|
|
440
418
|
});
|
|
441
419
|
probes.push({ kind: "writer", site, output: index, when });
|
|
442
|
-
}
|
|
420
|
+
}
|
|
443
421
|
}
|
|
444
422
|
if (settings.trace && task) {
|
|
445
423
|
if (item.kind === "assign") {
|
|
446
|
-
const root = this.
|
|
447
|
-
const type = this.placeType(root, item.path);
|
|
424
|
+
const root = this.tables.variableOf(item.root);
|
|
425
|
+
const type = this.tables.placeType(root.type, item.path ?? []);
|
|
448
426
|
const path =
|
|
449
|
-
root.storage === "module"
|
|
427
|
+
root.storage === "module"
|
|
428
|
+
? typescriptPath(root, item.path)
|
|
429
|
+
: undefined;
|
|
450
430
|
if (type?.kind === "enum" && path) {
|
|
451
431
|
const operands = this.operands(
|
|
452
432
|
routine,
|
|
@@ -469,11 +449,11 @@ export class DebugAnalysis {
|
|
|
469
449
|
if (
|
|
470
450
|
item.kind === "return" &&
|
|
471
451
|
item.value &&
|
|
472
|
-
|
|
452
|
+
!isBlockRoutine(routine) &&
|
|
473
453
|
routine.result &&
|
|
474
454
|
this.callSites.get(routine.id) === 1
|
|
475
455
|
) {
|
|
476
|
-
const type = this.types.get(routine.result);
|
|
456
|
+
const type = this.tables.types.get(routine.result);
|
|
477
457
|
if (type?.kind === "enum") {
|
|
478
458
|
const slot = this.decisions.get(routine.id) ?? this.decisions.size;
|
|
479
459
|
this.decisions.set(routine.id, slot);
|
|
@@ -540,6 +520,10 @@ export class DebugAnalysis {
|
|
|
540
520
|
return when;
|
|
541
521
|
}
|
|
542
522
|
|
|
523
|
+
private isTemporary(routine: Routine, root: string): boolean {
|
|
524
|
+
return isTemporary(routine.id, this.tables.variableOf(root));
|
|
525
|
+
}
|
|
526
|
+
|
|
543
527
|
/** The statements that assign each temporary of a routine. */
|
|
544
528
|
private definitions(
|
|
545
529
|
routine: Routine,
|
|
@@ -552,7 +536,7 @@ export class DebugAnalysis {
|
|
|
552
536
|
const define = (items: readonly CoreStatement[]): void => {
|
|
553
537
|
for (const item of items) {
|
|
554
538
|
const target = wholeTarget(item);
|
|
555
|
-
if (target &&
|
|
539
|
+
if (target && this.isTemporary(routine, target)) {
|
|
556
540
|
definitions.set(target, [...(definitions.get(target) ?? []), item]);
|
|
557
541
|
}
|
|
558
542
|
for (const body of nestedBodies(item)) {
|
|
@@ -584,7 +568,7 @@ export class DebugAnalysis {
|
|
|
584
568
|
capture: CoreExpression,
|
|
585
569
|
read?: Load,
|
|
586
570
|
): void => {
|
|
587
|
-
const kind = this.types.get(capture.type)?.kind;
|
|
571
|
+
const kind = this.tables.types.get(capture.type)?.kind;
|
|
588
572
|
const key = `${span.file}:${span.start}:${span.end}`;
|
|
589
573
|
if (
|
|
590
574
|
seen.has(key) ||
|
|
@@ -594,7 +578,7 @@ export class DebugAnalysis {
|
|
|
594
578
|
}
|
|
595
579
|
seen.add(key);
|
|
596
580
|
const path =
|
|
597
|
-
read &&
|
|
581
|
+
read && typescriptPath(this.tables.variableOf(read.root), read.path);
|
|
598
582
|
result.push({
|
|
599
583
|
capture,
|
|
600
584
|
span,
|
|
@@ -620,7 +604,7 @@ export class DebugAnalysis {
|
|
|
620
604
|
if (value.kind !== "load") {
|
|
621
605
|
return;
|
|
622
606
|
}
|
|
623
|
-
if (!
|
|
607
|
+
if (!this.isTemporary(routine, value.root)) {
|
|
624
608
|
if (evaluated || direct(value)) {
|
|
625
609
|
add(value.span, value, value);
|
|
626
610
|
}
|
|
@@ -647,7 +631,7 @@ export class DebugAnalysis {
|
|
|
647
631
|
return;
|
|
648
632
|
}
|
|
649
633
|
const source = item.value;
|
|
650
|
-
if (source.kind === "load" && !
|
|
634
|
+
if (source.kind === "load" && !this.isTemporary(routine, source.root)) {
|
|
651
635
|
const read = {
|
|
652
636
|
...source,
|
|
653
637
|
type: value.type,
|
package/src/codesys/emit.ts
CHANGED
|
@@ -4,38 +4,33 @@ import type {
|
|
|
4
4
|
GeneratedObject,
|
|
5
5
|
SourceSpan,
|
|
6
6
|
} from "@tsplc/compiler/ir";
|
|
7
|
+
import { isBlockRoutine } from "@tsplc/compiler/ir";
|
|
7
8
|
import type { Publication } from "@tsplc/config";
|
|
8
9
|
import type { DebugManifest } from "@tsplc/debug/manifest";
|
|
10
|
+
import type { ServiceChannel } from "@tsplc/server/wire";
|
|
9
11
|
import { explainedWriters, explanations } from "./explain";
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
emitIoList,
|
|
13
|
-
type IoMapping,
|
|
14
|
-
ioTarget,
|
|
15
|
-
} from "./global-lists";
|
|
16
|
-
import {
|
|
17
|
-
emitServiceBlock,
|
|
18
|
-
httpNetwork,
|
|
19
|
-
type RpcChannel,
|
|
20
|
-
serviceBlock,
|
|
21
|
-
} from "./http";
|
|
12
|
+
import { emitGlobalLists, emitIoList, type IoMapping } from "./global-lists";
|
|
13
|
+
import { emitServiceBlock, httpNetwork, serviceBlock } from "./http";
|
|
22
14
|
import {
|
|
23
15
|
emitDebugGlobal,
|
|
24
16
|
emitTelemetry,
|
|
25
17
|
planInstrumentation,
|
|
26
18
|
} from "./instrumentation";
|
|
27
19
|
import { debugManifest } from "./manifest";
|
|
28
|
-
import { type CodesysPlan,
|
|
20
|
+
import { type CodesysPlan, isPlanned } from "./plan";
|
|
29
21
|
import { emitScanProgram, emitTaskWrappers } from "./programs";
|
|
30
|
-
import {
|
|
22
|
+
import { publishedSymbols } from "./publication";
|
|
31
23
|
import { emitRoutine } from "./routines";
|
|
24
|
+
import { serviceChannelsFile } from "./service-channels";
|
|
32
25
|
import { Sources } from "./sources";
|
|
33
|
-
import { stFiles } from "./st-files";
|
|
26
|
+
import { type ObjectMapping, type PlacedObject, stFiles } from "./st-files";
|
|
34
27
|
import {
|
|
35
|
-
|
|
28
|
+
allocateBlockMembers,
|
|
36
29
|
allocateFunctionNames,
|
|
37
30
|
allocateRoutineScope,
|
|
38
|
-
|
|
31
|
+
type CodesysSymbols,
|
|
32
|
+
type EmissionContext,
|
|
33
|
+
globalSymbols,
|
|
39
34
|
} from "./symbols";
|
|
40
35
|
|
|
41
36
|
export interface SourceMapping {
|
|
@@ -44,126 +39,143 @@ export interface SourceMapping {
|
|
|
44
39
|
span: SourceSpan;
|
|
45
40
|
}
|
|
46
41
|
|
|
47
|
-
type CodesysBundle = EmitResult & {
|
|
42
|
+
export type CodesysBundle = Omit<EmitResult, "objects"> & {
|
|
43
|
+
objects: PlacedObject[];
|
|
48
44
|
/** Variables a generated device tree maps to their bit or byte channels. */
|
|
49
45
|
ioMappings: readonly IoMapping[];
|
|
50
46
|
mappings: readonly SourceMapping[];
|
|
51
47
|
ioSymbols: Readonly<Record<string, string>>;
|
|
52
48
|
publication: Publication;
|
|
53
49
|
/** The debugger's view of this build; its id is also published as `build.target`. */
|
|
54
|
-
debug
|
|
50
|
+
debug: DebugManifest;
|
|
55
51
|
/** `explain.json`'s text, whose digest `debug` records. */
|
|
56
|
-
explain
|
|
52
|
+
explain: string;
|
|
57
53
|
};
|
|
58
54
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
55
|
+
/** The routines emitted as objects: every function, and every block CODESYS does not provide. */
|
|
56
|
+
const emittedRoutines = ({ core }: CodesysPlan) => [
|
|
57
|
+
...core.functions,
|
|
58
|
+
...core.blocks.filter((block) => !block.standard),
|
|
59
|
+
];
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Allocates every target name the emitters read, in the order that fixes them, with the objects
|
|
63
|
+
* emitted on the way: types, storage lists, the network, numeric helpers and telemetry. Each
|
|
64
|
+
* routine's scope reserves those objects' names, as an ST local must never shadow a helper,
|
|
65
|
+
* function, FB, or DUT that the implementation calls.
|
|
66
|
+
*/
|
|
67
|
+
function emissionContext(plan: CodesysPlan) {
|
|
73
68
|
const { core } = plan;
|
|
74
|
-
const
|
|
75
|
-
const
|
|
76
|
-
const
|
|
77
|
-
const
|
|
78
|
-
const
|
|
79
|
-
const network = httpNetwork(plan, symbols);
|
|
69
|
+
const global = globalSymbols(plan);
|
|
70
|
+
const planned = planInstrumentation(plan, global);
|
|
71
|
+
const globalLists = emitGlobalLists(plan, global);
|
|
72
|
+
const ioList = emitIoList(plan, global, globalLists.references);
|
|
73
|
+
const network = httpNetwork(plan, global);
|
|
80
74
|
const objects: GeneratedObject[] = [
|
|
81
|
-
...
|
|
75
|
+
...global.targetTypes.objects,
|
|
82
76
|
...globalLists.objects,
|
|
83
77
|
...ioList.objects,
|
|
84
78
|
...(network ? [network] : []),
|
|
85
79
|
];
|
|
86
|
-
const mappings: SourceMapping[] = [
|
|
87
|
-
...globalLists.mappings,
|
|
88
|
-
...ioList.mappings,
|
|
89
|
-
];
|
|
90
80
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
for (const fn of core.functions) {
|
|
95
|
-
symbols.numeric.prepareStatements(fn.body);
|
|
96
|
-
}
|
|
97
|
-
for (const block of core.blocks) {
|
|
98
|
-
symbols.numeric.prepareStatements(block.body);
|
|
81
|
+
const routineNames = allocateFunctionNames(plan, global);
|
|
82
|
+
for (const routine of [...core.functions, ...core.blocks]) {
|
|
83
|
+
global.numeric.prepareStatements(routine.body);
|
|
99
84
|
}
|
|
100
|
-
objects.push(...
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
const telemetry = emitTelemetry(
|
|
85
|
+
objects.push(...global.numeric.objects);
|
|
86
|
+
const members = allocateBlockMembers(
|
|
104
87
|
plan,
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
88
|
+
{ ...global, functionNames: routineNames },
|
|
89
|
+
planned,
|
|
90
|
+
objects,
|
|
108
91
|
);
|
|
92
|
+
const functionNames = new Map([...routineNames, ...members.methods]);
|
|
93
|
+
const instrumentation = { ...planned, fields: members.instrumented };
|
|
94
|
+
|
|
95
|
+
const telemetry = emitTelemetry(plan, global, instrumentation, network?.name);
|
|
109
96
|
objects.push(...telemetry.objects);
|
|
110
|
-
const
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
97
|
+
const scopes = new Map(
|
|
98
|
+
emittedRoutines(plan).map((fn) => [
|
|
99
|
+
fn.id,
|
|
100
|
+
allocateRoutineScope(
|
|
101
|
+
{ ...global, functionNames, blockFields: members.fields },
|
|
102
|
+
objects,
|
|
103
|
+
instrumentation.global,
|
|
104
|
+
fn,
|
|
105
|
+
),
|
|
106
|
+
]),
|
|
107
|
+
);
|
|
108
|
+
const symbols: CodesysSymbols = {
|
|
109
|
+
...global,
|
|
110
|
+
references: new Map([...globalLists.references, ...ioList.references]),
|
|
111
|
+
functionNames,
|
|
112
|
+
blockFields: members.fields,
|
|
113
|
+
mailboxLocks: members.mailboxLocks,
|
|
114
|
+
programResults: new Map(
|
|
115
|
+
[...scopes].flatMap(([id, { result }]) => (result ? [[id, result]] : [])),
|
|
116
|
+
),
|
|
117
|
+
routineScopes: new Map([...scopes].map(([id, { scope }]) => [id, scope])),
|
|
118
|
+
};
|
|
119
|
+
const context: EmissionContext = { plan, symbols, instrumentation };
|
|
120
|
+
return {
|
|
121
|
+
context,
|
|
122
|
+
objects,
|
|
123
|
+
mappings: [...globalLists.mappings, ...ioList.mappings],
|
|
124
|
+
ioList,
|
|
125
|
+
network,
|
|
126
|
+
rpcChannels: telemetry.rpcChannels,
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export function emitCodesys(plan: CodesysPlan): CodesysBundle {
|
|
131
|
+
if (!isPlanned(plan)) {
|
|
132
|
+
throw new Error("Emission requires a validated CODESYS plan.");
|
|
116
133
|
}
|
|
117
|
-
const rpcChannels
|
|
118
|
-
|
|
119
|
-
|
|
134
|
+
const { context, objects, mappings, ioList, network, rpcChannels } =
|
|
135
|
+
emissionContext(plan);
|
|
136
|
+
const channels: ServiceChannel[] = [...rpcChannels];
|
|
137
|
+
const lines: ObjectMapping[] = [...mappings];
|
|
138
|
+
for (const fn of emittedRoutines(plan)) {
|
|
139
|
+
if (isBlockRoutine(fn) && serviceBlock(fn)) {
|
|
120
140
|
const service = emitServiceBlock(context, network?.name, fn);
|
|
121
141
|
objects.push(...service.objects);
|
|
122
|
-
|
|
142
|
+
channels.push(...service.rpcChannels);
|
|
123
143
|
continue;
|
|
124
144
|
}
|
|
125
145
|
const routine = emitRoutine(context, fn);
|
|
126
146
|
objects.push(...routine.objects);
|
|
127
|
-
|
|
147
|
+
lines.push(...routine.mappings);
|
|
128
148
|
}
|
|
129
|
-
for (const program of core.programs) {
|
|
149
|
+
for (const program of plan.core.programs) {
|
|
130
150
|
objects.push(emitScanProgram(context, ioList.channels, program));
|
|
131
151
|
}
|
|
132
152
|
objects.push(...emitTaskWrappers(context, objects));
|
|
133
153
|
// Explanations index the manifest's sources and functions, and its digest of them feeds the build id.
|
|
134
154
|
const sources = new Sources(plan.project.root);
|
|
135
|
-
const functionIds =
|
|
136
|
-
const manifest = debugManifest(
|
|
137
|
-
context,
|
|
138
|
-
(key) => ioTarget(plan, symbols, key),
|
|
139
|
-
sources,
|
|
140
|
-
functionIds,
|
|
141
|
-
);
|
|
155
|
+
const { manifest, functionIds } = debugManifest(context, sources);
|
|
142
156
|
const explained = explanations(context, manifest, sources, functionIds);
|
|
143
157
|
const explain = JSON.stringify(explained.file);
|
|
144
|
-
const debug = emitDebugGlobal(plan, instrumentation, objects, {
|
|
158
|
+
const debug = emitDebugGlobal(plan, context.instrumentation, objects, {
|
|
145
159
|
...manifest,
|
|
146
160
|
writers: explainedWriters(
|
|
147
161
|
manifest,
|
|
148
162
|
explained,
|
|
149
|
-
instrumentation.analysis.writers,
|
|
163
|
+
context.instrumentation.analysis.writers,
|
|
150
164
|
),
|
|
151
165
|
explain: { sha256: createHash("sha256").update(explain).digest("hex") },
|
|
152
166
|
});
|
|
167
|
+
const placed = stFiles(context, objects, lines);
|
|
153
168
|
|
|
154
169
|
return {
|
|
155
|
-
artifacts: [
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
],
|
|
159
|
-
objects,
|
|
160
|
-
mappings,
|
|
170
|
+
artifacts: [...placed.artifacts, serviceChannelsFile(channels)],
|
|
171
|
+
objects: placed.objects,
|
|
172
|
+
mappings: placed.mappings,
|
|
161
173
|
ioSymbols: Object.fromEntries([
|
|
162
174
|
...ioList.channels.map((channel) => [channel.key, channel.target]),
|
|
163
175
|
...ioList.ioMappings.map((mapping) => [mapping.key, mapping.variable]),
|
|
164
176
|
]),
|
|
165
177
|
ioMappings: ioList.ioMappings,
|
|
166
|
-
publication: publishedSymbols(
|
|
178
|
+
publication: publishedSymbols(context, channels),
|
|
167
179
|
debug,
|
|
168
180
|
explain,
|
|
169
181
|
diagnostics: [],
|