@shd101wyy/yo 0.0.29 → 0.0.31
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 +19 -0
- package/out/cjs/index.cjs +7558 -7830
- package/out/cjs/yo-cli.cjs +7557 -7829
- package/out/esm/index.mjs +7457 -7729
- package/out/types/src/codegen/async/runtime-core.d.ts +2 -1
- package/out/types/src/codegen/async/runtime-io-common.d.ts +3 -1
- package/out/types/src/codegen/async/runtime-io-linux.d.ts +1 -0
- package/out/types/src/codegen/async/runtime-io-macos.d.ts +1 -0
- package/out/types/src/codegen/async/runtime-io-windows.d.ts +1 -0
- package/out/types/src/codegen/async/runtime.d.ts +2 -1
- package/out/types/src/codegen/async/state-machine.d.ts +18 -2
- package/out/types/src/codegen/functions/context.d.ts +5 -0
- package/out/types/src/codegen/parallelism/runtime.d.ts +2 -1
- package/out/types/src/codegen/utils/index.d.ts +2 -0
- package/out/types/src/expr.d.ts +1 -0
- package/out/types/src/target.d.ts +1 -0
- package/out/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/std/cli/arg_parser.yo +365 -0
- package/std/collections/array_list.yo +108 -0
- package/std/collections/hash_map.yo +1 -1
- package/std/collections/hash_set.yo +7 -7
- package/std/collections/linked_list.yo +1 -1
- package/std/encoding/base64.yo +73 -0
- package/std/fs/file.yo +113 -6
- package/std/fs/types.yo +21 -0
- package/std/glob/glob.yo +206 -0
- package/std/http/http.yo +196 -0
- package/std/io/reader.yo +17 -0
- package/std/io/writer.yo +19 -0
- package/std/net/tcp.yo +1 -1
- package/std/prelude.yo +69 -0
- package/std/string/string.yo +398 -4
- package/std/sync/cond.yo +19 -19
- package/std/sync/mutex.yo +16 -16
- package/std/sys/bufio/buf_reader.yo +2 -2
- package/std/sys/future.yo +3 -3
- package/std/toml/toml.yo +179 -0
- package/std/testing/assert.yo +0 -173
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
import { Emitter } from "../../emitter";
|
|
2
|
-
|
|
2
|
+
import type { TargetInfo } from "../../target";
|
|
3
|
+
export declare function generateSysRuntime(emitter: Emitter, targetInfo: TargetInfo): void;
|
|
4
|
+
export declare function generateAsyncRuntimeIOCommon(emitter: Emitter, targetInfo: TargetInfo): void;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { Emitter } from "../../emitter";
|
|
2
|
-
|
|
2
|
+
import type { TargetInfo } from "../../target";
|
|
3
|
+
export declare function generateAsyncRuntime(emitter: Emitter, targetInfo: TargetInfo, _debugAsyncAwait: boolean): void;
|
|
@@ -1,7 +1,23 @@
|
|
|
1
|
-
import type { AwaitAnalysisResult, AwaitPoint } from "../../evaluator/async/await-analysis";
|
|
1
|
+
import type { AwaitAnalysisResult, AwaitPoint, CapturedVariable } from "../../evaluator/async/await-analysis";
|
|
2
2
|
import { type Expr } from "../../expr";
|
|
3
3
|
import type { DynType, SomeType, StructType, Type } from "../../types/definitions";
|
|
4
4
|
import type { FunctionGenerationContext } from "../functions/context";
|
|
5
|
+
export interface CrossBoundaryResult {
|
|
6
|
+
crossBoundaryIds: Set<string>;
|
|
7
|
+
awaitFutureTempVarAliases: Map<string, string>;
|
|
8
|
+
variableSegments: Map<string, Set<number>>;
|
|
9
|
+
}
|
|
10
|
+
export declare function computeCrossBoundaryVariables(bodyExpr: Expr, analysis: AwaitAnalysisResult): CrossBoundaryResult;
|
|
11
|
+
export interface OverlappingSlot {
|
|
12
|
+
fieldName: string;
|
|
13
|
+
cType: string;
|
|
14
|
+
variableNames: string[];
|
|
15
|
+
}
|
|
16
|
+
export interface OverlappingStorageResult {
|
|
17
|
+
slotAliases: Map<string, string>;
|
|
18
|
+
slots: OverlappingSlot[];
|
|
19
|
+
}
|
|
20
|
+
export declare function computeOverlappingSlots(crossBoundaryIds: Set<string>, variableSegments: Map<string, Set<number>>, capturedVariables: CapturedVariable[], awaitFutureTempVarAliases: Map<string, string>, context: FunctionGenerationContext): OverlappingStorageResult;
|
|
5
21
|
export declare function getFutureFieldName(awaitPoint: AwaitPoint, analysis: AwaitAnalysisResult): string;
|
|
6
22
|
export declare function isIoFutureType(type: Type | undefined): boolean;
|
|
7
23
|
export interface StateMachineInfo {
|
|
@@ -10,5 +26,5 @@ export interface StateMachineInfo {
|
|
|
10
26
|
analysis: AwaitAnalysisResult;
|
|
11
27
|
}
|
|
12
28
|
export declare function generateResumeFunctionDeclaration(info: StateMachineInfo, context: FunctionGenerationContext): void;
|
|
13
|
-
export declare function getStateMachineFieldName(variableId: string, kind?: "outer" | "local"): string;
|
|
29
|
+
export declare function getStateMachineFieldName(variableId: string, kind?: "outer" | "local", aliases?: Map<string, string>): string;
|
|
14
30
|
export declare function generateAsyncBlockResumeFunction(bodyExpr: Expr, asyncBlockId: string, structName: string, resumeFunctionName: string, analysis: AwaitAnalysisResult, futureType: SomeType | DynType, captureType: StructType | undefined, context: FunctionGenerationContext): string[];
|
|
@@ -25,6 +25,7 @@ export interface FunctionGenerationContext extends CodeGenContext {
|
|
|
25
25
|
futureType: SomeType | DynType;
|
|
26
26
|
};
|
|
27
27
|
stateMachineVariables?: Map<string, CapturedVariable>;
|
|
28
|
+
stateMachineFieldAliases?: Map<string, string>;
|
|
28
29
|
inEffectStateMachine?: unknown;
|
|
29
30
|
isModuleEffectMemberFunction?: boolean;
|
|
30
31
|
currentEvidenceParams?: Map<string, EvidenceParameter>;
|
|
@@ -74,6 +75,7 @@ export interface FunctionGenerationContext extends CodeGenContext {
|
|
|
74
75
|
}>;
|
|
75
76
|
asyncWhileLoopInfo?: Map<number, {
|
|
76
77
|
conditionExpr: Expr;
|
|
78
|
+
stepExpr?: Expr;
|
|
77
79
|
bodyExpr: Expr;
|
|
78
80
|
bodyExprsAfterAwait?: Expr[];
|
|
79
81
|
condBranchPostWhileExprs?: {
|
|
@@ -86,6 +88,7 @@ export interface FunctionGenerationContext extends CodeGenContext {
|
|
|
86
88
|
outerWhileLoop?: {
|
|
87
89
|
whileLoopIndex: number;
|
|
88
90
|
conditionExpr: Expr;
|
|
91
|
+
stepExpr?: Expr;
|
|
89
92
|
bodyExpr: Expr;
|
|
90
93
|
bodyExprsAfterAwait: Expr[];
|
|
91
94
|
};
|
|
@@ -108,4 +111,6 @@ export interface FunctionGenerationContext extends CodeGenContext {
|
|
|
108
111
|
effectSmConsumedArgCNames?: Set<string>;
|
|
109
112
|
loopBodyDropsBaselineCount?: number;
|
|
110
113
|
overrideReturnTypeStr?: string;
|
|
114
|
+
usesAsync?: boolean;
|
|
115
|
+
usesParallelism?: boolean;
|
|
111
116
|
}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { Emitter } from "../../emitter";
|
|
2
|
-
|
|
2
|
+
import type { TargetInfo } from "../../target";
|
|
3
|
+
export declare function generateParallelismRuntime(emitter: Emitter, _debugParallelism: boolean, targetInfo: TargetInfo): void;
|
|
@@ -2,6 +2,7 @@ import { Emitter } from "../../emitter";
|
|
|
2
2
|
import { type Environment } from "../../env";
|
|
3
3
|
import { type Expr } from "../../expr";
|
|
4
4
|
import type { FunctionValue, FuncValueId } from "../../function-value";
|
|
5
|
+
import type { TargetInfo } from "../../target";
|
|
5
6
|
import type { ArcType, DynType, EnumType, FunctionType, IsoType, StructType, Type, TypeId } from "../../types/definitions";
|
|
6
7
|
import { type TraitValue } from "../../value";
|
|
7
8
|
export interface CodeGenContext {
|
|
@@ -66,6 +67,7 @@ export interface CodeGenContext {
|
|
|
66
67
|
debugGc: boolean;
|
|
67
68
|
debugParallelism: boolean;
|
|
68
69
|
debugAsyncAwait: boolean;
|
|
70
|
+
targetInfo: TargetInfo;
|
|
69
71
|
allocator: "mimalloc" | "libc";
|
|
70
72
|
dynImpls: Map<string, {
|
|
71
73
|
dynType: DynType;
|
package/out/types/src/expr.d.ts
CHANGED
|
@@ -26,3 +26,4 @@ export declare function isTargetLinux(target: TargetInfo): boolean;
|
|
|
26
26
|
export declare function isTargetMacos(target: TargetInfo): boolean;
|
|
27
27
|
export declare function isTargetMSVC(target: TargetInfo): boolean;
|
|
28
28
|
export declare function isTargetWasm(target: TargetInfo): boolean;
|
|
29
|
+
export declare function isTargetPosix(target: TargetInfo): boolean;
|