@shd101wyy/yo 0.0.13 → 0.0.14
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 +4 -1
- package/out/cjs/index.cjs +5598 -45
- package/out/cjs/yo-cli.cjs +755 -764
- package/out/esm/index.mjs +5595 -42
- package/out/types/src/codegen/async/state-code-gen.d.ts +3 -3
- package/out/types/src/codegen/async/state-machine.d.ts +4 -4
- package/out/types/src/codegen/c/collection.d.ts +1 -1
- package/out/types/src/codegen/codegen-c.d.ts +1 -1
- package/out/types/src/codegen/constants.d.ts +1 -1
- package/out/types/src/codegen/exprs/{and_or.d.ts → and-or.d.ts} +2 -2
- package/out/types/src/codegen/exprs/{array_fns.d.ts → array-fns.d.ts} +2 -2
- package/out/types/src/codegen/exprs/assignment.d.ts +2 -2
- package/out/types/src/codegen/exprs/async.d.ts +2 -2
- package/out/types/src/codegen/exprs/atom.d.ts +2 -2
- package/out/types/src/codegen/exprs/await.d.ts +2 -2
- package/out/types/src/codegen/exprs/begin.d.ts +2 -2
- package/out/types/src/codegen/exprs/binding.d.ts +2 -2
- package/out/types/src/codegen/exprs/closures.d.ts +3 -3
- package/out/types/src/codegen/exprs/comptime-value.d.ts +4 -0
- package/out/types/src/codegen/exprs/cond.d.ts +2 -2
- package/out/types/src/codegen/exprs/consume.d.ts +2 -2
- package/out/types/src/codegen/exprs/{drop_dup.d.ts → drop-dup.d.ts} +4 -4
- package/out/types/src/codegen/exprs/dyn.d.ts +2 -2
- package/out/types/src/codegen/exprs/expr.d.ts +2 -2
- package/out/types/src/codegen/exprs/gc.d.ts +2 -2
- package/out/types/src/codegen/exprs/generation.d.ts +2 -2
- package/out/types/src/codegen/exprs/{initialization_assignment.d.ts → initialization-assignment.d.ts} +2 -2
- package/out/types/src/codegen/exprs/{inline_fns.d.ts → inline-fns.d.ts} +2 -2
- package/out/types/src/codegen/exprs/iso.d.ts +2 -2
- package/out/types/src/codegen/exprs/match.d.ts +2 -2
- package/out/types/src/codegen/exprs/open.d.ts +2 -2
- package/out/types/src/codegen/exprs/{other_fn_call.d.ts → other-fn-call.d.ts} +2 -2
- package/out/types/src/codegen/exprs/panic.d.ts +2 -2
- package/out/types/src/codegen/exprs/parallelism.d.ts +2 -2
- package/out/types/src/codegen/exprs/{property_access.d.ts → property-access.d.ts} +2 -2
- package/out/types/src/codegen/exprs/{ptr_fns.d.ts → ptr-fns.d.ts} +2 -2
- package/out/types/src/codegen/exprs/{rc_fns.d.ts → rc-fns.d.ts} +2 -2
- package/out/types/src/codegen/exprs/recur.d.ts +2 -2
- package/out/types/src/codegen/exprs/return.d.ts +2 -2
- package/out/types/src/codegen/exprs/sizeof.d.ts +2 -2
- package/out/types/src/codegen/exprs/{tuple_fn.d.ts → tuple-fn.d.ts} +2 -2
- package/out/types/src/codegen/exprs/while.d.ts +2 -2
- package/out/types/src/codegen/functions/collection.d.ts +4 -3
- package/out/types/src/codegen/functions/context.d.ts +6 -6
- package/out/types/src/codegen/functions/declarations.d.ts +4 -4
- package/out/types/src/codegen/functions/dyn.d.ts +1 -1
- package/out/types/src/codegen/functions/generation.d.ts +5 -5
- package/out/types/src/codegen/types/collection.d.ts +4 -4
- package/out/types/src/codegen/types/dyn.d.ts +2 -2
- package/out/types/src/codegen/types/generation.d.ts +2 -2
- package/out/types/src/codegen/utils/fixup.d.ts +1 -1
- package/out/types/src/codegen/utils/index.d.ts +6 -6
- package/out/types/src/env.d.ts +34 -5
- package/out/types/src/error.d.ts +1 -1
- package/out/types/src/evaluator/async/await-analysis-types.d.ts +1 -1
- package/out/types/src/evaluator/async/await-analysis.d.ts +1 -1
- package/out/types/src/evaluator/builtins/alignof.d.ts +3 -3
- package/out/types/src/evaluator/builtins/{and_or.d.ts → and-or.d.ts} +3 -3
- package/out/types/src/evaluator/builtins/{array_fns.d.ts → array-fns.d.ts} +3 -3
- package/out/types/src/evaluator/builtins/as.d.ts +3 -3
- package/out/types/src/evaluator/builtins/{async_fns.d.ts → async-fns.d.ts} +3 -3
- package/out/types/src/evaluator/builtins/comptime-assert.d.ts +8 -0
- package/out/types/src/evaluator/builtins/comptime-bool-fns.d.ts +8 -0
- package/out/types/src/evaluator/builtins/comptime-expect-error.d.ts +8 -0
- package/out/types/src/evaluator/builtins/comptime-fn.d.ts +8 -0
- package/out/types/src/evaluator/builtins/comptime-list-fns.d.ts +33 -0
- package/out/types/src/evaluator/builtins/comptime-numeric-fns.d.ts +8 -0
- package/out/types/src/evaluator/builtins/comptime-print.d.ts +8 -0
- package/out/types/src/evaluator/builtins/comptime-string-fns.d.ts +8 -0
- package/out/types/src/evaluator/builtins/consume.d.ts +3 -3
- package/out/types/src/evaluator/builtins/drop.d.ts +3 -3
- package/out/types/src/evaluator/builtins/dup.d.ts +3 -3
- package/out/types/src/evaluator/builtins/{expr_fns.d.ts → expr-fns.d.ts} +3 -3
- package/out/types/src/evaluator/builtins/{future_fns.d.ts → future-fns.d.ts} +3 -3
- package/out/types/src/evaluator/builtins/gc.d.ts +3 -3
- package/out/types/src/evaluator/builtins/gensym.d.ts +3 -3
- package/out/types/src/evaluator/builtins/{impl_constraint.d.ts → impl-constraint.d.ts} +3 -3
- package/out/types/src/evaluator/builtins/{macro_expand.d.ts → macro-expand.d.ts} +3 -3
- package/out/types/src/evaluator/builtins/panic.d.ts +3 -3
- package/out/types/src/evaluator/builtins/process.d.ts +3 -3
- package/out/types/src/evaluator/builtins/{ptr_fns.d.ts → ptr-fns.d.ts} +3 -3
- package/out/types/src/evaluator/builtins/quote.d.ts +3 -3
- package/out/types/src/evaluator/builtins/{rc_fns.d.ts → rc-fns.d.ts} +3 -3
- package/out/types/src/evaluator/builtins/rc.d.ts +3 -3
- package/out/types/src/evaluator/builtins/sizeof.d.ts +3 -3
- package/out/types/src/evaluator/builtins/the.d.ts +3 -3
- package/out/types/src/evaluator/builtins/{type_fns.d.ts → type-fns.d.ts} +3 -3
- package/out/types/src/evaluator/builtins/{va_start.d.ts → va-start.d.ts} +3 -3
- package/out/types/src/evaluator/builtins/{var_fns.d.ts → var-fns.d.ts} +3 -3
- package/out/types/src/evaluator/calls/{array_type.d.ts → array-type.d.ts} +4 -4
- package/out/types/src/evaluator/calls/array.d.ts +5 -5
- package/out/types/src/evaluator/calls/{closure_type.d.ts → closure-type.d.ts} +4 -4
- package/out/types/src/evaluator/calls/comptime-fn.d.ts +19 -0
- package/out/types/src/evaluator/calls/comptime-list-type.d.ts +11 -0
- package/out/types/src/evaluator/calls/{function_type.d.ts → function-type.d.ts} +5 -5
- package/out/types/src/evaluator/calls/function.d.ts +6 -6
- package/out/types/src/evaluator/calls/helper.d.ts +6 -6
- package/out/types/src/evaluator/calls/iso.d.ts +4 -4
- package/out/types/src/evaluator/calls/{module_type.d.ts → module-type.d.ts} +4 -4
- package/out/types/src/evaluator/calls/{numeric_type.d.ts → numeric-type.d.ts} +4 -4
- package/out/types/src/evaluator/calls/{pointer_type.d.ts → pointer-type.d.ts} +4 -4
- package/out/types/src/evaluator/calls/pointer.d.ts +3 -3
- package/out/types/src/evaluator/calls/{trait_type.d.ts → trait-type.d.ts} +4 -4
- package/out/types/src/evaluator/calls/type.d.ts +4 -4
- package/out/types/src/evaluator/context.d.ts +6 -6
- package/out/types/src/evaluator/ctfe/ctfe-analysis.d.ts +5 -5
- package/out/types/src/evaluator/exprs/_expr.d.ts +3 -3
- package/out/types/src/evaluator/exprs/assignment.d.ts +3 -3
- package/out/types/src/evaluator/exprs/begin.d.ts +3 -3
- package/out/types/src/evaluator/exprs/binding.d.ts +3 -3
- package/out/types/src/evaluator/exprs/{c_include.d.ts → c-include.d.ts} +3 -3
- package/out/types/src/evaluator/exprs/cond.d.ts +3 -3
- package/out/types/src/evaluator/exprs/{destructuring_assignment.d.ts → destructuring-assignment.d.ts} +5 -5
- package/out/types/src/evaluator/exprs/expr.d.ts +3 -3
- package/out/types/src/evaluator/exprs/extern.d.ts +3 -3
- package/out/types/src/evaluator/exprs/{identifer_and_operator.d.ts → identifer-and-operator.d.ts} +3 -3
- package/out/types/src/evaluator/exprs/import.d.ts +3 -3
- package/out/types/src/evaluator/exprs/{initialization_assignment.d.ts → initialization-assignment.d.ts} +3 -3
- package/out/types/src/evaluator/exprs/match.d.ts +3 -3
- package/out/types/src/evaluator/exprs/open.d.ts +3 -3
- package/out/types/src/evaluator/exprs/{property_access.d.ts → property-access.d.ts} +3 -3
- package/out/types/src/evaluator/exprs/recur.d.ts +3 -3
- package/out/types/src/evaluator/exprs/runtime.d.ts +3 -3
- package/out/types/src/evaluator/exprs/subtype-of.d.ts +8 -0
- package/out/types/src/evaluator/exprs/test.d.ts +3 -3
- package/out/types/src/evaluator/exprs/typeof.d.ts +3 -3
- package/out/types/src/evaluator/exprs/while.d.ts +3 -3
- package/out/types/src/evaluator/index.d.ts +4 -4
- package/out/types/src/evaluator/trait-checking.d.ts +31 -0
- package/out/types/src/evaluator/types/array.d.ts +3 -3
- package/out/types/src/evaluator/types/closure.d.ts +3 -3
- package/out/types/src/evaluator/types/comptime-list.d.ts +8 -0
- package/out/types/src/evaluator/types/{concrete_trait.d.ts → concrete-trait.d.ts} +3 -3
- package/out/types/src/evaluator/types/dyn.d.ts +3 -3
- package/out/types/src/evaluator/types/enum.d.ts +3 -3
- package/out/types/src/evaluator/types/{expr_synthesizer.d.ts → expr-synthesizer.d.ts} +4 -4
- package/out/types/src/evaluator/types/field.d.ts +4 -4
- package/out/types/src/evaluator/types/{fn_trait.d.ts → fn-trait.d.ts} +3 -3
- package/out/types/src/evaluator/types/function.d.ts +16 -10
- package/out/types/src/evaluator/types/{future_trait.d.ts → future-trait.d.ts} +3 -3
- package/out/types/src/evaluator/types/module.d.ts +4 -4
- package/out/types/src/evaluator/types/newtype.d.ts +3 -3
- package/out/types/src/evaluator/types/object.d.ts +3 -3
- package/out/types/src/evaluator/types/slice.d.ts +3 -3
- package/out/types/src/evaluator/types/struct.d.ts +3 -3
- package/out/types/src/evaluator/types/synthesizer.d.ts +2 -2
- package/out/types/src/evaluator/types/trait.d.ts +4 -4
- package/out/types/src/evaluator/types/tuple.d.ts +4 -4
- package/out/types/src/evaluator/types/union.d.ts +3 -3
- package/out/types/src/evaluator/types/utils.d.ts +84 -5
- package/out/types/src/evaluator/types/validation.d.ts +2 -2
- package/out/types/src/evaluator/utils/closure.d.ts +7 -7
- package/out/types/src/evaluator/utils.d.ts +2 -2
- package/out/types/src/evaluator/values/{anonymous_function.d.ts → anonymous-function.d.ts} +3 -3
- package/out/types/src/evaluator/values/{anonymous_module.d.ts → anonymous-module.d.ts} +5 -5
- package/out/types/src/evaluator/values/{anonymous_struct.d.ts → anonymous-struct.d.ts} +3 -3
- package/out/types/src/evaluator/values/array.d.ts +3 -3
- package/out/types/src/evaluator/values/boolean.d.ts +2 -2
- package/out/types/src/evaluator/values/char.d.ts +2 -2
- package/out/types/src/evaluator/values/{clone_value.d.ts → clone-value.d.ts} +1 -1
- package/out/types/src/evaluator/values/comptime-list.d.ts +8 -0
- package/out/types/src/evaluator/values/dyn.d.ts +3 -3
- package/out/types/src/evaluator/values/float.d.ts +3 -3
- package/out/types/src/evaluator/values/impl.d.ts +5 -5
- package/out/types/src/evaluator/values/integer.d.ts +3 -3
- package/out/types/src/evaluator/values/string.d.ts +2 -2
- package/out/types/src/evaluator/values/tuple.d.ts +5 -5
- package/out/types/src/expr.d.ts +283 -283
- package/out/types/src/function-value.d.ts +6 -6
- package/out/types/src/index.d.ts +3 -0
- package/out/types/src/lexer.d.ts +1 -1
- package/out/types/src/module-manager.d.ts +1 -1
- package/out/types/src/parser.d.ts +2 -2
- package/out/types/src/test-runner.d.ts +1 -1
- package/out/types/src/type-value.d.ts +1 -1
- package/out/types/src/types/compatibility.d.ts +2 -2
- package/out/types/src/types/creators.d.ts +29 -16
- package/out/types/src/types/definitions.d.ts +29 -26
- package/out/types/src/types/env-lookup.d.ts +4 -0
- package/out/types/src/types/guards.d.ts +6 -6
- package/out/types/src/types/hierarchy.d.ts +2 -2
- package/out/types/src/types/tags.d.ts +4 -4
- package/out/types/src/types/utils.d.ts +13 -38
- package/out/types/src/unit-value.d.ts +1 -1
- package/out/types/src/value-tag.d.ts +4 -4
- package/out/types/src/value.d.ts +32 -26
- package/out/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -1
- package/std/allocator.yo +5 -5
- package/std/collections/array_list.yo +394 -390
- package/std/collections/hash_map.yo +411 -406
- package/std/collections/hash_set.yo +646 -642
- package/std/collections/linked_list.yo +347 -341
- package/std/io.yo +55 -53
- package/std/path.yo +17 -16
- package/std/prelude.yo +1587 -1455
- package/std/string/rune.yo +25 -24
- package/std/string/string.yo +46 -43
- package/std/sync.yo +50 -30
- package/std/thread.yo +6 -5
- package/std/time.yo +1 -1
- package/out/types/src/codegen/exprs/compt_value.d.ts +0 -4
- package/out/types/src/codegen/types/index.d.ts +0 -3
- package/out/types/src/codegen/values/index.d.ts +0 -1
- package/out/types/src/evaluator/builtins/compt_assert.d.ts +0 -8
- package/out/types/src/evaluator/builtins/compt_boolean_fns.d.ts +0 -8
- package/out/types/src/evaluator/builtins/compt_expect_error.d.ts +0 -8
- package/out/types/src/evaluator/builtins/compt_fn.d.ts +0 -8
- package/out/types/src/evaluator/builtins/compt_list_fns.d.ts +0 -33
- package/out/types/src/evaluator/builtins/compt_numeric_fns.d.ts +0 -8
- package/out/types/src/evaluator/builtins/compt_print.d.ts +0 -8
- package/out/types/src/evaluator/builtins/compt_string_fns.d.ts +0 -8
- package/out/types/src/evaluator/calls/compt_function.d.ts +0 -19
- package/out/types/src/evaluator/calls/compt_list_type.d.ts +0 -11
- package/out/types/src/evaluator/exprs/subtype_of.d.ts +0 -21
- package/out/types/src/evaluator/types/compt_list.d.ts +0 -8
- package/out/types/src/evaluator/values/anonymous_trait.d.ts +0 -17
- package/out/types/src/evaluator/values/compt_list.d.ts +0 -8
- package/out/types/src/types/constants.d.ts +0 -5
- package/out/types/src/types/index.d.ts +0 -8
- package/std/allocators/c_allocator.yo +0 -118
- package/std/index.yo +0 -12
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Environment } from "../../env";
|
|
2
|
-
import { Expr, FnCallExpr } from "../../expr";
|
|
3
|
-
import { EvaluatorContext } from "../context";
|
|
1
|
+
import { type Environment } from "../../env";
|
|
2
|
+
import { type Expr, type FnCallExpr } from "../../expr";
|
|
3
|
+
import type { EvaluatorContext } from "../context";
|
|
4
4
|
export declare function evaluateBinding({ expr, env, context, }: {
|
|
5
5
|
expr: FnCallExpr;
|
|
6
6
|
env: Environment;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Environment } from "../../env";
|
|
2
|
-
import { FnCallExpr } from "../../expr";
|
|
3
|
-
import { EvaluatorContext } from "../context";
|
|
1
|
+
import { type Environment } from "../../env";
|
|
2
|
+
import { type FnCallExpr } from "../../expr";
|
|
3
|
+
import { type EvaluatorContext } from "../context";
|
|
4
4
|
export declare function evaluateCInclude({ expr, env, context, }: {
|
|
5
5
|
expr: FnCallExpr;
|
|
6
6
|
env: Environment;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Environment } from "../../env";
|
|
2
|
-
import { Expr, FnCallExpr } from "../../expr";
|
|
3
|
-
import { EvaluatorContext } from "../context";
|
|
1
|
+
import { type Environment } from "../../env";
|
|
2
|
+
import { type Expr, type FnCallExpr } from "../../expr";
|
|
3
|
+
import type { EvaluatorContext } from "../context";
|
|
4
4
|
export declare function evaluateCond({ expr, env, context, }: {
|
|
5
5
|
expr: FnCallExpr;
|
|
6
6
|
env: Environment;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Environment } from "../../env";
|
|
2
|
-
import { Expr, RuntimeDestructuring } from "../../expr";
|
|
3
|
-
import { Type } from "../../types";
|
|
4
|
-
import { Value } from "../../value";
|
|
5
|
-
import { EvaluatorContext } from "../context";
|
|
1
|
+
import { type Environment } from "../../env";
|
|
2
|
+
import { type Expr, type RuntimeDestructuring } from "../../expr";
|
|
3
|
+
import type { Type } from "../../types/definitions";
|
|
4
|
+
import { type Value } from "../../value";
|
|
5
|
+
import type { EvaluatorContext } from "../context";
|
|
6
6
|
export declare function handleMemberDestructuring({ lhsFunc, lhsFields, rhsFields, rhsValue, rhsType, lhs, env, isCompileTimeOnly, isDestructuringAtomVariable, }: {
|
|
7
7
|
lhsFunc: Expr;
|
|
8
8
|
lhsFields: Expr[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Environment } from "../../env";
|
|
2
|
-
import { Expr } from "../../expr";
|
|
3
|
-
import { EvaluateExpressionFn, EvaluatorContext } from "../context";
|
|
1
|
+
import type { Environment } from "../../env";
|
|
2
|
+
import type { Expr } from "../../expr";
|
|
3
|
+
import type { EvaluateExpressionFn, EvaluatorContext } from "../context";
|
|
4
4
|
export declare function setEvaluateExpressionFn(fn: EvaluateExpressionFn): void;
|
|
5
5
|
export declare function evaluateExpression({ expr, env, context, }: {
|
|
6
6
|
expr: Expr;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Environment } from "../../env";
|
|
2
|
-
import { FnCallExpr } from "../../expr";
|
|
3
|
-
import { EvaluatorContext } from "../context";
|
|
1
|
+
import { type Environment } from "../../env";
|
|
2
|
+
import { type FnCallExpr } from "../../expr";
|
|
3
|
+
import type { EvaluatorContext } from "../context";
|
|
4
4
|
export declare function evaluateExtern({ expr, env, context, }: {
|
|
5
5
|
expr: FnCallExpr;
|
|
6
6
|
env: Environment;
|
package/out/types/src/evaluator/exprs/{identifer_and_operator.d.ts → identifer-and-operator.d.ts}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Environment } from "../../env";
|
|
2
|
-
import { AtomExpr } from "../../expr";
|
|
3
|
-
import { EvaluatorContext } from "../context";
|
|
1
|
+
import { type Environment } from "../../env";
|
|
2
|
+
import { type AtomExpr } from "../../expr";
|
|
3
|
+
import { type EvaluatorContext } from "../context";
|
|
4
4
|
export declare function evaluateIdentifierAndOperator({ expr, env, context, throwErrorOnUndefined, }: {
|
|
5
5
|
expr: AtomExpr;
|
|
6
6
|
env: Environment;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Environment } from "../../env";
|
|
2
|
-
import { FnCallExpr } from "../../expr";
|
|
3
|
-
import { EvaluatorContext } from "../context";
|
|
1
|
+
import type { Environment } from "../../env";
|
|
2
|
+
import { type FnCallExpr } from "../../expr";
|
|
3
|
+
import type { EvaluatorContext } from "../context";
|
|
4
4
|
export declare function evaluateImport({ expr, env, context, stdPath, }: {
|
|
5
5
|
expr: FnCallExpr;
|
|
6
6
|
env: Environment;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Environment } from "../../env";
|
|
2
|
-
import { FnCallExpr } from "../../expr";
|
|
3
|
-
import { EvaluatorContext } from "../context";
|
|
1
|
+
import { type Environment } from "../../env";
|
|
2
|
+
import { type FnCallExpr } from "../../expr";
|
|
3
|
+
import type { EvaluatorContext } from "../context";
|
|
4
4
|
export declare function evaluateInitializationAssignment({ expr, env, context, }: {
|
|
5
5
|
expr: FnCallExpr;
|
|
6
6
|
env: Environment;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Environment } from "../../env";
|
|
2
|
-
import { FnCallExpr } from "../../expr";
|
|
3
|
-
import { EvaluatorContext } from "../context";
|
|
1
|
+
import { type Environment } from "../../env";
|
|
2
|
+
import { type FnCallExpr } from "../../expr";
|
|
3
|
+
import type { EvaluatorContext } from "../context";
|
|
4
4
|
export declare function evaluateMatch({ expr, env, context, }: {
|
|
5
5
|
expr: FnCallExpr;
|
|
6
6
|
env: Environment;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Environment } from "../../env";
|
|
2
|
-
import { FnCallExpr } from "../../expr";
|
|
3
|
-
import { EvaluatorContext } from "../context";
|
|
1
|
+
import { type Environment } from "../../env";
|
|
2
|
+
import { type FnCallExpr } from "../../expr";
|
|
3
|
+
import type { EvaluatorContext } from "../context";
|
|
4
4
|
export declare function evaluateOpen({ expr, env, context, }: {
|
|
5
5
|
expr: FnCallExpr;
|
|
6
6
|
env: Environment;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Environment } from "../../env";
|
|
2
|
-
import { FnCallExpr } from "../../expr";
|
|
3
|
-
import { EvaluatorContext } from "../context";
|
|
1
|
+
import type { Environment } from "../../env";
|
|
2
|
+
import { type FnCallExpr } from "../../expr";
|
|
3
|
+
import type { EvaluatorContext } from "../context";
|
|
4
4
|
export declare function evaluatePropertyAccess({ expr, env, context, }: {
|
|
5
5
|
expr: FnCallExpr;
|
|
6
6
|
env: Environment;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Environment } from "../../env";
|
|
2
|
-
import { Expr, FnCallExpr } from "../../expr";
|
|
3
|
-
import { EvaluatorContext } from "../context";
|
|
1
|
+
import { type Environment } from "../../env";
|
|
2
|
+
import { type Expr, type FnCallExpr } from "../../expr";
|
|
3
|
+
import type { EvaluatorContext } from "../context";
|
|
4
4
|
export declare function evaluateRecur({ expr, env, context, }: {
|
|
5
5
|
expr: FnCallExpr;
|
|
6
6
|
env: Environment;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Environment } from "../../env";
|
|
2
|
-
import { Expr, FnCallExpr } from "../../expr";
|
|
3
|
-
import { EvaluatorContext } from "../context";
|
|
1
|
+
import type { Environment } from "../../env";
|
|
2
|
+
import { type Expr, type FnCallExpr } from "../../expr";
|
|
3
|
+
import type { EvaluatorContext } from "../context";
|
|
4
4
|
export declare function evaluateRuntime({ expr, env, context, }: {
|
|
5
5
|
expr: FnCallExpr;
|
|
6
6
|
env: Environment;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type Environment } from "../../env";
|
|
2
|
+
import { type FnCallExpr } from "../../expr";
|
|
3
|
+
import type { EvaluatorContext } from "../context";
|
|
4
|
+
export declare function evaluateSubtypeOf({ expr, env, context, }: {
|
|
5
|
+
expr: FnCallExpr;
|
|
6
|
+
env: Environment;
|
|
7
|
+
context: EvaluatorContext;
|
|
8
|
+
}): FnCallExpr;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Environment } from "../../env";
|
|
2
|
-
import { FnCallExpr } from "../../expr";
|
|
3
|
-
import { EvaluatorContext } from "../context";
|
|
1
|
+
import type { Environment } from "../../env";
|
|
2
|
+
import { type FnCallExpr } from "../../expr";
|
|
3
|
+
import type { EvaluatorContext } from "../context";
|
|
4
4
|
export declare function evaluateTest({ expr, env, context, }: {
|
|
5
5
|
expr: FnCallExpr;
|
|
6
6
|
env: Environment;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Environment } from "../../env";
|
|
2
|
-
import { FnCallExpr } from "../../expr";
|
|
3
|
-
import { EvaluatorContext } from "../context";
|
|
1
|
+
import type { Environment } from "../../env";
|
|
2
|
+
import { type FnCallExpr } from "../../expr";
|
|
3
|
+
import type { EvaluatorContext } from "../context";
|
|
4
4
|
export declare function evaluateTypeOf({ expr, env, context, }: {
|
|
5
5
|
expr: FnCallExpr;
|
|
6
6
|
env: Environment;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Environment } from "../../env";
|
|
2
|
-
import { FnCallExpr } from "../../expr";
|
|
3
|
-
import { EvaluatorContext } from "../context";
|
|
1
|
+
import type { Environment } from "../../env";
|
|
2
|
+
import { type FnCallExpr } from "../../expr";
|
|
3
|
+
import type { EvaluatorContext } from "../context";
|
|
4
4
|
export declare function evaluateWhile({ expr, env, context, }: {
|
|
5
5
|
expr: FnCallExpr;
|
|
6
6
|
env: Environment;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Expr } from "../expr";
|
|
2
|
-
import { Token } from "../token";
|
|
3
|
-
import { ModuleValue } from "../value";
|
|
4
|
-
import { LoadModuleFn } from "./context";
|
|
1
|
+
import type { Expr } from "../expr";
|
|
2
|
+
import { type Token } from "../token";
|
|
3
|
+
import type { ModuleValue } from "../value";
|
|
4
|
+
import type { LoadModuleFn } from "./context";
|
|
5
5
|
import { clearAllGlobalImplState, clearGenericImplsFromModule, clearImplsFromModule } from "./values/impl";
|
|
6
6
|
export { clearAllGlobalImplState, clearGenericImplsFromModule, clearImplsFromModule, };
|
|
7
7
|
export default class Evaluator {
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type Environment } from "../env";
|
|
2
|
+
import type { Token } from "../token";
|
|
3
|
+
import type { DynType, FnTraitType, FutureTraitType, SomeType, TraitType, Type } from "../types/definitions";
|
|
4
|
+
import type { EvaluatorContext } from "./context";
|
|
5
|
+
export declare function typeImplementsTrait({ targetType, traitType, env, }: {
|
|
6
|
+
targetType: Type;
|
|
7
|
+
traitType: TraitType;
|
|
8
|
+
env: Environment;
|
|
9
|
+
}): boolean;
|
|
10
|
+
export declare function checkTypeImplementsSelfConstraints({ targetType, traitType, env, errorToken, }: {
|
|
11
|
+
targetType: Type;
|
|
12
|
+
traitType: TraitType;
|
|
13
|
+
env: Environment;
|
|
14
|
+
errorToken: Token;
|
|
15
|
+
}): void;
|
|
16
|
+
export declare function typeImplementsComptime(type: Type, env: Environment): boolean;
|
|
17
|
+
export declare function typeImplementsRuntime(type: Type, env: Environment): boolean;
|
|
18
|
+
export declare function typeImplementsSend(type: Type | undefined, env: Environment): boolean;
|
|
19
|
+
export declare function typeImplementsDispose(type: Type | undefined, env: Environment): boolean;
|
|
20
|
+
export declare function typeImplementsAcyclic(type: Type | undefined, env: Environment): boolean;
|
|
21
|
+
export declare function typeIsComptimeOnly(type: Type, env: Environment): boolean;
|
|
22
|
+
export declare function typeIsRuntimeOnly(type: Type, env: Environment): boolean;
|
|
23
|
+
export declare function typeImplementsFn(type: Type | undefined): type is (SomeType | DynType) & {
|
|
24
|
+
isFn: true;
|
|
25
|
+
};
|
|
26
|
+
export declare function extractFnTraitFromType(type: Type): FnTraitType | undefined;
|
|
27
|
+
export declare function typeImplementsFuture(type: Type | undefined): type is (SomeType | DynType) & {
|
|
28
|
+
isFuture: true;
|
|
29
|
+
};
|
|
30
|
+
export declare function extractFutureTraitFromType(type: Type): FutureTraitType | undefined;
|
|
31
|
+
export declare function validateTypeAvailability(type: Type, env: Environment, token: Token, _context?: EvaluatorContext): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Environment } from "../../env";
|
|
2
|
-
import { FnCallExpr } from "../../expr";
|
|
3
|
-
import { EvaluatorContext } from "../context";
|
|
1
|
+
import { type Environment } from "../../env";
|
|
2
|
+
import { type FnCallExpr } from "../../expr";
|
|
3
|
+
import type { EvaluatorContext } from "../context";
|
|
4
4
|
export declare function evaluateArrayType({ expr, env, context, }: {
|
|
5
5
|
expr: FnCallExpr;
|
|
6
6
|
env: Environment;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Environment } from "../../env";
|
|
2
|
-
import { FnCallExpr } from "../../expr";
|
|
3
|
-
import { EvaluatorContext } from "../context";
|
|
1
|
+
import type { Environment } from "../../env";
|
|
2
|
+
import type { FnCallExpr } from "../../expr";
|
|
3
|
+
import type { EvaluatorContext } from "../context";
|
|
4
4
|
export declare function evaluateClosureType({ expr, env, context, }: {
|
|
5
5
|
expr: FnCallExpr;
|
|
6
6
|
env: Environment;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Environment } from "../../env";
|
|
2
|
+
import { type FnCallExpr } from "../../expr";
|
|
3
|
+
import type { EvaluatorContext } from "../context";
|
|
4
|
+
export declare function evaluateComptimeListType({ expr, env, context, }: {
|
|
5
|
+
expr: FnCallExpr;
|
|
6
|
+
env: Environment;
|
|
7
|
+
context: EvaluatorContext;
|
|
8
|
+
}): FnCallExpr;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Environment } from "../../env";
|
|
2
|
-
import { FnCallExpr } from "../../expr";
|
|
3
|
-
import { EvaluatorContext } from "../context";
|
|
1
|
+
import type { Environment } from "../../env";
|
|
2
|
+
import { type FnCallExpr } from "../../expr";
|
|
3
|
+
import type { EvaluatorContext } from "../context";
|
|
4
4
|
export declare function evaluateConcreteType({ expr, env, context, }: {
|
|
5
5
|
expr: FnCallExpr;
|
|
6
6
|
env: Environment;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Environment } from "../../env";
|
|
2
|
-
import { FnCallExpr } from "../../expr";
|
|
3
|
-
import { EvaluatorContext } from "../context";
|
|
1
|
+
import type { Environment } from "../../env";
|
|
2
|
+
import { type FnCallExpr } from "../../expr";
|
|
3
|
+
import type { EvaluatorContext } from "../context";
|
|
4
4
|
export declare function evaluateDynType({ expr, env, context, }: {
|
|
5
5
|
expr: FnCallExpr;
|
|
6
6
|
env: Environment;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Environment } from "../../env";
|
|
2
|
-
import { FnCallExpr } from "../../expr";
|
|
3
|
-
import { EvaluatorContext } from "../context";
|
|
1
|
+
import type { Environment } from "../../env";
|
|
2
|
+
import { type FnCallExpr } from "../../expr";
|
|
3
|
+
import type { EvaluatorContext } from "../context";
|
|
4
4
|
export declare function evaluateEnumType({ expr, env, context, }: {
|
|
5
5
|
expr: FnCallExpr;
|
|
6
6
|
env: Environment;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Environment } from "../../env";
|
|
2
|
-
import { Expr } from "../../expr";
|
|
3
|
-
import { Type } from "../../types";
|
|
4
|
-
import { EvaluatorContext } from "../context";
|
|
1
|
+
import type { Environment } from "../../env";
|
|
2
|
+
import { type Expr } from "../../expr";
|
|
3
|
+
import type { Type } from "../../types/definitions";
|
|
4
|
+
import type { EvaluatorContext } from "../context";
|
|
5
5
|
export declare function synthesizeExprAndType({ expr, type, env, context, }: {
|
|
6
6
|
expr: Expr;
|
|
7
7
|
type: Type;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Environment } from "../../env";
|
|
2
|
-
import { Expr } from "../../expr";
|
|
3
|
-
import { TypeField } from "../../types";
|
|
4
|
-
import { EvaluatorContext } from "../context";
|
|
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
5
|
export declare function evaluateTypeField({ expr, tupleFieldIndex, env, context, forType, }: {
|
|
6
6
|
expr: Expr;
|
|
7
7
|
tupleFieldIndex: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Environment } from "../../env";
|
|
2
|
-
import { FnCallExpr } from "../../expr";
|
|
3
|
-
import { EvaluatorContext } from "../context";
|
|
1
|
+
import { type Environment } from "../../env";
|
|
2
|
+
import { type FnCallExpr } from "../../expr";
|
|
3
|
+
import type { EvaluatorContext } from "../context";
|
|
4
4
|
export declare function evaluateFnTraitType({ expr, env, context, }: {
|
|
5
5
|
expr: FnCallExpr;
|
|
6
6
|
env: Environment;
|
|
@@ -1,18 +1,27 @@
|
|
|
1
|
-
import { Environment } from "../../env";
|
|
2
|
-
import { Expr, FnCallExpr } from "../../expr";
|
|
3
|
-
import { FunctionParameter, FunctionType,
|
|
4
|
-
import { EvaluatorContext } from "../context";
|
|
5
|
-
export declare function evaluateFunctionParameter({ expr, env, context,
|
|
1
|
+
import { type Environment } from "../../env";
|
|
2
|
+
import { type Expr, type FnCallExpr } from "../../expr";
|
|
3
|
+
import type { FunctionParameter, FunctionType, Type } from "../../types/definitions";
|
|
4
|
+
import type { EvaluatorContext } from "../context";
|
|
5
|
+
export declare function evaluateFunctionParameter({ expr, env, context, isParameterComptimeByDefault, }: {
|
|
6
6
|
expr: Expr;
|
|
7
7
|
env: Environment;
|
|
8
8
|
context: EvaluatorContext & {
|
|
9
9
|
isEvaluatingFunctionType: true;
|
|
10
10
|
};
|
|
11
|
-
|
|
11
|
+
isParameterComptimeByDefault: boolean;
|
|
12
12
|
}): {
|
|
13
13
|
parameter: FunctionParameter;
|
|
14
14
|
env: Environment;
|
|
15
15
|
};
|
|
16
|
+
export declare function applyWhereClauseConstraints({ constraintExprs, env, context, }: {
|
|
17
|
+
constraintExprs: Expr[];
|
|
18
|
+
env: Environment;
|
|
19
|
+
context: EvaluatorContext & {
|
|
20
|
+
isEvaluatingFunctionType: true;
|
|
21
|
+
};
|
|
22
|
+
}): {
|
|
23
|
+
env: Environment;
|
|
24
|
+
};
|
|
16
25
|
export declare function evaluateFunctionParameters({ parameterExprs, env, context, }: {
|
|
17
26
|
parameterExprs: Expr[];
|
|
18
27
|
env: Environment;
|
|
@@ -23,11 +32,8 @@ export declare function evaluateFunctionParameters({ parameterExprs, env, contex
|
|
|
23
32
|
parameters: FunctionParameter[];
|
|
24
33
|
forallParameters: FunctionParameter[];
|
|
25
34
|
variadicParameter?: FunctionParameter;
|
|
35
|
+
whereClauseExprs?: Expr[];
|
|
26
36
|
env: Environment;
|
|
27
|
-
whereClauseConstraints?: Map<SomeType, {
|
|
28
|
-
requiredTraits: TraitType[];
|
|
29
|
-
negativeTraits: TraitType[];
|
|
30
|
-
}>;
|
|
31
37
|
};
|
|
32
38
|
export declare function evaluateFunctionType({ expr, env, context, }: {
|
|
33
39
|
expr: FnCallExpr;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Environment } from "../../env";
|
|
2
|
-
import { FnCallExpr } from "../../expr";
|
|
3
|
-
import { EvaluatorContext } from "../context";
|
|
1
|
+
import type { Environment } from "../../env";
|
|
2
|
+
import { type FnCallExpr } from "../../expr";
|
|
3
|
+
import type { EvaluatorContext } from "../context";
|
|
4
4
|
export declare function evaluateFutureType({ expr, env, context, }: {
|
|
5
5
|
expr: FnCallExpr;
|
|
6
6
|
env: Environment;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Environment } from "../../env";
|
|
2
|
-
import { Expr, FnCallExpr } from "../../expr";
|
|
3
|
-
import { ModuleField } from "../../types";
|
|
4
|
-
import { EvaluatorContext } from "../context";
|
|
1
|
+
import type { Environment } from "../../env";
|
|
2
|
+
import { type Expr, type FnCallExpr } from "../../expr";
|
|
3
|
+
import type { ModuleField } from "../../types/definitions";
|
|
4
|
+
import type { EvaluatorContext } from "../context";
|
|
5
5
|
export declare function evaluateModuleField({ expr, moduleFieldIndex, env, context, isForEvaluatingModuleType, }: {
|
|
6
6
|
expr: Expr;
|
|
7
7
|
moduleFieldIndex: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Environment } from "../../env";
|
|
2
|
-
import { FnCallExpr } from "../../expr";
|
|
3
|
-
import { EvaluatorContext } from "../context";
|
|
1
|
+
import type { Environment } from "../../env";
|
|
2
|
+
import { type FnCallExpr } from "../../expr";
|
|
3
|
+
import type { EvaluatorContext } from "../context";
|
|
4
4
|
export declare function evaluateNewtypeType({ expr, env, context, }: {
|
|
5
5
|
expr: FnCallExpr;
|
|
6
6
|
env: Environment;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Environment } from "../../env";
|
|
2
|
-
import { FnCallExpr } from "../../expr";
|
|
3
|
-
import { EvaluatorContext } from "../context";
|
|
1
|
+
import type { Environment } from "../../env";
|
|
2
|
+
import { type FnCallExpr } from "../../expr";
|
|
3
|
+
import type { EvaluatorContext } from "../context";
|
|
4
4
|
export declare function evaluateObjectType({ expr, env, context, }: {
|
|
5
5
|
expr: FnCallExpr;
|
|
6
6
|
env: Environment;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Environment } from "../../env";
|
|
2
|
-
import { FnCallExpr } from "../../expr";
|
|
3
|
-
import { EvaluatorContext } from "../context";
|
|
1
|
+
import type { Environment } from "../../env";
|
|
2
|
+
import { type FnCallExpr } from "../../expr";
|
|
3
|
+
import type { EvaluatorContext } from "../context";
|
|
4
4
|
export declare function evaluateSliceType({ expr, env, context, }: {
|
|
5
5
|
expr: FnCallExpr;
|
|
6
6
|
env: Environment;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Environment } from "../../env";
|
|
2
|
-
import { FnCallExpr } from "../../expr";
|
|
3
|
-
import { EvaluatorContext } from "../context";
|
|
1
|
+
import type { Environment } from "../../env";
|
|
2
|
+
import { type FnCallExpr } from "../../expr";
|
|
3
|
+
import type { EvaluatorContext } from "../context";
|
|
4
4
|
export declare function evaluateStructType({ expr, env, context, }: {
|
|
5
5
|
expr: FnCallExpr;
|
|
6
6
|
env: Environment;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Environment } from "../../env";
|
|
2
|
-
import { Type } from "../../types";
|
|
1
|
+
import { type Environment } from "../../env";
|
|
2
|
+
import type { Type } from "../../types/definitions";
|
|
3
3
|
export declare function canAssignTypeHierarchy(expected: Type, given: Type): boolean;
|
|
4
4
|
export declare function synthesizeTypes(expected: {
|
|
5
5
|
type: Type;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Environment } from "../../env";
|
|
2
|
-
import { Expr, FnCallExpr } from "../../expr";
|
|
3
|
-
import { TraitField } from "../../types";
|
|
4
|
-
import { EvaluatorContext } from "../context";
|
|
1
|
+
import { type Environment } from "../../env";
|
|
2
|
+
import { type Expr, type FnCallExpr } from "../../expr";
|
|
3
|
+
import type { TraitField } from "../../types/definitions";
|
|
4
|
+
import type { EvaluatorContext } from "../context";
|
|
5
5
|
export declare function evaluateTraitField({ expr, traitFieldIndex, env, context, isForEvaluatingTraitType, }: {
|
|
6
6
|
expr: Expr;
|
|
7
7
|
traitFieldIndex: number;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Environment } from "../../env";
|
|
2
|
-
import { Expr, FnCallExpr } from "../../expr";
|
|
3
|
-
import { TupleType } from "../../types";
|
|
4
|
-
import { EvaluatorContext } from "../context";
|
|
1
|
+
import type { Environment } from "../../env";
|
|
2
|
+
import { type Expr, type FnCallExpr } from "../../expr";
|
|
3
|
+
import type { TupleType } from "../../types/definitions";
|
|
4
|
+
import type { EvaluatorContext } from "../context";
|
|
5
5
|
export declare function evaluateTupleElementsType({ args, env, context, forType, }: {
|
|
6
6
|
args: Expr[];
|
|
7
7
|
env: Environment;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Environment } from "../../env";
|
|
2
|
-
import { FnCallExpr } from "../../expr";
|
|
3
|
-
import { EvaluatorContext } from "../context";
|
|
1
|
+
import type { Environment } from "../../env";
|
|
2
|
+
import { type FnCallExpr } from "../../expr";
|
|
3
|
+
import { type EvaluatorContext } from "../context";
|
|
4
4
|
export declare function evaluateUnionType({ expr, env, context, }: {
|
|
5
5
|
expr: FnCallExpr;
|
|
6
6
|
env: Environment;
|