@shd101wyy/yo 0.1.14 → 0.1.16

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 (60) hide show
  1. package/README.md +43 -1
  2. package/out/cjs/index.cjs +581 -601
  3. package/out/cjs/yo-cli.cjs +739 -733
  4. package/out/cjs/yo-lsp.cjs +11615 -0
  5. package/out/esm/index.mjs +530 -550
  6. package/out/types/src/cache.d.ts +2 -0
  7. package/out/types/src/codegen/exprs/return.d.ts +1 -1
  8. package/out/types/src/codegen/types/generation.d.ts +0 -2
  9. package/out/types/src/codegen/utils/index.d.ts +2 -8
  10. package/out/types/src/doc/extractor.d.ts +4 -0
  11. package/out/types/src/evaluator/builtins/rc-fns.d.ts +0 -5
  12. package/out/types/src/evaluator/context.d.ts +7 -3
  13. package/out/types/src/evaluator/trait-checking.d.ts +2 -0
  14. package/out/types/src/evaluator/types/object.d.ts +2 -1
  15. package/out/types/src/evaluator/types/struct.d.ts +2 -1
  16. package/out/types/src/evaluator/types/utils.d.ts +3 -8
  17. package/out/types/src/evaluator/values/impl.d.ts +9 -1
  18. package/out/types/src/expr.d.ts +1 -2
  19. package/out/types/src/function-value.d.ts +1 -0
  20. package/out/types/src/lsp/completion.d.ts +3 -0
  21. package/out/types/src/lsp/definition.d.ts +3 -0
  22. package/out/types/src/lsp/diagnostics.d.ts +6 -0
  23. package/out/types/src/lsp/document-manager.d.ts +31 -0
  24. package/out/types/src/lsp/folding.d.ts +3 -0
  25. package/out/types/src/lsp/hover.d.ts +3 -0
  26. package/out/types/src/lsp/inlay-hints.d.ts +3 -0
  27. package/out/types/src/lsp/references.d.ts +3 -0
  28. package/out/types/src/lsp/rename.d.ts +16 -0
  29. package/out/types/src/lsp/server.d.ts +1 -0
  30. package/out/types/src/lsp/signature-help.d.ts +3 -0
  31. package/out/types/src/lsp/symbols.d.ts +3 -0
  32. package/out/types/src/lsp/utils.d.ts +11 -0
  33. package/out/types/src/tests/lsp.test.d.ts +1 -0
  34. package/out/types/src/tests/version.test.d.ts +1 -0
  35. package/out/types/src/types/creators.d.ts +2 -3
  36. package/out/types/src/types/definitions.d.ts +3 -6
  37. package/out/types/src/types/guards.d.ts +5 -2
  38. package/out/types/src/types/tags.d.ts +0 -1
  39. package/out/types/src/version-cache.d.ts +7 -0
  40. package/out/types/src/version.d.ts +5 -0
  41. package/out/types/tsconfig.tsbuildinfo +1 -1
  42. package/package.json +3 -1
  43. package/scripts/build-site.ts +32 -15
  44. package/scripts/check-liburing.js +2 -2
  45. package/std/imm/list.yo +254 -0
  46. package/std/imm/map.yo +917 -0
  47. package/std/imm/set.yo +179 -0
  48. package/std/imm/sorted_map.yo +595 -0
  49. package/std/imm/sorted_set.yo +202 -0
  50. package/std/imm/string.yo +667 -0
  51. package/std/imm/vec.yo +456 -0
  52. package/std/prelude.yo +22 -5
  53. package/std/sync/channel.yo +92 -44
  54. package/std/sync/cond.yo +5 -1
  55. package/std/sync/mutex.yo +5 -1
  56. package/std/sync/once.yo +2 -1
  57. package/std/sync/rwlock.yo +2 -1
  58. package/std/sync/waitgroup.yo +2 -1
  59. package/out/types/src/codegen/exprs/arc.d.ts +0 -5
  60. package/out/types/src/evaluator/calls/arc.d.ts +0 -15
@@ -1,3 +1,5 @@
1
1
  export declare function getGlobalCacheDir(): string;
2
2
  export declare function getGlobalDepsCacheDir(): string;
