@tsplc/compiler 0.5.3 → 0.5.4

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 (101) hide show
  1. package/dist/bun-runtime.js.map +7 -7
  2. package/dist/cli.js.map +8 -8
  3. package/dist/codesys.js +2 -2
  4. package/dist/codesys.js.map +23 -23
  5. package/dist/elaborate-capture.js.map +1 -1
  6. package/dist/index.js.map +35 -35
  7. package/dist/ir.js.map +19 -19
  8. package/dist/project.js.map +1 -1
  9. package/dist/server-check.js.map +1 -1
  10. package/dist/telemetry.js.map +1 -1
  11. package/package.json +9 -9
  12. package/src/codesys/config.ts +2 -2
  13. package/src/codesys/debug.ts +2 -2
  14. package/src/codesys/emit.ts +10 -10
  15. package/src/codesys/engineering.ts +1 -1
  16. package/src/codesys/expressions.ts +1 -1
  17. package/src/codesys/global-lists.ts +6 -6
  18. package/src/codesys/global-names.ts +3 -3
  19. package/src/codesys/http.ts +3 -3
  20. package/src/codesys/index.ts +8 -8
  21. package/src/codesys/instrumentation.ts +9 -13
  22. package/src/codesys/io-paths.ts +1 -1
  23. package/src/codesys/manifest.ts +5 -5
  24. package/src/codesys/plan.ts +9 -9
  25. package/src/codesys/programs.ts +3 -3
  26. package/src/codesys/publication.ts +4 -4
  27. package/src/codesys/routines.ts +5 -5
  28. package/src/codesys/st-files.ts +4 -4
  29. package/src/codesys/symbols.ts +6 -6
  30. package/src/codesys/telemetry.ts +6 -6
  31. package/src/codesys/types.ts +2 -2
  32. package/src/codesys/vendor.ts +2 -2
  33. package/src/frontend/analyzer.ts +9 -9
  34. package/src/frontend/async.ts +6 -6
  35. package/src/frontend/blocks.ts +1 -1
  36. package/src/frontend/configuration.ts +4 -4
  37. package/src/frontend/const-functions.ts +2 -2
  38. package/src/frontend/cooperative.ts +1 -1
  39. package/src/frontend/coroutines.ts +6 -6
  40. package/src/frontend/elaborate/calls.ts +9 -12
  41. package/src/frontend/elaborate/capture.ts +1 -1
  42. package/src/frontend/elaborate/dialect.ts +7 -7
  43. package/src/frontend/elaborate/expressions.ts +12 -12
  44. package/src/frontend/elaborate/frame.ts +4 -4
  45. package/src/frontend/elaborate/graph.ts +1 -1
  46. package/src/frontend/elaborate/index.ts +12 -12
  47. package/src/frontend/elaborate/initializers.ts +4 -4
  48. package/src/frontend/elaborate/layouts.ts +3 -3
  49. package/src/frontend/elaborate/model.ts +1 -1
  50. package/src/frontend/elaborate/retention.ts +5 -5
  51. package/src/frontend/elaborate/specialize.ts +11 -11
  52. package/src/frontend/elaborate/statements.ts +8 -11
  53. package/src/frontend/elaborate/storage.ts +6 -11
  54. package/src/frontend/elaborate/values.ts +2 -2
  55. package/src/frontend/exposure.ts +3 -3
  56. package/src/frontend/expressions.ts +5 -5
  57. package/src/frontend/intrinsics.ts +2 -2
  58. package/src/frontend/module-graph.ts +1 -1
  59. package/src/frontend/promise-chains.ts +2 -2
  60. package/src/frontend/promises.ts +5 -5
  61. package/src/frontend/routines.ts +2 -2
  62. package/src/frontend/services.ts +3 -3
  63. package/src/frontend/statements.ts +4 -4
  64. package/src/frontend/tasks.ts +5 -10
  65. package/src/frontend/telemetry.ts +2 -2
  66. package/src/frontend/types.ts +1 -1
  67. package/src/frontend/typescript.ts +11 -15
  68. package/src/index.ts +1 -1
  69. package/src/ir/aggregates.ts +6 -6
  70. package/src/ir/allocation.ts +5 -5
  71. package/src/ir/core-model.ts +3 -3
  72. package/src/ir/declarations.ts +6 -6
  73. package/src/ir/domains.ts +3 -7
  74. package/src/ir/fold.ts +4 -9
  75. package/src/ir/index.ts +16 -16
  76. package/src/ir/layouts.ts +3 -3
  77. package/src/ir/link.ts +5 -5
  78. package/src/ir/model.ts +2 -2
  79. package/src/ir/normalization-error.ts +1 -1
  80. package/src/ir/normalize.ts +8 -8
  81. package/src/ir/numeric.ts +2 -2
  82. package/src/ir/operands.ts +2 -2
  83. package/src/ir/ranges.ts +4 -9
  84. package/src/ir/routine.ts +10 -15
  85. package/src/ir/scalars.ts +5 -5
  86. package/src/ir/share.ts +4 -4
  87. package/src/ir/temporaries.ts +4 -4
  88. package/src/project/cli.ts +3 -3
  89. package/src/project/debugger.ts +1 -1
  90. package/src/project/index.ts +1 -1
  91. package/src/project/plant.ts +2 -2
  92. package/src/project/project-commands.ts +3 -3
  93. package/src/project/project.ts +2 -2
  94. package/src/project/release.ts +2 -2
  95. package/src/project/server-check.ts +1 -1
  96. package/src/runtime/main.ts +2 -2
  97. package/src/runtime/process.ts +1 -1
  98. package/src/runtime/program.ts +2 -2
  99. package/src/runtime/retain.ts +1 -1
  100. package/src/runtime/runtime.ts +11 -16
  101. package/stdlib/telemetry.ts +2 -2
