@shd101wyy/yo 0.1.25 → 0.1.26

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 (38) hide show
  1. package/.github/skills/yo-async-effects/async-effects-recipes.md +6 -6
  2. package/.github/skills/yo-core-patterns/core-patterns-cheatsheet.md +4 -0
  3. package/.github/skills/yo-syntax/syntax-cheatsheet.md +5 -0
  4. package/out/cjs/index.cjs +545 -547
  5. package/out/cjs/yo-cli.cjs +605 -606
  6. package/out/cjs/yo-lsp.cjs +552 -554
  7. package/out/esm/index.mjs +503 -505
  8. package/out/types/src/codegen/codegen-c.d.ts +2 -2
  9. package/out/types/src/codegen/functions/collection.d.ts +2 -2
  10. package/out/types/src/codegen/functions/context.d.ts +3 -2
  11. package/out/types/src/codegen/types/collection.d.ts +2 -2
  12. package/out/types/src/codegen/utils/index.d.ts +3 -1
  13. package/out/types/src/doc/builder.d.ts +2 -2
  14. package/out/types/src/evaluator/calls/closure-type.d.ts +2 -2
  15. package/out/types/src/evaluator/calls/record-type.d.ts +11 -0
  16. package/out/types/src/evaluator/context.d.ts +8 -9
  17. package/out/types/src/evaluator/index.d.ts +3 -3
  18. package/out/types/src/evaluator/types/record.d.ts +14 -0
  19. package/out/types/src/evaluator/types/validation.d.ts +2 -2
  20. package/out/types/src/evaluator/values/anonymous-module.d.ts +5 -5
  21. package/out/types/src/evaluator/values/impl.d.ts +1 -1
  22. package/out/types/src/expr.d.ts +1 -4
  23. package/out/types/src/function-value.d.ts +1 -1
  24. package/out/types/src/lsp/document-manager.d.ts +1 -1
  25. package/out/types/src/module-manager.d.ts +3 -3
  26. package/out/types/src/types/creators.d.ts +3 -4
  27. package/out/types/src/types/definitions.d.ts +8 -19
  28. package/out/types/src/types/guards.d.ts +3 -3
  29. package/out/types/src/types/tags.d.ts +0 -1
  30. package/out/types/src/types/utils.d.ts +1 -1
  31. package/out/types/src/value-tag.d.ts +0 -1
  32. package/out/types/src/value.d.ts +6 -13
  33. package/out/types/tsconfig.tsbuildinfo +1 -1
  34. package/package.json +1 -1
  35. package/std/error.yo +6 -6
  36. package/std/prelude.yo +1 -7
  37. package/out/types/src/evaluator/calls/module-type.d.ts +0 -11
  38. package/out/types/src/evaluator/types/module.d.ts +0 -19
@@ -1,12 +1,12 @@
1
1
  import type { Expr } from "../expr";