3
3
  export declare function ensureGlobalDepsCacheDir(): string;
4
+ export declare function getGlobalVersionsCacheDir(): string;
5
+ export declare function getVersionCacheDir(version: string): string;
@@ -1,7 +1,7 @@
1
1
  import { type Expr, type FnCallExpr } from "../../expr";
2
2
  import type { FunctionGenerationContext } from "../functions/context";
3
3
  import { type CodeGenContext } from "../utils";
4
- export declare function generatePendingDeferredDrops(indent: string, context: FunctionGenerationContext, expr: Expr, isCompletion?: boolean, skipAlreadyDroppedCheck?: boolean, skipEnvCheck?: boolean): void;
4
+ export declare function generatePendingDeferredDrops(indent: string, context: FunctionGenerationContext, expr: Expr, isCompletion?: boolean, skipAlreadyDroppedCheck?: boolean, skipEnvCheck?: boolean, additionalSkipVarNames?: Set<string>): void;
5
5
  export declare function generateConsumedVarDropsForEscape(indent: string, context: FunctionGenerationContext, expr: Expr, skipEnvCheck?: boolean): void;
6
6
  export declare function generateReturn(expr: FnCallExpr, indent: string, context: CodeGenContext): string;
7
7
  export declare function generateImplicitReturnStatement(expr: Expr, indent: string, context: CodeGenContext): void;
@@ -4,8 +4,6 @@ export declare function generateTypeDeclarations(context: CodeGenContext): void;
4
4
  export declare function generateArrayStructDeclarations(context: CodeGenContext): void;
5
5
  export declare function generateSliceStructDeclarations(context: CodeGenContext): void;
6
6
  export declare function generateIsoTypeDeclarations(context: CodeGenContext): void;
7
- export declare function generateArcTypeForwardDeclarations(context: CodeGenContext): void;
8
- export declare function generateArcTypeDefinitions(context: CodeGenContext): void;
9
7
  export declare function generateClosureDeclaration(functionType: FunctionType, cName: string, captureType: StructType | undefined, context: CodeGenContext): void;
10
8
  export declare function generateStructDeclaration(structType: StructType, cName: string, context: CodeGenContext): void;