@@ -4,8 +4,8 @@ import type {
4
4
  EmitResult,
5
5
  GeneratedObject,
6
6
  } from "@tsplc/compiler/ir";
7
- import type { SourceMapping } from "./emit.ts";
8
- import { declarationFile } from "./st-files.ts";
7
+ import type { SourceMapping } from "./emit";
8
+ import { declarationFile } from "./st-files";
9
9
 
10
10
  type MappedBundle = Pick<EmitResult, "objects"> & {
11
11
  mappings: readonly SourceMapping[];
@@ -10,17 +10,17 @@ import {
10
10
  type Variable,
11
11
  } from "@tsplc/compiler/ir";
12
12
  import ts from "typescript";
13
- import { BlockResolver, storageInitializer } from "./blocks.ts";
13
+ import { BlockResolver, storageInitializer } from "./blocks";
14
14
  import {
15
15
  type AnalysisContext,
16
16
  ExpressionLowering,
17
17
  type LoweringScope,
18
- } from "./expressions.ts";
19
- import { runtimeSources } from "./module-graph.ts";
20
- import type { Positions } from "./positions.ts";
21
- import { methodAccess, RoutineTable } from "./routines.ts";
22
- import { inSdk, unaliased } from "./sdk.ts";
23
- import { StatementLowering } from "./statements.ts";
18
+ } from "./expressions";
19
+ import { runtimeSources } from "./module-graph";
20
+ import type { Positions } from "./positions";
21
+ import { methodAccess, RoutineTable } from "./routines";
22
+ import { inSdk, unaliased } from "./sdk";
23
+ import { StatementLowering } from "./statements";
24
24
  import {
25
25
  type Fail,
26
26
  hasModifier,
@@ -29,8 +29,8 @@ import {
29
29
  type ResolvedType,
30
30
  SemanticError,
31
31
  TypeResolver,
32
- } from "./types.ts";
33
- import type { FrontendOptions } from "./typescript.ts";
32
+ } from "./types";
33
+ import type { FrontendOptions } from "./typescript";
34
34
 
35
35
  /** What a module variable's initializer and keyword establish about its storage. */