2
- import type { ModuleValue } from "../value";
2
+ import type { StructValue } from "../value";
3
3
  export declare class CodeGeneratorC {
4
4
  private emitter;
5
5
  private exportedFunctionNames;
6
6
  private _needsIntelAsmSyntax;
7
7
  private _usesParallelism;
8
8
  constructor();
9
- compileModule(modulePath: string, moduleValue: ModuleValue, options?: {
9
+ compileModule(modulePath: string, moduleValue: StructValue, options?: {
10
10
  debugGc?: boolean;
11
11
  debugParallelism?: boolean;
12
12
  debugAsyncAwait?: boolean;
@@ -1,6 +1,6 @@
1
1
  import { type Expr } from "../../expr";
2
- import { type ModuleValue, type TraitValue } from "../../value";
2
+ import { type StructValue, type TraitValue } from "../../value";
3
3
  import { type CodeGenContext } from "../utils";
4
- export declare function collectRequiredFunctions(moduleValue: ModuleValue | TraitValue, context: CodeGenContext, isTopLevelExport?: boolean): void;
4
+ export declare function collectRequiredFunctions(moduleValue: StructValue | TraitValue, context: CodeGenContext, isTopLevelExport?: boolean): void;
5
5
  export declare function findFunctionCallsInExpr(expr: Expr, context: CodeGenContext): void;
6
6
  export declare function collectDisposeMethodsFromGenericImpls(context: CodeGenContext): void;
@@ -27,7 +27,7 @@ export interface FunctionGenerationContext extends CodeGenContext {
27
27
  stateMachineVariables?: Map<string, CapturedVariable>;
28
28
  stateMachineFieldAliases?: Map<string, string>;
29
29
  inEffectStateMachine?: unknown;
30
- isModuleEffectMemberFunction?: boolean;
30
+ isEffectRecordMemberFunction?: boolean;
31
31
  currentEvidenceParams?: Map<string, EvidenceParameter>;
32
32
  continuationVariables?: Map<string, {
33
33
  directReturnVar: string;
@@ -44,8 +44,9 @@ export interface FunctionGenerationContext extends CodeGenContext {
44
44
  resumeFunctionName: string;
45
45
  constructorName: string;
46
46
  disposeFunctionName: string;
47
+ setEffectFunctionName: string;
47
48
  futureType: SomeType | DynType;
48
- futureModuleType: FutureTraitType;
49
+ futureTraitType: FutureTraitType;
49
50
  resultType: Type;
50
51
  resultTypeCName: string;
51
52
  captureType: StructType | undefined;
@@ -1,8 +1,8 @@
1
1
  import { type Expr } from "../../expr";
2
2
  import type { FunctionType, Type } from "../../types/definitions";
3
- import { type ModuleValue } from "../../value";
3
+ import { type StructValue } from "../../value";
4
4
  import { type CodeGenContext } from "../utils";
5
- export declare function collectRequiredTypes(moduleValue: ModuleValue, context: CodeGenContext): void;
5
+ export declare function collectRequiredTypes(moduleValue: StructValue, context: CodeGenContext): void;
6
6
  export declare function collectTypesFromFunctionType(functionType: FunctionType, context: CodeGenContext): void;
7
7
  export declare function collectTypesFromExpr(expr: Expr, context: CodeGenContext): void;
8
8
  export declare function collectType(type: Type, context: CodeGenContext): void;
@@ -3,7 +3,7 @@ import { type Environment } from "../../env";
3
3
  import { type Expr } from "../../expr";
4
4
  import type { FunctionValue, FuncValueId } from "../../function-value";
5
5
  import type { TargetInfo } from "../../target";
6
- import type { DynType, EnumType, FunctionType, IsoType, StructType, Type, TypeId } from "../../types/definitions";
6
+ import type { DynType, EnumType, FunctionType, IsoType, StructType, Type, TypeField, TypeId } from "../../types/definitions";
7
7
  import { type TraitValue } from "../../value";
8
8
  export interface CodeGenContext {
9
9
  types: Record<TypeId, {
@@ -83,6 +83,8 @@ export interface CodeGenContext {
83
83
  currentModuleId?: string;
84
84
  exportedFunctionLabels?: Map<FuncValueId, string>;
85
85
  }
86
+ export declare function isComptimeOnlyStructField(field: TypeField, _ownerType: StructType): boolean;
87
+ export declare function getRuntimeStructFields(structType: StructType): TypeField[];
86
88
  export declare function sanitizeForCIdentifier(str: string, isExternC?: boolean): string;
87
89
  export declare function shouldAvoidConst(type: Type): boolean;
88
90
  export declare function getTypeString(type: Type | undefined, context: CodeGenContext): string;
@@ -1,12 +1,12 @@
1
1
  import type { Token } from "../token";
2
2
  import type { Environment } from "../env";
3
- import type { ModuleValue } from "../value";
3
+ import type { StructValue } from "../value";
4
4
  import type { DocExtractionResult } from "./extractor";
5
5
  import type { DocModule } from "./model";
6
6
  export interface BuildDocModuleOptions {
7
7
  name: string;
8
8
  path: string;
9
- moduleValue: ModuleValue;
9
+ moduleValue: StructValue;
10
10
  extraction: DocExtractionResult;
11
11
  tokens: Token[];
12
12
  env?: Environment;
@@ -2,9 +2,9 @@ import { type Environment } from "../../env";
2
2
  import { type Expr, type FnCallExpr } from "../../expr";
3
3
  import type { DynType, FnTraitType, SomeType } from "../../types/definitions";
4
4
  import type { EvaluatorContext } from "../context";
5
- export declare function tryToImplementClosureByFnModuleType({ expr, fnModuleType, wrapperType, callerEnv, context, }: {
5
+ export declare function tryToImplementClosureByFnTraitType({ expr, fnTraitType, wrapperType, callerEnv, context, }: {
6
6
  expr: FnCallExpr;
7
- fnModuleType: FnTraitType;
7
+ fnTraitType: FnTraitType;
8
8
  wrapperType: SomeType | DynType;
9
9
  callerEnv: Environment;
10
10
  context: EvaluatorContext;
@@ -0,0 +1,11 @@
1
+ import { type Environment } from "../../env";
2
+ import { type Expr } from "../../expr";
3
+ import type { SourceNamespaceType } from "../../types/definitions";
4
+ import type { EvaluatorContext, RecordTypeCallResult } from "../context";
5
+ export declare function tryToImplementRecordWithArgumentsByRecordType({ moduleExpr, sourceNamespaceType, argExprs, callerEnv, context, }: {
6
+ moduleExpr: Expr;
7
+ sourceNamespaceType: SourceNamespaceType;
8
+ argExprs: Expr[];
9
+ callerEnv: Environment;
10
+ context: EvaluatorContext;
11
+ }): RecordTypeCallResult;
@@ -4,7 +4,7 @@ import type { Expr, FnCallExpr, PathCollection, ComptimeRef } from "../expr";
4
4
  import type { FunctionValue } from "../function-value";
5
5
  import type { Token } from "../token";
6
6
  import type { FunctionType, TraitType, Type } from "../types/definitions";
7
- import type { ModuleValue, TraitValue, Value } from "../value";
7
+ import type { StructValue, TraitValue, Value } from "../value";
8
8
  export interface FunctionEvaluationContext {
9
9
  kind: "function-body";
10
10
  type: FunctionType;
@@ -12,7 +12,7 @@ export interface FunctionEvaluationContext {
12
12
  evaluationEnv: Environment;
13
13
  }
14
14
  export type LoadModuleFn = (modulePath: string) => {
15
- moduleValue: ModuleValue;
15
+ moduleValue: StructValue;
16
16
  moduleError: Error | undefined;
17
17
  };
18
18
  export type EvaluateExpressionFn = ({ expr, env, context, }: {
@@ -45,11 +45,10 @@ export interface EvaluatorContext {
45
45
  };
46
46
  SelfType?: Type;
47
47
  SelfTraitType?: Type;
48
- SelfModuleType?: Type;
49
48
  ReceiverType?: Type;
50
49
  isEvaluatingFunctionType?: boolean;
51
50
  loadModule?: (modulePath: string) => {
52
- moduleValue: ModuleValue;
51
+ moduleValue: StructValue;
53
52
  moduleError: Error | undefined;
54
53
  };
55
54
  stdPath: string;
@@ -122,8 +121,8 @@ export interface TypeCallResult {
122
121
  runtimeArgExprsInOrder: Expr[];
123
122
  callerEnv: Environment;
124
123
  }
125
- export interface ModuleTypeCallResult {
126
- moduleValue: ModuleValue;
124
+ export interface RecordTypeCallResult {
125
+ moduleValue: StructValue;
127
126
  callerEnv: Environment;
128
127
  }
129
128
  export interface TraitTypeCallResult {
@@ -174,8 +173,8 @@ export interface FunctionToCall {
174
173
  } | {
175
174
  kind: "closure-type";
176
175
  } | {
177
- kind: "module-type";
178
- result: ModuleTypeCallResult;
176
+ kind: "record-type";
177
+ result: RecordTypeCallResult;
179
178
  } | {
180
179
  kind: "trait-type";
181
180
  result: TraitTypeCallResult;
@@ -201,7 +200,7 @@ export interface FunctionToCall {
201
200
  }
202
201
  export declare function getFunctionCallResult(functionToCall: FunctionToCall): FunctionCallResult;
203
202
  export declare function getTypeCallResult(functionToCall: FunctionToCall): TypeCallResult;
204
- export declare function getModuleTypeCallResult(functionToCall: FunctionToCall): ModuleTypeCallResult;
203
+ export declare function getRecordTypeCallResult(functionToCall: FunctionToCall): RecordTypeCallResult;
205
204
  export declare function getTraitTypeCallResult(functionToCall: FunctionToCall): TraitTypeCallResult;
206
205
  export declare function getIndexCallResult(functionToCall: FunctionToCall): IndexCallResult;
207
206
  export declare function getPointerTypeCallResult(functionToCall: FunctionToCall): PointerTypeCallResult;
@@ -1,7 +1,7 @@
1
1
  import { type Environment } from "../env";
2
2
  import type { Expr } from "../expr";
3
3
  import { type Token } from "../token";
4
- import type { ModuleValue } from "../value";
4
+ import type { StructValue } from "../value";
5
5
  import type { LoadModuleFn } from "./context";
6
6
  import { clearAllGlobalImplState, clearGenericImplsFromModule, clearImplsFromModule } from "./values/impl";
7
7
  export { clearAllGlobalImplState, clearGenericImplsFromModule, clearImplsFromModule, };
@@ -22,12 +22,12 @@ export default class Evaluator {
22
22
  loadModule: LoadModuleFn;
23
23
  inputString?: string;
24
24
  allowPartialModule?: boolean;
25
- registerPartialModule?: (mv: ModuleValue) => void;
25
+ registerPartialModule?: (mv: StructValue) => void;
26
26
  });
27
27
  getProgram(): Expr[];
28
28
  getTokens(): Token[];
29
29
  private evaluateProgram;
30
- getModuleValue(): ModuleValue;
30
+ getModuleValue(): StructValue;
31
31
  getModuleError(): Error | undefined;
32
32
  getEnv(): Environment;
33
33
  }
@@ -0,0 +1,14 @@
1
+ import type { Environment } from "../../env";
2
+ import { type Expr } from "../../expr";
3
+ import type { TypeField } from "../../types/definitions";
4
+ import type { EvaluatorContext } from "../context";
5
+ export declare function evaluateRecordField({ expr, recordFieldIndex, env, context, isForEvaluatingRecordType, }: {
6
+ expr: Expr;
7
+ recordFieldIndex: number;
8
+ env: Environment;
9
+ context: EvaluatorContext;
10
+ isForEvaluatingRecordType: boolean;
11
+ }): {
12
+ field: TypeField;
13
+ env: Environment;
14
+ };
@@ -1,3 +1,3 @@
1
1
  import type { Token } from "../../token";
2
- import type { ModuleField } from "../../types/definitions";
3
- export declare function validateDisposeFunction(moduleElement: ModuleField, token: Token): void;
2
+ import type { TypeField } from "../../types/definitions";
3
+ export declare function validateDisposeFunction(moduleElement: TypeField, token: Token): void;
@@ -1,17 +1,17 @@
1
1
  import { type Environment } from "../../env";
2
2
  import { type Expr } from "../../expr";
3
- import type { ModuleType } from "../../types/definitions";
4
- import type { ModuleValue } from "../../value";
3
+ import type { SourceNamespaceType } from "../../types/definitions";
4
+ import type { StructValue } from "../../value";
5
5
  import type { EvaluatorContext } from "../context";
6
6
  export declare function evaluateAnonymousModuleBeginExprs({ beginExprs, env, context, allowPartialModule, registerPartialModule, }: {
7
7
  beginExprs: Expr[];
8
8
  env: Environment;
9
9
  context: EvaluatorContext;
10
10
  allowPartialModule?: boolean;
11
- registerPartialModule?: (mv: ModuleValue) => void;
11
+ registerPartialModule?: (mv: StructValue) => void;
12
12
  }): {
13
- moduleValue: ModuleValue;
14
- moduleType: ModuleType;
13
+ moduleValue: StructValue;
14
+ sourceNamespaceType: SourceNamespaceType;
15
15
  env: Environment;
16
16
  partialModuleError?: Error;
17
17
  };
@@ -85,7 +85,7 @@ export declare function findMethodFromGenericImplForTrait({ concreteType, traitT
85
85
  } | undefined;
86
86
  export declare function clearImplsFromModule(modulePath: string): void;
87
87
  export declare function snapshotAllImplTraitFields(): Map<TraitType, TraitField[]>;
88
- export declare function evaluateModuleValue({ expr, env, context, }: {
88
+ export declare function evaluateImplBlock({ expr, env, context, }: {
89
89
  expr: FnCallExpr;
90
90
  env: Environment;
91
91
  context: EvaluatorContext;
@@ -4,7 +4,7 @@ import type { EvaluatorContext } from "./evaluator/context";
4
4
  import type { EffectAnalysisResult } from "./evaluator/effects/effect-analysis-types";
5
5
  import { type Token } from "./token";
6
6
  import type { FunctionType, StructType, Type } from "./types/definitions";
7
- import { type ArrayValue, type ComptimeListValue, type StructValue, type TupleValue, type TraitValue, type Value } from "./value";
7
+ import { type ArrayValue, type ComptimeListValue, type StructValue, type TraitValue, type TupleValue, type Value } from "./value";
8
8
  import { ValueTag } from "./value-tag";
9
9
  export type Path = string[];
10
10
  export type PathCollection = Path[];
@@ -140,12 +140,10 @@ export declare const BuiltinKeywords: {
140
140
  newtype: string[];
141
141
  enum: string[];
142
142
  union: string[];
143
- module: string[];
144
143
  trait: string[];
145
144
  impl: string[];
146
145
  Impl: string[];
147
146
  begin: string[];
148
- module_begin: string[];
149
147
  import: string[];
150
148
  export: string[];
151
149
  open: string[];
@@ -174,7 +172,6 @@ export declare const BuiltinKeywords: {
174
172
  Future: string[];
175
173
  Concrete: string[];
176
174
  Type: string[];
177
- Module: string[];
178
175
  Trait: string[];
179
176
  ComptimeList: string[];
180
177
  tuple: string[];
@@ -33,7 +33,7 @@ export type FunctionValue = {
33
33
  isControlFunction?: boolean;
34
34
  definitionSiteEnclosingFunctionType?: FunctionType;
35
35
  closureInfo?: ClosureInfo;
36
- isModuleEffectMember?: boolean;
36
+ isEffectRecordMember?: boolean;
37
37
  isIoAsyncStateMachineClosure?: boolean;
38
38
  deriveRule?: FunctionValue;
39
39
  };
@@ -14,7 +14,7 @@ export declare class LspDocumentManager {
14
14
  attachToDocuments(documents: TextDocuments<TextDocument>, onDiagnostics: (uri: string) => void): void;
15
15
  analyzeDocument(document: TextDocument, onDiagnostics: (uri: string) => void): void;
16
16
  getModule(uri: string): {
17
- moduleValue: import("../value").ModuleValue;
17
+ moduleValue: import("../value").StructValue;
18
18
  moduleError: Error | undefined;
19
19
  evaluator: import("../evaluator").default;
20
20
  } | undefined;
@@ -1,8 +1,8 @@
1
1
  import Evaluator from "./evaluator/index";
2
- import type { ModuleValue } from "./value";
2
+ import type { StructValue } from "./value";
3
3
  export declare class ModuleManager {
4
4
  modules: Map<string, {
5
- moduleValue: ModuleValue;
5
+ moduleValue: StructValue;
6
6
  moduleError: Error | undefined;
7
7
  evaluator: Evaluator;
8
8
  }>;
@@ -25,7 +25,7 @@ export declare class ModuleManager {
25
25
  private clearDependencies;
26
26
  resetAllState(): void;
27
27
  loadModule(modulePath: string, inputString?: string, parentModule?: string): {
28
- moduleValue: ModuleValue;
28
+ moduleValue: StructValue;
29
29
  moduleError: Error | undefined;
30
30
  };
31
31
  deleteModule(modulePath: string): void;
@@ -3,7 +3,7 @@ import type { EvaluatorContext } from "../evaluator/context";
3
3
  import type { Expr } from "../expr";
4
4
  import type { FunctionValue } from "../function-value";
5
5
  import { type Value } from "../value";
6
- import type { ArrayType, ComptimeListType, DynType, EffectsRowType, EnumType, FnTraitType, FunctionForallParameter, FunctionImplicitParameter, FunctionParameter, FunctionParameterExprs, FunctionReturn, FunctionType, FutureTraitType, IsoType, ModuleType, PtrType, SliceType, SomeType, StructType, TraitType, TupleType, Type, TypeApplicationType, TypeField, TypeHierarchyType, UnionType, VoidType } from "./definitions";
6
+ import type { ArrayType, ComptimeListType, DynType, EffectsRowType, EnumType, FnTraitType, FunctionForallParameter, FunctionImplicitParameter, FunctionParameter, FunctionParameterExprs, FunctionReturn, FunctionType, FutureTraitType, IsoType, SourceNamespaceType, PtrType, SliceType, SomeType, StructType, TraitType, TupleType, Type, TypeApplicationType, TypeField, TypeHierarchyType, UnionType, VoidType } from "./definitions";
7
7
  export declare function createComptimeIntType(): Type;
8
8
  export declare function createComptimeFloatType(): Type;
9
9
  export declare function createComptimeStringType(): Type;
@@ -41,11 +41,11 @@ export declare function createStrType(env: Environment): Type;
41
41
  export declare function createVoidType(): VoidType;
42
42
  export declare function createTupleType(fields: TypeField[]): TupleType;
43
43
  export declare function createStructType(env: Environment, isReferenceSemantics?: boolean, isNewtype?: boolean, isAtomicRc?: boolean): StructType;
44
- export declare function createModuleType(env: Environment): ModuleType;
44
+ export declare function createSourceNamespaceType(env: Environment): SourceNamespaceType;
45
45
  export declare function createTraitType(env: Environment): TraitType;
46
46
  export declare function createEnumType(env: Environment): EnumType;
47
47
  export declare function createUnionType(env: Environment): UnionType;
48
- export declare function createFunctionType({ parameters, forallParameters, implicitParameters, variadicParameter, whereClauseExprs, return_, env, parametersFrame, SelfType, SelfTraitType, SelfModuleType, isClosure, }: {
48
+ export declare function createFunctionType({ parameters, forallParameters, implicitParameters, variadicParameter, whereClauseExprs, return_, env, parametersFrame, SelfType, SelfTraitType, isClosure, }: {
49
49
  parameters: FunctionParameter[];
50
50
  forallParameters: FunctionForallParameter[];
51
51
  implicitParameters?: FunctionImplicitParameter[];
@@ -56,7 +56,6 @@ export declare function createFunctionType({ parameters, forallParameters, impli
56
56
  parametersFrame: Frame;
57
57
  SelfType?: Type;
58
58
  SelfTraitType?: Type;
59
- SelfModuleType?: Type;
60
59
  isClosure?: boolean;
61
60
  }): FunctionType;
62
61
  export declare function createPtrType(childType: Type): PtrType;
@@ -93,10 +93,12 @@ export type FieldExprs = {
93
93
  export interface TypeField {
94
94
  type: Type;
95
95
  label: string;
96
+ isCompileTimeOnly?: boolean;
96
97
  defaultValue?: Value;
97
98
  assignedValue?: Value;
98
99
  exprs: FieldExprs;
99
100
  isEffectParam?: boolean;
101
+ sourceModulePath?: string;
100
102
  docComment?: string;
101
103
  }
102
104
  export interface TupleType extends Type {
@@ -135,30 +137,18 @@ export interface StructType extends Type {
135
137
  isReferenceSemantics: boolean;
136
138
  isAtomicRc?: boolean;
137
139
  isNewtype: boolean;
140
+ isSourceNamespace?: true;
138
141
  functionValue?: FunctionValue;
139
142
  fields: TypeField[];
140
143
  trait: TraitType;
141
144
  env: Environment;
142
145
  }
143
- export interface ModuleField {
144
- type: Type;
145
- label: string;
146
- sourceModulePath?: string;
147
- defaultValue?: Value;
148
- assignedValue?: Value;
149
- exprs: FieldExprs;
150
- docComment?: string;
151
- }
152
- export interface TraitField extends ModuleField {
146
+ export interface TraitField extends TypeField {
153
147
  unassignedSomeType?: SomeType;
154
148
  }
155
- export interface ModuleType extends Type {
156
- tag: TypeTag.Module;
157
- functionValue?: FunctionValue;
158
- fields: ModuleField[];
159
- trait: undefined;
160
- env: Environment;
161
- }
149
+ export type SourceNamespaceType = StructType & {
150
+ isSourceNamespace: true;
151
+ };
162
152
  export interface TraitType extends Type {
163
153
  tag: TypeTag.Trait;
164
154
  functionValue?: FunctionValue;
@@ -197,7 +187,7 @@ export type FutureTraitType = TraitType & {
197
187
  effects: FunctionImplicitParameter[];
198
188
  };
199
189
  };
200
- export type ConcreteModuleType = TraitType & {
190
+ export type ConcreteTraitType = TraitType & {
201
191
  isConcrete: {
202
192
  concreteType: Type;
203
193
  };
@@ -245,7 +235,6 @@ export interface FunctionType extends Type {
245
235
  parametersFrame: Frame;
246
236
  SelfType?: Type;
247
237
  SelfTraitType?: Type;
248
- SelfModuleType?: Type;
249
238
  trait: TraitType;
250
239
  isClosure?: boolean;
251
240
  }
@@ -1,5 +1,5 @@
1
1
  import { FunctionValue } from "../function-value";
2
- import type { ArrayType, ComptimeListType, ConcreteModuleType, DynType, EffectsRowType, EnumType, FnTraitType, FunctionType, FutureTraitType, IsoType, ModuleType, PtrType, SliceType, SomeType, StructType, TraitType, TupleType, Type, TypeApplicationType, TypeHierarchyType, UnionType, VoidType } from "./definitions";
2
+ import type { ArrayType, ComptimeListType, ConcreteTraitType, DynType, EffectsRowType, EnumType, FnTraitType, FunctionType, FutureTraitType, IsoType, SourceNamespaceType, PtrType, SliceType, SomeType, StructType, TraitType, TupleType, Type, TypeApplicationType, TypeHierarchyType, UnionType, VoidType } from "./definitions";
3
3
  export declare function isPrimitiveType(type: Type): boolean;
4
4
  export declare function isUnitType(type?: Type): boolean;
5
5
  export declare function isComptimeIntType(type?: Type): boolean;
@@ -37,7 +37,7 @@ export declare function isAtomicObjectType(type?: Type): type is StructType & {
37
37
  export declare function isNewtypeType(type?: Type): type is StructType & {
38
38
  isNewtype: true;
39
39
  };
40
- export declare function isModuleType(type?: Type): type is ModuleType;
40
+ export declare function isSourceNamespaceType(type?: Type): type is SourceNamespaceType;
41
41
  export declare function isTraitType(type?: Type): type is TraitType;
42
42
  export declare function isFnTraitType(type?: Type): type is FnTraitType;
43
43
  export declare function isFunctionType(type?: Type): type is FunctionType;
@@ -68,7 +68,7 @@ export declare function isULongLongType(type?: Type): boolean;
68
68
  export declare function isLongDoubleType(type?: Type): boolean;
69
69
  export declare function isVoidType(type?: Type): type is VoidType;
70
70
  export declare function isFutureTraitType(type?: Type): type is FutureTraitType;
71
- export declare function isConcreteTraitType(type?: Type): type is ConcreteModuleType;
71
+ export declare function isConcreteTraitType(type?: Type): type is ConcreteTraitType;
72
72
  export declare function isCCompatibleType(type?: Type): boolean;
73
73
  export declare function isFunctionTypeGeneric(functionType: FunctionType): boolean;
74
74
  export declare function isFunctionTypeHardGeneric(functionType: FunctionType): boolean;
@@ -36,7 +36,6 @@ export declare enum TypeTag {
36
36
  Function = "Function",
37
37
  SomeType = "SomeType",
38
38
  Slice = "Slice",
39
- Module = "Module",
40
39
  Trait = "Trait",
41
40
  Ptr = "Ptr",
42
41
  Iso = "Iso",
@@ -1,7 +1,7 @@
1
1
  import type { Environment } from "../env";
2
2
  import { type Expr } from "../expr";
3
3
  import { type Token } from "../token";
4
- import type { FunctionParameter, SomeType, Type, TypeField } from "./definitions";
4
+ import type { FunctionParameter, TypeField, SomeType, Type } from "./definitions";
5
5
  export declare function typeRequiresComptimeModifier(type: Type | undefined, env: Environment): boolean;
6
6
  export declare function typeProhibitsComptimeModifier(type: Type | undefined, env: Environment): boolean;
7
7
  export declare function isComptimeOnlyType(type: Type, env: Environment): boolean;
@@ -24,7 +24,6 @@ export declare enum ValueTag {
24
24
  Tuple = "Tuple",
25
25
  Struct = "Struct",
26
26
  Enum = "Enum",
27
- Module = "Module",
28
27
  Trait = "Trait",
29
28
  Expr = "Expr",
30
29
  ComptimeList = "ComptimeList",
@@ -3,7 +3,7 @@ import { type EvaluatorContext } from "./evaluator/context";
3
3
  import { type Expr } from "./expr";
4
4
  import type { FunctionValue } from "./function-value";
5
5
  import type { TypeValue } from "./type-value";
6
- import type { ArrayType, ComptimeListType, EnumType, ExprType, ModuleType, PtrType, SliceType, StructType, TraitType, TupleType, Type } from "./types/definitions";
6
+ import type { ArrayType, ComptimeListType, EnumType, ExprType, PtrType, SliceType, StructType, TraitType, TupleType, Type } from "./types/definitions";
7
7
  import type { UnitValue } from "./unit-value";
8
8
  import { ValueTag } from "./value-tag";
9
9
  export type ComptimeStringValue = {
@@ -29,7 +29,9 @@ export type TupleValue = {
29
29
  export type StructValue = {
30
30
  tag: ValueTag.Struct;
31
31
  type: StructType;
32
- fields: Value[];
32
+ fields: (Value | undefined)[];
33
+ moduleLevelInitExprs?: Expr[];
34
+ isLoading?: boolean;
33
35
  };
34
36
  export type EnumValue = {
35
37
  tag: ValueTag.Enum;
@@ -37,13 +39,6 @@ export type EnumValue = {
37
39
  variantName: string;
38
40
  fields: Value[];
39
41
  };
40
- export type ModuleValue = {
41
- tag: ValueTag.Module;
42
- type: ModuleType;
43
- fields: (Value | undefined)[];
44
- moduleLevelInitExprs?: Expr[];
45
- isLoading?: boolean;
46
- };
47
42
  export type TraitValue = {
48
43
  tag: ValueTag.Trait;
49
44
  type: TraitType;
@@ -83,7 +78,7 @@ export type PtrValue = {
83
78
  targetValue: [Value];
84
79
  targetIndex: number;
85
80
  };
86
- export type Value = TypeValue | ComptimeStringValue | ComptimeListValue | NumberValue | UnitValue | BooleanValue | ArrayValue | SliceValue | TupleValue | StructValue | EnumValue | ModuleValue | TraitValue | FunctionValue | ExprValue | UnknownValue | PtrValue;
81
+ export type Value = TypeValue | ComptimeStringValue | ComptimeListValue | NumberValue | UnitValue | BooleanValue | ArrayValue | SliceValue | TupleValue | StructValue | EnumValue | TraitValue | FunctionValue | ExprValue | UnknownValue | PtrValue;
87
82
  export declare function valueToString(value?: Value): string;
88
83
  export declare function isTypeValue(value?: Value): value is TypeValue;
89
84
  export declare function isComptimeIntValue(value?: Value): value is NumberValue;
@@ -100,7 +95,6 @@ export declare function isStructValue(value?: Value): value is StructValue;
100
95
  export declare function isArrayValue(value?: Value): value is ArrayValue;
101
96
  export declare function isSliceValue(value?: Value): value is SliceValue;
102
97
  export declare function isEnumValue(value?: Value): value is EnumValue;
103
- export declare function isModuleValue(value?: Value): value is ModuleValue;
104
98
  export declare function isTraitValue(value?: Value): value is TraitValue;
105
99
  export declare function isPtrValue(value?: Value): value is PtrValue;
106
100
  export declare function isRegionValue(_value?: Value): boolean;
@@ -125,8 +119,7 @@ export declare function createUnknownValue(type: Type, { variableName, recursive
125
119
  env: Environment;
126
120
  context: EvaluatorContext;
127
121
  }): UnknownValue | TypeValue;
128
- export declare function createStructValue(type: StructType, fields: Value[]): StructValue;
129
- export declare function createModuleValue(type: ModuleType, fields: (Value | undefined)[], moduleLevelInitExprs?: Expr[]): ModuleValue;
122
+ export declare function createStructValue(type: StructType, fields: (Value | undefined)[], moduleLevelInitExprs?: Expr[]): StructValue;
130
123
  export declare function createTraitValue(type: TraitType, fields: (Value | undefined)[]): TraitValue;
131
124
  export declare function createTupleValue(type: TupleType, fields: Value[]): TupleValue;
132
125
  export declare function createEnumValue(type: EnumType, variantName: string, fields: Value[]): EnumValue;