11
9
  export declare function generateTupleDeclaration(tupleType: TupleType, cName: string, 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 { ArcType, DynType, EnumType, FunctionType, IsoType, StructType, Type, TypeId } from "../../types/definitions";
6
+ import type { DynType, EnumType, FunctionType, IsoType, StructType, Type, TypeId } from "../../types/definitions";
7
7
  import { type TraitValue } from "../../value";
8
8
  export interface CodeGenContext {
9
9
  types: Record<TypeId, {
@@ -36,13 +36,6 @@ export interface CodeGenContext {
36
36
  extractGenerated?: boolean;
37
37
  disposeGenerated?: boolean;
38
38
  }>;
39
- arcTypes?: Map<string, {
40
- childTypeCName: string;
41
- arcType: ArcType;
42
- structGenerated?: boolean;
43
- createGenerated?: boolean;
44
- disposeGenerated?: boolean;
45
- }>;
46
39
  spawnedFunctionSignatures: Map<string, {
47
40
  parameterTypes: Type[];
48
41
  returnType: Type;
@@ -61,6 +54,7 @@ export interface CodeGenContext {
61
54
  functionCName: string;
62
55
  callTypeId: TypeId;
63
56
  callType?: FunctionType;
57
+ consumedCaptures?: string[];
64
58
  }>;
65
59
  currentFunctionName: string;
66
60
  cIncludes: Set<string>;
@@ -17,6 +17,10 @@ export interface DocExtractionResult {
17
17
  export interface InlineDocResult {
18
18
  docs: Map<string, string>;
19
19
  }
20
+ export declare function getDocCommentLookupKey(target: {
21
+ position: Token["position"];
22
+ modulePath: string;
23
+ }): string;
20
24
  export declare function stripDocLineComment(value: string): string;
21
25
  export declare function stripDocBlockComment(value: string): string;
22
26
  export declare function extractDocComments(tokens: Token[]): DocExtractionResult;
@@ -61,11 +61,6 @@ export declare function evaluateYoIsoDispose({ expr, env, context, }: {
61
61
  env: Environment;
62
62
  context: EvaluatorContext;
63
63
  }): Expr;
64
- export declare function evaluateYoArcDispose({ expr, env, context, }: {
65
- expr: FnCallExpr;
66
- env: Environment;
67
- context: EvaluatorContext;
68
- }): Expr;
69
64
  export declare function evaluateYoDropArrayElement({ expr, env, context, }: {
70
65
  expr: FnCallExpr;
71
66
  env: Environment;
@@ -38,6 +38,7 @@ export interface EvaluatorContext {
38
38
  isEvaluatingFunctionBodyOrAsyncBlock?: FunctionEvaluationContext | AsyncBlockEvaluationContext | TestBlockEvaluationContext;
39
39
  isInsideImplBlock?: boolean;
40
40
  capturedVariables?: Map<string, CapturedVariableInfo>;
41
+ ownConsumedCaptures?: Set<string>;
41
42
  isEvaluatingLoopBody?: {
42
43
  kind: "while" | "for";
43
44
  env: Environment;
@@ -69,6 +70,12 @@ export interface EvaluatorContext {
69
70
  isInsideIoAsyncCall?: boolean;
70
71
  isInsideGivenHandler?: boolean;
71
72
  isEvaluatingGenericImplSpecialization?: boolean;
73
+ currentlySpecializingFunction?: {
74
+ originalFuncId: string;
75
+ specializedFuncId: string;
76
+ specializedReturnType: Type;
77
+ originalFunction: FunctionValue;
78
+ };
72
79
  docCommentLookup?: Map<string, string>;
73
80
  }
74
81
  export interface ArgValues {
@@ -178,9 +185,6 @@ export interface FunctionToCall {
178
185
  } | {
179
186
  kind: "iso-value";
180
187
  result: FnCallExpr;
181
- } | {
182
- kind: "arc-value";
183
- result: FnCallExpr;
184
188
  } | {
185
189
  kind: "index";
186
190
  result: IndexCallResult;
@@ -16,6 +16,8 @@ export declare function checkTypeImplementsSelfConstraints({ targetType, traitTy
16
16
  export declare function typeImplementsComptime(type: Type, env: Environment): boolean;
17
17
  export declare function findSomeTypeMissingComptimeConstraint(type: Type, env: Environment): SomeType | undefined;
18
18
  export declare function typeImplementsRuntime(type: Type, env: Environment): boolean;
19
+ export declare function beginSendDerivation(typeId: string): void;
20
+ export declare function endSendDerivation(typeId: string): void;
19
21
  export declare function typeImplementsSend(type: Type | undefined, env: Environment): boolean;
20
22
  export declare function typeImplementsDispose(type: Type | undefined, env: Environment): boolean;
21
23
  export declare function typeImplementsAcyclic(type: Type | undefined, env: Environment): boolean;
@@ -1,8 +1,9 @@
1
1
  import type { Environment } from "../../env";
2
2
  import { type FnCallExpr } from "../../expr";
3
3
  import type { EvaluatorContext } from "../context";
4
- export declare function evaluateObjectType({ expr, env, context, }: {
4
+ export declare function evaluateObjectType({ expr, env, context, isAtomicRc, }: {
5
5
  expr: FnCallExpr;
6
6
  env: Environment;
7
7
  context: EvaluatorContext;
8
+ isAtomicRc?: boolean;
8
9
  }): FnCallExpr;
@@ -1,8 +1,9 @@
1
1
  import type { Environment } from "../../env";
2
2
  import { type FnCallExpr } from "../../expr";
3
3
  import type { EvaluatorContext } from "../context";
4
- export declare function evaluateStructType({ expr, env, context, }: {
4
+ export declare function evaluateStructType({ expr, env, context, isAtomicRc, }: {
5
5
  expr: FnCallExpr;
6
6
  env: Environment;
7
7
  context: EvaluatorContext;
8
+ isAtomicRc?: boolean;
8
9
  }): FnCallExpr;
@@ -1,18 +1,18 @@
1
1
  import type { Environment } from "../../env";
2
2
  import type { Token } from "../../token";
3
- import type { ArcType, DynType, EnumType, IsoType, SomeType, StructType, TupleType, UnionType } from "../../types/definitions";
3
+ import type { DynType, EnumType, IsoType, SomeType, StructType, TupleType, UnionType } from "../../types/definitions";
4
4
  import type { EvaluatorContext } from "../context";
5
5
  export declare function addFunctionSignatureToSelfTypeModule({ label, functionSignature, SelfType, env, context, }: {
6
6
  label: string;
7
7
  functionSignature: string;
8
- SelfType: StructType | EnumType | DynType | SomeType | IsoType | ArcType;
8
+ SelfType: StructType | EnumType | DynType | SomeType | IsoType;
9
9
  env: Environment;
10
10
  context: EvaluatorContext;
11
11
  }): Environment;
12
12
  export declare function addFunctionCodeToSelfTypeModule({ label, functionCode, SelfType, env, context, }: {
13
13
  label: string;
14
14
  functionCode: string;
15
- SelfType: StructType | EnumType | DynType | SomeType | IsoType | ArcType;
15
+ SelfType: StructType | EnumType | DynType | SomeType | IsoType;
16
16
  env: Environment;
17
17
  context: EvaluatorContext;
18
18
  }): Environment;
@@ -54,11 +54,6 @@ export declare function addRcFunctionsToIsoType({ isoType, env, context, }: {
54
54
  env: Environment;
55
55
  context: EvaluatorContext;
56
56
  }): Environment;
57
- export declare function addRcFunctionsToArcType({ arcType, env, context, }: {
58
- arcType: ArcType;
59
- env: Environment;
60
- context: EvaluatorContext;
61
- }): Environment;
62
57
  export declare function attachTraitToReceiverType(moduleName: string, receiverType: StructType | EnumType | UnionType | TupleType | SomeType, env: Environment, context: EvaluatorContext): Environment;
63
58
  export declare function autoDeriveSendForStructType({ structType, env, context, }: {
64
59
  structType: StructType;
@@ -1,6 +1,6 @@
1
1
  import { type Environment } from "../../env";
2
2
  import { type Expr, type FnCallExpr } from "../../expr";
3
- import type { FunctionType, SomeType, TraitType, Type } from "../../types/definitions";
3
+ import type { FunctionType, SomeType, TraitField, TraitType, Type } from "../../types/definitions";
4
4
  import { type TraitValue, type UnknownValue, type Value } from "../../value";
5
5
  import type { EvaluatorContext } from "../context";
6
6
  export type ForallParameter = {
@@ -44,6 +44,13 @@ export declare function findMethodsFromGenericImpls({ concreteType, methodName,
44
44
  type: FunctionType;
45
45
  value: Value | undefined;
46
46
  }[];
47
+ export declare function enumerateMethodNamesFromGenericImpls({ concreteType, env, }: {
48
+ concreteType: Type;
49
+ env: Environment;
50
+ }): {
51
+ name: string;
52
+ type: FunctionType;
53
+ }[];
47
54
  export declare function findAssociatedTypeFromGenericImpls({ concreteType, propertyName, env, }: {
48
55
  concreteType: Type;
49
56
  propertyName: string;
@@ -62,6 +69,7 @@ export declare function findMethodFromGenericImplForTrait({ concreteType, traitT
62
69
  value: Value | undefined;
63
70
  } | undefined;
64
71
  export declare function clearImplsFromModule(modulePath: string): void;
72
+ export declare function snapshotAllImplTraitFields(): Map<TraitType, TraitField[]>;
65
73
  export declare function evaluateModuleValue({ expr, env, context, }: {
66
74
  expr: FnCallExpr;
67
75
  env: Environment;
@@ -133,6 +133,7 @@ export declare const BuiltinKeywords: {
133
133
  type: string[];
134
134
  match: string[];
135
135
  test: string[];
136
+ atomic: string[];
136
137
  struct: string[];
137
138
  object: string[];
138
139
  newtype: string[];
@@ -166,7 +167,6 @@ export declare const BuiltinKeywords: {
166
167
  unique: string[];
167
168
  Ptr: string[];
168
169
  Iso: string[];
169
- Arc: string[];
170
170
  Tuple: string[];
171
171
  Array: string[];
172
172
  Slice: string[];
@@ -552,7 +552,6 @@ export declare const BuiltinFunctions: {
552
552
  __yo_rc_own: string[];
553
553
  __yo_iso_extract: string[];
554
554
  __yo_iso_dispose: string[];
555
- __yo_arc_dispose: string[];
556
555
  __yo_gc_collect: string[];
557
556
  __yo_dyn_drop: string[];
558
557
  __yo_dyn_dup: string[];
@@ -46,4 +46,5 @@ export interface ClosureInfo {
46
46
  closureType: FnTraitType;
47
47
  captureType: Type | undefined;
48
48
  effectParamNames?: string[];
49
+ consumedCaptures?: string[];
49
50
  }
@@ -0,0 +1,3 @@
1
+ import type { CompletionItem } from "vscode-languageserver";
2
+ import type { LspDocumentManager } from "./document-manager";
3
+ export declare function handleCompletion(uri: string, line: number, character: number, lineText: string, docManager: LspDocumentManager): CompletionItem[];
@@ -0,0 +1,3 @@
1
+ import type { Location } from "vscode-languageserver";
2
+ import type { LspDocumentManager } from "./document-manager";
3
+ export declare function handleDefinition(uri: string, line: number, character: number, docManager: LspDocumentManager): Location | null;
@@ -0,0 +1,6 @@
1
+ import type { Diagnostic } from "vscode-languageserver";
2
+ import { YoLexerError } from "../error";
3
+ import type { LspDocumentManager } from "./document-manager";
4
+ export declare function getDiagnosticsForUri(uri: string, docManager: LspDocumentManager, documentText?: string): Diagnostic[];
5
+ export declare function errorToDiagnostics(error: Error, documentText?: string): Diagnostic[];
6
+ export declare function lexerErrorToDiagnostic(error: YoLexerError, text: string): Diagnostic;
@@ -0,0 +1,31 @@
1
+ import type { TextDocuments } from "vscode-languageserver";
2
+ import type { TextDocument } from "vscode-languageserver-textdocument";
3
+ import { ModuleManager } from "../module-manager";
4
+ type ModuleData = NonNullable<ReturnType<ModuleManager["modules"]["get"]>>;
5
+ export declare class LspDocumentManager {
6
+ private moduleManager;
7
+ private moduleManagerStdPath;
8
+ private evaluatedBuildProjects;
9
+ private lastAnalyzedTextByUri;
10
+ private analyzeGenerationByUri;
11
+ private lastGoodModules;
12
+ constructor(stdPath?: string);
13
+ getStdPath(): string | null;
14
+ attachToDocuments(documents: TextDocuments<TextDocument>, onDiagnostics: (uri: string) => void): void;
15
+ analyzeDocument(document: TextDocument, onDiagnostics: (uri: string) => void): void;
16
+ getModule(uri: string): {
17
+ moduleValue: import("../value").ModuleValue;
18
+ moduleError: Error | undefined;
19
+ evaluator: import("../evaluator").default;
20
+ } | undefined;
21
+ getModuleForCompletion(uri: string): ModuleData | undefined;
22
+ getLastGoodModule(uri: string): ModuleData | undefined;
23
+ getModuleManager(): ModuleManager;
24
+ private ensureStdPathForUri;
25
+ private findStdPath;
26
+ private findBuildYoForUri;
27
+ private ensureBuildImportsResolved;
28
+ private findDependencyDir;
29
+ private resolveDepModuleRoot;
30
+ }
31
+ export {};
@@ -0,0 +1,3 @@
1
+ import { FoldingRange } from "vscode-languageserver";
2
+ import type { LspDocumentManager } from "./document-manager";
3
+ export declare function handleFoldingRange(uri: string, docManager: LspDocumentManager): FoldingRange[];
@@ -0,0 +1,3 @@
1
+ import type { Hover } from "vscode-languageserver";
2
+ import type { LspDocumentManager } from "./document-manager";
3
+ export declare function handleHover(uri: string, line: number, character: number, docManager: LspDocumentManager): Hover | null;
@@ -0,0 +1,3 @@
1
+ import { type InlayHint } from "vscode-languageserver";
2
+ import type { LspDocumentManager } from "./document-manager";
3
+ export declare function handleInlayHint(uri: string, docManager: LspDocumentManager): InlayHint[];
@@ -0,0 +1,3 @@
1
+ import type { Location } from "vscode-languageserver";
2
+ import type { LspDocumentManager } from "./document-manager";
3
+ export declare function handleReferences(uri: string, line: number, character: number, docManager: LspDocumentManager): Location[] | null;
@@ -0,0 +1,16 @@
1
+ import type { RenameParams, WorkspaceEdit } from "vscode-languageserver";
2
+ import type { LspDocumentManager } from "./document-manager";
3
+ export declare function handleRename(params: RenameParams, docManager: LspDocumentManager): WorkspaceEdit | null;
4
+ export declare function handlePrepareRename(uri: string, line: number, character: number, docManager: LspDocumentManager): {
5
+ range: {
6
+ start: {
7
+ line: number;
8
+ character: number;
9
+ };
10
+ end: {
11
+ line: number;
12
+ character: number;
13
+ };
14
+ };
15
+ placeholder: string;
16
+ } | null;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ import { type SignatureHelp } from "vscode-languageserver";
2
+ import type { LspDocumentManager } from "./document-manager";
3
+ export declare function handleSignatureHelp(uri: string, line: number, character: number, docManager: LspDocumentManager): SignatureHelp | null;
@@ -0,0 +1,3 @@
1
+ import { DocumentSymbol } from "vscode-languageserver";
2
+ import type { LspDocumentManager } from "./document-manager";
3
+ export declare function handleDocumentSymbol(uri: string, docManager: LspDocumentManager): DocumentSymbol[];
@@ -0,0 +1,11 @@
1
+ import type { Variable } from "../env";
2
+ import { type AtomExpr, type Expr } from "../expr";
3
+ import { type Token } from "../token";
4
+ export declare function findTokenAtPosition(tokens: Token[], line: number, character: number): Token | null;
5
+ export declare function collectExpressionCandidates(exprs: Expr[], targetToken: Token, candidateExprs: AtomExpr[]): void;
6
+ export declare function findBestExpressionMatch(exprs: Expr[], targetToken: Token, targetLine: number): Expr | null;
7
+ export declare function selectBestVariableAtPosition(variables: Variable[], targetToken: Pick<Token, "position" | "modulePath">): Variable | undefined;
8
+ export declare function walkExprs(exprs: Expr[], visitor: (expr: Expr) => void): void;
9
+ export declare function modulePathToUri(modulePath: string): string;
10
+ export declare function uriToModulePath(uri: string): string;
11
+ export declare function modulePathToFsPath(modulePath: string): string;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -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 { ArcType, 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, ModuleType, 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;
@@ -40,7 +40,7 @@ export declare function createSliceType(childType: Type): SliceType;
40
40
  export declare function createStrType(env: Environment): Type;
41
41
  export declare function createVoidType(): VoidType;
42
42
  export declare function createTupleType(fields: TypeField[]): TupleType;
43
- export declare function createStructType(env: Environment, isReferenceSemantics?: boolean, isNewtype?: boolean): StructType;
43
+ export declare function createStructType(env: Environment, isReferenceSemantics?: boolean, isNewtype?: boolean, isAtomicRc?: boolean): StructType;
44
44
  export declare function createModuleType(env: Environment): ModuleType;
45
45
  export declare function createTraitType(env: Environment): TraitType;
46
46
  export declare function createEnumType(env: Environment): EnumType;
@@ -61,7 +61,6 @@ export declare function createFunctionType({ parameters, forallParameters, impli
61
61
  }): FunctionType;
62
62
  export declare function createPtrType(childType: Type): PtrType;
63
63
  export declare function createIsoType(childType: Type, env: Environment): IsoType;
64
- export declare function createArcType(childType: Type, env: Environment): ArcType;
65
64
  export declare function createSomeType(type: TypeHierarchyType, variableName: string, { id, requiredTraits, negativeTraits, recursiveTypeRef, env, context, }: {
66
65
  id?: string;
67
66
  requiredTraits?: TraitType[];
@@ -97,6 +97,7 @@ export interface TypeField {
97
97
  assignedValue?: Value;
98
98
  exprs: FieldExprs;
99
99
  isEffectParam?: boolean;
100
+ docComment?: string;
100
101
  }
101
102
  export interface TupleType extends Type {
102
103
  tag: TypeTag.Tuple;
@@ -132,6 +133,7 @@ export type FunctionImplicitParameter = FunctionParameter & {
132
133
  export interface StructType extends Type {
133
134
  tag: TypeTag.Struct;
134
135
  isReferenceSemantics: boolean;
136
+ isAtomicRc?: boolean;
135
137
  isNewtype: boolean;
136
138
  functionValue?: FunctionValue;
137
139
  fields: TypeField[];
@@ -145,6 +147,7 @@ export interface ModuleField {
145
147
  defaultValue?: Value;
146
148
  assignedValue?: Value;
147
149
  exprs: FieldExprs;
150
+ docComment?: string;
148
151
  }
149
152
  export interface TraitField extends ModuleField {
150
153
  unassignedSomeType?: SomeType;
@@ -257,12 +260,6 @@ export interface IsoType extends Type {
257
260
  trait: TraitType;
258
261
  env: Environment;
259
262
  }
260
- export interface ArcType extends Type {
261
- tag: TypeTag.Arc;
262
- childType: Type;
263
- trait: TraitType;
264
- env: Environment;
265
- }
266
263
  export interface DynType extends Type {
267
264
  tag: TypeTag.Dyn;
268
265
  requiredTraits: {
@@ -1,5 +1,5 @@
1
1
  import { FunctionValue } from "../function-value";
2
- import type { ArcType, 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, ConcreteModuleType, DynType, EffectsRowType, EnumType, FnTraitType, FunctionType, FutureTraitType, IsoType, ModuleType, 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;
@@ -30,6 +30,10 @@ export declare function isStructType(type?: Type): type is StructType;
30
30
  export declare function isObjectType(type?: Type): type is StructType & {
31
31
  isReferenceSemantics: true;
32
32
  };
33
+ export declare function isAtomicObjectType(type?: Type): type is StructType & {
34
+ isReferenceSemantics: true;
35
+ isAtomicRc: true;
36
+ };
33
37
  export declare function isNewtypeType(type?: Type): type is StructType & {
34
38
  isNewtype: true;
35
39
  };
@@ -45,7 +49,6 @@ export declare function isType0(type?: Type): boolean;
45
49
  export declare function isSomeType(type?: Type): type is SomeType;
46
50
  export declare function isPtrType(type?: Type): type is PtrType;
47
51
  export declare function isIsoType(type?: Type): type is IsoType;
48
- export declare function isArcType(type?: Type): type is ArcType;
49
52
  export declare function isDynType(type?: Type): type is DynType;
50
53
  export declare function isTypeApplicationType(type?: Type): type is TypeApplicationType;
51
54
  export declare function isRcType(type?: Type): boolean;
@@ -40,7 +40,6 @@ export declare enum TypeTag {
40
40
  Trait = "Trait",
41
41
  Ptr = "Ptr",
42
42
  Iso = "Iso",
43
- Arc = "Arc",
44
43
  Dyn = "Dyn",
45
44
  Expr = "Expr",
46
45
  ComptimeList = "ComptimeList",
@@ -0,0 +1,7 @@
1
+ export declare function isVersionCached(version: string): boolean;
2
+ export declare function listCachedVersions(): string[];
3
+ export declare function cleanVersionCache(version?: string): void;
4
+ export declare function ensureCachedVersion(version: string): Promise<string>;
5
+ export declare function downloadVersion(version: string): Promise<string>;
6
+ export declare function fetchRemoteVersions(): Promise<string[]>;
7
+ export declare function findJsRuntime(): string;
@@ -0,0 +1,5 @@
1
+ export declare function getCurrentYoVersion(): string;
2
+ export declare function findYoVersionFile(startDir: string): string | null;
3
+ export declare function parseYoVersion(content: string): string;
4
+ export declare function readYoVersion(startDir: string): string | null;
5
+ export declare function isPinnedVersionCurrent(pinnedVersion: string): boolean;