36
36
  interface StorageFacts {
@@ -7,8 +7,8 @@ import {
7
7
  type PlcProgram,
8
8
  } from "@tsplc/compiler/ir";
9
9
  import ts from "typescript";
10
- import { lowerCoroutine } from "./coroutines.ts";
11
- import { runtimeSources } from "./module-graph.ts";
10
+ import { lowerCoroutine } from "./coroutines";
11
+ import { runtimeSources } from "./module-graph";
12
12
  import {
13
13
  type Edit,
14
14
  edited,
@@ -18,10 +18,10 @@ import {
18
18
  mapped,
19
19
  type Positions,
20
20
  slice,
21
- } from "./positions.ts";
22
- import { namesSdk, symbolAt } from "./sdk.ts";
23
- import { lowerTaskDefinitions } from "./tasks.ts";
24
- import { hasModifier, SemanticError } from "./types.ts";
21
+ } from "./positions";
22
+ import { namesSdk, symbolAt } from "./sdk";
23
+ import { lowerTaskDefinitions } from "./tasks";
24
+ import { hasModifier, SemanticError } from "./types";
25
25
 
26
26
  export type Job = NonNullable<FunctionBlock["job"]>;
27
27
  /** A named async function or method. */
@@ -16,7 +16,7 @@ import {
16
16
  type Fail,
17
17
  numericLiteralType,
18
18
  type TypeResolver,
19
- } from "./types.ts";
19
+ } from "./types";
20
20
 
21
21
  export interface BlockSource {
22
22
  block: FunctionBlock;
@@ -1,9 +1,9 @@
1
1
  import { type Diagnostic, error } from "@tsplc/compiler/ir";
2
2
  import ts from "typescript";
3
- import { runtimeSources } from "./module-graph.ts";
4
- import { type Edit, edited, type Mapped, type Positions } from "./positions.ts";
5
- import { namesSdk, symbolAt } from "./sdk.ts";
6
- import type { CompileEnvironment } from "./typescript.ts";
3
+ import { runtimeSources } from "./module-graph";
4
+ import { type Edit, edited, type Mapped, type Positions } from "./positions";
5
+ import { namesSdk, symbolAt } from "./sdk";
6
+ import type { CompileEnvironment } from "./typescript";
7
7
 
8
8
  export const lowerEnvironment = (
9
9
  program: ts.Program,
@@ -1,6 +1,6 @@
1
1
  import { type Diagnostic, error } from "@tsplc/compiler/ir";
2
2
  import ts from "typescript";
3
- import { runtimeSources } from "./module-graph.ts";
3
+ import { runtimeSources } from "./module-graph";
4
4
  import {
5
5
  copied,
6
6
  type Edit,
@@ -11,7 +11,7 @@ import {
11
11
  mapped,
12
12
  type Part,
13
13
  type Positions,
14
- } from "./positions.ts";
14
+ } from "./positions";
15
15
 
16
16
  /** An arrow body as a function body: a block as written, or its expression returned (or, for void, evaluated). */
17
17
  const functionBody = (
@@ -1,5 +1,5 @@
1
1
  import { jobError } from "@tsplc/compiler/ir";
2
- import { mapped, type Part } from "./positions.ts";
2
+ import { mapped, type Part } from "./positions";
3
3
 
4
4
  interface Parameter {
5
5
  name: string;
@@ -7,10 +7,10 @@ import type {
7
7
  MethodMembers,
8
8
  Routine,
9
9
  SourceRewrite,
10
- } from "./async.ts";
11
- import { staticString } from "./configuration.ts";
12
- import { copyValue } from "./cooperative.ts";
13
- import { importSpecifier } from "./module-graph.ts";
10
+ } from "./async";
11
+ import { staticString } from "./configuration";
12
+ import { copyValue } from "./cooperative";
13
+ import { importSpecifier } from "./module-graph";
14
14
  import {
15
15
  copied,
16
16
  type Edit,
@@ -20,8 +20,8 @@ import {
20
20
  type Mapped,
21
21
  mapped,
22
22
  type Part,
23
- } from "./positions.ts";
24
- import { hasModifier } from "./types.ts";
23
+ } from "./positions";
24
+ import { hasModifier } from "./types";
25
25
 
26
26
  type Step = Job["steps"][number];
27
27
  /** What a step does when the operation it waits on fails; `cancellable` failures may be a cancel. */
@@ -7,24 +7,21 @@ import {
7
7
  type Mapped,
8
8
  mapped,
9
9
  type Part,
10
- } from "../positions.ts";
11
- import { declaredBySdk, inSdk, symbolAt } from "../sdk.ts";
12
- import type { DialectText } from "./dialect.ts";
13
- import type {
14
- ExpressionSpecializer,
15
- SpecializeContext,
16
- } from "./expressions.ts";
17
- import type { Frame } from "./frame.ts";
18
- import type { EntryImports } from "./imports.ts";
19
- import type { Model } from "./model.ts";
20
- import type { Storage } from "./storage.ts";
10
+ } from "../positions";
11
+ import { declaredBySdk, inSdk, symbolAt } from "../sdk";
12
+ import type { DialectText } from "./dialect";
13
+ import type { ExpressionSpecializer, SpecializeContext } from "./expressions";
14
+ import type { Frame } from "./frame";
15
+ import type { EntryImports } from "./imports";
16
+ import type { Model } from "./model";
17
+ import type { Storage } from "./storage";
21
18
  import {
22
19
  constant,
23
20
  type FunctionLike,
24
21
  repeatable,
25
22
  SpecializeError,
26
23
  type Value,
27
- } from "./values.ts";
24
+ } from "./values";
28
25
 
29
26
  /** Specializes calls: to what the language and SDK provide, to the service client, and to functions. */
30
27
  export class CallSpecializer {
@@ -16,7 +16,7 @@ import {
16
16
  type CaptureRequest,
17
17
  captureRequestSchema,
18
18
  withBindingRegistry,
19
- } from "./capture-protocol.ts";
19
+ } from "./capture-protocol";
20
20
 
21
21
  const request: CaptureRequest = captureRequestSchema.parse(
22
22
  JSON.parse(readFileSync(process.argv[2]!, "utf8")),
@@ -1,12 +1,12 @@
1
1
  import { canAssign, integerType, primitiveTypes } from "@tsplc/compiler/ir";
2
2
  import ts from "typescript";
3
- import { joined, type Mapped, mapped } from "../positions.ts";
4
- import type { EntryImports } from "./imports.ts";
5
- import type { Initializers } from "./initializers.ts";
6
- import type { Layouts } from "./layouts.ts";
7
- import type { Model } from "./model.ts";
8
- import type { Storage } from "./storage.ts";
9
- import type { Value } from "./values.ts";
3
+ import { joined, type Mapped, mapped } from "../positions";
4
+ import type { EntryImports } from "./imports";
5
+ import type { Initializers } from "./initializers";
6
+ import type { Layouts } from "./layouts";
7
+ import type { Model } from "./model";
8
+ import type { Storage } from "./storage";
9
+ import type { Value } from "./values";
10
10
 
11
11
  /**
12
12
  * Specialized values as dialect text, in a place of a declared type: literals as enum members,
@@ -1,15 +1,15 @@
1
1
  // biome-ignore-all lint/style/noNonNullAssertion: Retain existing non-null assertions during the tooling migration; changing their contracts requires a separate review.
2
2
  import ts from "typescript";
3
- import { from, joined, type Mapped, mapped } from "../positions.ts";
4
- import { unaliased } from "../sdk.ts";
5
- import { CallSpecializer } from "./calls.ts";
6
- import type { DialectText } from "./dialect.ts";
7
- import type { Frame } from "./frame.ts";
8
- import type { EntryImports } from "./imports.ts";
9
- import type { Initializers } from "./initializers.ts";
10
- import { type Layouts, recordTypes } from "./layouts.ts";
11
- import type { Model, ModelNode } from "./model.ts";
12
- import type { Storage } from "./storage.ts";
3
+ import { from, joined, type Mapped, mapped } from "../positions";
4
+ import { unaliased } from "../sdk";
5
+ import { CallSpecializer } from "./calls";
6
+ import type { DialectText } from "./dialect";
7
+ import type { Frame } from "./frame";
8
+ import type { EntryImports } from "./imports";
9
+ import type { Initializers } from "./initializers";
10
+ import { type Layouts, recordTypes } from "./layouts";
11
+ import type { Model, ModelNode } from "./model";
12
+ import type { Storage } from "./storage";
13
13
  import {
14
14
  constant,
15
15
  type Env,
@@ -17,8 +17,8 @@ import {
17
17
  repeatable,
18
18
  SpecializeError,
19
19
  type Value,
20
- } from "./values.ts";
21
- import { isAssignment } from "./writes.ts";
20
+ } from "./values";
21
+ import { isAssignment } from "./writes";
22
22
 
23
23
  /** What every part of scan-code specialization shares. */
24
24
  export interface SpecializeContext {
@@ -1,8 +1,8 @@
1
1
  import type ts from "typescript";
2
- import { from, type Mapped, mapped, type Part } from "../positions.ts";
3
- import { unusedName } from "./layouts.ts";
4
- import type { ModelNode } from "./model.ts";
5
- import type { Env } from "./values.ts";
2
+ import { from, type Mapped, mapped, type Part } from "../positions";
3
+ import { unusedName } from "./layouts";
4
+ import type { ModelNode } from "./model";
5
+ import type { Env } from "./values";
6
6
 
7
7
  /** Indented lines of one generated routine, with the local names it has used. */
8
8
  export class Emitter {
@@ -15,7 +15,7 @@ import {
15
15
  type CapturedGraph,
16
16
  type CaptureRequest,
17
17
  capturedGraphSchema,
18
- } from "./capture-protocol.ts";
18
+ } from "./capture-protocol";
19
19
 
20
20
  /** The top-level bindings a module declares: values, classes and functions, arrow functions among them. */
21
21
  export const bindingNames = (source: ts.SourceFile) => {
@@ -8,24 +8,24 @@ import {
8
8
  } from "@tsplc/compiler/ir";
9
9
  import { generatedDirectory } from "@tsplc/config/project-files";
10
10
  import ts from "typescript";
11
- import { runtimeSources } from "../module-graph.ts";
11
+ import { runtimeSources } from "../module-graph";
12
12
  import {
13
13
  copied,
14
14
  from,
15
15
  joined,
16
16
  type Mapped,
17
17
  type Positions,
18
- } from "../positions.ts";
19
- import { inSdk, namesSdk } from "../sdk.ts";
20
- import type { CompileDebug } from "../typescript.ts";
21
- import type { CapturedValue } from "./capture-protocol.ts";
22
- import { captureGraph } from "./graph.ts";
23
- import { importPath } from "./imports.ts";
24
- import { Model, type Root } from "./model.ts";
25
- import { Retention, retainedDeclarations } from "./retention.ts";
26
- import { closingBrace, Specializer } from "./specialize.ts";
27
- import { setterName } from "./storage.ts";
28
- import { SpecializeError } from "./values.ts";
18
+ } from "../positions";
19
+ import { inSdk, namesSdk } from "../sdk";
20
+ import type { CompileDebug } from "../typescript";
21
+ import type { CapturedValue } from "./capture-protocol";
22
+ import { captureGraph } from "./graph";
23
+ import { importPath } from "./imports";
24
+ import { Model, type Root } from "./model";
25
+ import { Retention, retainedDeclarations } from "./retention";
26
+ import { closingBrace, Specializer } from "./specialize";
27
+ import { setterName } from "./storage";
28
+ import { SpecializeError } from "./values";
29
29
 
30
30
  /**
31
31
  * A module the compiled program keeps as written: only types, enums, constants and the service
@@ -1,9 +1,9 @@
1
1
  // biome-ignore-all lint/style/noNonNullAssertion: Retain existing non-null assertions during the tooling migration; changing their contracts requires a separate review.
2
2
  import ts from "typescript";
3
- import type { CapturedValue } from "./capture-protocol.ts";
4
- import { type Layouts, recordTypes } from "./layouts.ts";
5
- import type { Model, ModelNode } from "./model.ts";
6
- import type { Storage } from "./storage.ts";
3
+ import type { CapturedValue } from "./capture-protocol";
4
+ import { type Layouts, recordTypes } from "./layouts";
5
+ import type { Model, ModelNode } from "./model";
6
+ import type { Storage } from "./storage";
7
7
 
8
8
  /** Values setup captured as dialect text: storage initializers, and fixed data scan code reads. */
9
9
  export class Initializers {
@@ -1,8 +1,8 @@
1
1
  import { primitiveTypes } from "@tsplc/compiler/ir";
2
2
  import ts from "typescript";
3
- import type { CapturedValue } from "./capture-protocol.ts";
4
- import { ModuleImports } from "./imports.ts";
5
- import type { Model } from "./model.ts";
3
+ import type { CapturedValue } from "./capture-protocol";
4
+ import { ModuleImports } from "./imports";
5
+ import type { Model } from "./model";
6
6
 
7
7
  /** IEC names a program can write as types; they keep their width rather than becoming DINT. */
8
8
  const iecNames = new Set(primitiveTypes.map((type) => type.id));
@@ -3,7 +3,7 @@ import type {
3
3
  CapturedGraph,
4
4
  CapturedNode,
5
5
  CapturedValue,
6
- } from "./capture-protocol.ts";
6
+ } from "./capture-protocol";
7
7
 
8
8
  /** One step from an owner to the object it holds. */
9
9
  export type Step =
@@ -1,6 +1,6 @@
1
1
  import ts from "typescript";
2
- import { namesSdk } from "../sdk.ts";
3
- import type { CapturedValue } from "./capture-protocol.ts";
2
+ import { namesSdk } from "../sdk";
3
+ import type { CapturedValue } from "./capture-protocol";
4
4
  import {
5
5
  children,
6
6
  type Model,
@@ -8,9 +8,9 @@ import {
8
8
  type Owner,
9
9
  type Root,
10
10
  tsPath,
11
- } from "./model.ts";
12
- import type { Storage } from "./storage.ts";
13
- import { SpecializeError } from "./values.ts";
11
+ } from "./model";
12
+ import type { Storage } from "./storage";
13
+ import { SpecializeError } from "./values";
14
14
 
15
15
  /** A declaration whose initializer retains a primitive: a module binding or a class field. */
16
16
  type RetainedDeclaration = ts.VariableDeclaration | ts.PropertyDeclaration;
@@ -1,27 +1,27 @@
1
1
  // biome-ignore-all lint/style/noNonNullAssertion: Retain existing non-null assertions during the tooling migration; changing their contracts requires a separate review.
2
2
  import ts from "typescript";
3
- import { from, joined, type Mapped, mapped } from "../positions.ts";
4
- import { DialectText } from "./dialect.ts";
3
+ import { from, joined, type Mapped, mapped } from "../positions";
4
+ import { DialectText } from "./dialect";
5
5
  import {
6
6
  ExpressionSpecializer,
7
7
  type RoutineCall,
8
8
  type RoutineTable,
9
9
  type SpecializeContext,
10
- } from "./expressions.ts";
11
- import { Emitter, type Frame } from "./frame.ts";
12
- import { EntryImports } from "./imports.ts";
13
- import { Initializers } from "./initializers.ts";
14
- import { Layouts, unusedName } from "./layouts.ts";
15
- import { type Model, type ModelNode, type Root, tsPath } from "./model.ts";
16
- import { StatementSpecializer } from "./statements.ts";
17
- import { Storage } from "./storage.ts";
10
+ } from "./expressions";
11
+ import { Emitter, type Frame } from "./frame";
12
+ import { EntryImports } from "./imports";
13
+ import { Initializers } from "./initializers";
14
+ import { Layouts, unusedName } from "./layouts";
15
+ import { type Model, type ModelNode, type Root, tsPath } from "./model";
16
+ import { StatementSpecializer } from "./statements";
17
+ import { Storage } from "./storage";
18
18
  import {
19
19
  constant,
20
20
  type Env,
21
21
  type FunctionLike,
22
22
  SpecializeError,
23
23
  type Value,
24
- } from "./values.ts";
24
+ } from "./values";
25
25
 
26
26
  /**
27
27
  * Evaluates the program's scan code against the setup graph. Everything setup decided (which
@@ -1,16 +1,13 @@
1
1
  // biome-ignore-all lint/style/noNonNullAssertion: Retain existing non-null assertions during the tooling migration; changing their contracts requires a separate review.
2
2
  import ts from "typescript";
3
- import { copied, type Mapped, mapped, type Part } from "../positions.ts";
4
- import type { DialectText } from "./dialect.ts";
5
- import type {
6
- ExpressionSpecializer,
7
- SpecializeContext,
8
- } from "./expressions.ts";
9
- import type { Frame } from "./frame.ts";
10
- import type { Initializers } from "./initializers.ts";
11
- import type { Layouts } from "./layouts.ts";
12
- import { SpecializeError, type Value } from "./values.ts";
13
- import { isAssignment, isUpdate } from "./writes.ts";
3
+ import { copied, type Mapped, mapped, type Part } from "../positions";
4
+ import type { DialectText } from "./dialect";
5
+ import type { ExpressionSpecializer, SpecializeContext } from "./expressions";
6
+ import type { Frame } from "./frame";
7
+ import type { Initializers } from "./initializers";
8
+ import type { Layouts } from "./layouts";
9
+ import { SpecializeError, type Value } from "./values";
10
+ import { isAssignment, isUpdate } from "./writes";
14
11
 
15
12
  /** Specializes one routine's statements; expressions in them go through its ExpressionSpecializer. */
16
13
  export class StatementSpecializer {
@@ -1,13 +1,8 @@
1
1
  // biome-ignore-all lint/style/noNonNullAssertion: Retain existing non-null assertions during the tooling migration; changing their contracts requires a separate review.
2
2
  import ts from "typescript";
3
- import type { CapturedPrimitive, CapturedValue } from "./capture-protocol.ts";
4
- import type { EntryImports } from "./imports.ts";
5
- import {
6
- type Layouts,
7
- pascalCase,
8
- recordTypes,
9
- unusedName,
10
- } from "./layouts.ts";
3
+ import type { CapturedPrimitive, CapturedValue } from "./capture-protocol";
4
+ import type { EntryImports } from "./imports";
5
+ import { type Layouts, pascalCase, recordTypes, unusedName } from "./layouts";
11
6
  import {
12
7
  children,
13
8
  type Model,
@@ -16,9 +11,9 @@ import {
16
11
  type Root,
17
12
  type Step,
18
13
  tsPath,
19
- } from "./model.ts";
20
- import { constant, type Value } from "./values.ts";
21
- import { ScanWrites } from "./writes.ts";
14
+ } from "./model";
15
+ import { constant, type Value } from "./values";
16
+ import { ScanWrites } from "./writes";
22
17
 
23
18
  /** A primitive scan code read from setup and folded, at its TypeScript path. */
24
19
  interface FoldedField {
@@ -1,6 +1,6 @@
1
1
  import type ts from "typescript";
2
- import type { Mapped } from "../positions.ts";
3
- import type { ModelNode } from "./model.ts";
2
+ import type { Mapped } from "../positions";
3
+ import type { ModelNode } from "./model";
4
4
 
5
5
  export type FunctionLike =
6
6
  | ts.FunctionDeclaration
@@ -2,7 +2,7 @@ import { createHash } from "node:crypto";
2
2
  import { type Diagnostic, error } from "@tsplc/compiler/ir";
3
3
  import { elementaryType, isIntegerValued } from "@tsplc/iec";
4
4
  import ts from "typescript";
5
- import { runtimeSources } from "./module-graph.ts";
5
+ import { runtimeSources } from "./module-graph";
6
6
  import {
7
7
  copied,
8
8
  type Edit,
@@ -12,8 +12,8 @@ import {
12
12
  type Mapped,
13
13
  mapped,
14
14
  type Positions,
15
- } from "./positions.ts";
16
- import { namesSdk, symbolAt } from "./sdk.ts";
15
+ } from "./positions";
16
+ import { namesSdk, symbolAt } from "./sdk";
17
17
 
18
18
  /** Telemetry carries a BOOL, an integer or bit string of up to 32 bits, or a bounded STRING. */
19
19
  const telemetryType = (annotation: string): boolean => {
@@ -26,10 +26,10 @@ import {
26
26
  valueRange,
27
27
  } from "@tsplc/compiler/ir";
28
28
  import ts from "typescript";
29
- import type { BlockResolver, BlockSource } from "./blocks.ts";
30
- import { intrinsicExpression } from "./intrinsics.ts";
31
- import type { Positions } from "./positions.ts";
32
- import type { RoutineTable } from "./routines.ts";
29
+ import type { BlockResolver, BlockSource } from "./blocks";
30
+ import { intrinsicExpression } from "./intrinsics";
31
+ import type { Positions } from "./positions";
32
+ import type { RoutineTable } from "./routines";
33
33
  import {
34
34
  calleeName,
35
35
  type Fail,
@@ -41,7 +41,7 @@ import {
41
41
  type TypeEnvironment,
42
42
  type TypeResolver,
43
43
  unparenthesized,
44
- } from "./types.ts";
44
+ } from "./types";
45
45
 
46
46
  type UnaryOperator = Extract<Expression, { kind: "unary" }>["operator"];
47
47
  type ArrayLayout = Extract<PlcType, { kind: "array" }>;
@@ -7,8 +7,8 @@ import {
7
7
  parseInteger,
8
8
  } from "@tsplc/compiler/ir";
9
9
  import ts from "typescript";
10
- import type { ExpressionLowering } from "./expressions.ts";
11
- import { numericLiteral } from "./types.ts";
10
+ import type { ExpressionLowering } from "./expressions";
11
+ import { numericLiteral } from "./types";
12
12
 
13
13
  type Conversion = Extract<Expression, { kind: "convert" }>["policy"];
14
14
  type Arithmetic = Pick<
@@ -1,6 +1,6 @@
1
1
  import { dirname, relative } from "node:path";
2
2
  import ts from "typescript";
3
- import { symbolAt } from "./sdk.ts";
3
+ import { symbolAt } from "./sdk";
4
4
 
5
5
  /** The quoted specifier an import generated into `importer` uses to reach `target`. */
6
6
  export const importSpecifier = (importer: string, target: string): string => {
@@ -1,7 +1,7 @@
1
1
  // biome-ignore-all lint/style/noNonNullAssertion: Retain existing non-null assertions during the tooling migration; changing their contracts requires a separate review.
2
2
  import ts from "typescript";
3
- import type { PromiseContext, Routine } from "./promises.ts";
4
- import { hasModifier } from "./types.ts";
3
+ import type { PromiseContext, Routine } from "./promises";
4
+ import { hasModifier } from "./types";
5
5
 
6
6
  type Handler = ts.ArrowFunction | ts.FunctionExpression | Routine;
7
7
  type Owner = ts.FunctionDeclaration | ts.MethodDeclaration;
@@ -1,7 +1,7 @@
1
1
  // biome-ignore-all lint/style/noNonNullAssertion: Retain existing non-null assertions during the tooling migration; changing their contracts requires a separate review.
2
2
  import { type Diagnostic, error } from "@tsplc/compiler/ir";
3
3
  import ts from "typescript";
4
- import { importSpecifier, runtimeSources } from "./module-graph.ts";
4
+ import { importSpecifier, runtimeSources } from "./module-graph";
5
5
  import {
6
6
  type Edit,
7
7
  edited,
@@ -10,10 +10,10 @@ import {
10
10
  type Mapped,
11
11
  mapped,
12
12
  type Positions,
13
- } from "./positions.ts";
14
- import { chainOf, lowerChain } from "./promise-chains.ts";
15
- import { namesSdk, symbolAt } from "./sdk.ts";
16
- import { hasModifier, SemanticError } from "./types.ts";
13
+ } from "./positions";
14
+ import { chainOf, lowerChain } from "./promise-chains";
15
+ import { namesSdk, symbolAt } from "./sdk";
16
+ import { hasModifier, SemanticError } from "./types";
17
17
 
18
18
  export type Routine = ts.FunctionDeclaration | ts.MethodDeclaration;
19
19
 
@@ -5,13 +5,13 @@ import {
5
5
  type PlcFunction,
6
6
  } from "@tsplc/compiler/ir";
7
7
  import ts from "typescript";
8
- import type { Positions } from "./positions.ts";
8
+ import type { Positions } from "./positions";
9
9
  import {
10
10
  type Fail,
11
11
  hasModifier,
12
12
  type TypeEnvironment,
13
13
  type TypeResolver,
14
- } from "./types.ts";
14
+ } from "./types";
15
15
 
16
16
  /** A routine whose signature is admitted and whose body is still to be lowered. */
17
17
  interface PendingRoutine {
@@ -12,7 +12,7 @@ import {
12
12
  wireRecord,
13
13
  } from "@tsplc/server";
14
14
  import ts from "typescript";
15
- import { runtimeSources } from "./module-graph.ts";
15
+ import { runtimeSources } from "./module-graph";
16
16
  import {
17
17
  type Edit,
18
18
  edited,
@@ -20,8 +20,8 @@ import {
20
20
  type Mapped,
21
21
  mapped,
22
22
  type Positions,
23
- } from "./positions.ts";
24
- import { namesSdk, symbolAt } from "./sdk.ts";
23
+ } from "./positions";
24
+ import { namesSdk, symbolAt } from "./sdk";
25
25
 
26
26
  /** The server section's transport; each client's type argument names its router. */
27
27
  export interface ServiceOptions {