@venn-lang/core 0.1.0
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/LICENSE +21 -0
- package/README.md +303 -0
- package/dist/index.d.ts +3654 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +13137 -0
- package/dist/index.js.map +1 -0
- package/package.json +61 -0
- package/src/ast/call-args.ts +15 -0
- package/src/ast/dotted-path.ts +22 -0
- package/src/ast/index.ts +7 -0
- package/src/ast/is-statement.ts +40 -0
- package/src/ast/split-call.ts +28 -0
- package/src/ast/walk.ts +6 -0
- package/src/codes/build-problem.ts +24 -0
- package/src/codes/catalog.ts +35 -0
- package/src/codes/code.types.ts +7 -0
- package/src/codes/index.ts +3 -0
- package/src/compile/compile.ts +169 -0
- package/src/compile/compile.types.ts +40 -0
- package/src/compile/index.ts +3 -0
- package/src/compile/lex-scope.ts +78 -0
- package/src/compile/nodes/binary.ts +56 -0
- package/src/compile/nodes/call.ts +50 -0
- package/src/compile/nodes/collection.ts +83 -0
- package/src/compile/nodes/const-lit.ts +30 -0
- package/src/compile/nodes/fast-binary.ts +71 -0
- package/src/compile/nodes/fn.ts +87 -0
- package/src/compile/nodes/index.ts +8 -0
- package/src/compile/nodes/literal.ts +86 -0
- package/src/compile/nodes/map-fields.ts +79 -0
- package/src/compile/nodes/member.ts +32 -0
- package/src/events/envelope.types.ts +17 -0
- package/src/events/event-data.types.ts +25 -0
- package/src/events/ids.types.ts +10 -0
- package/src/events/index.ts +5 -0
- package/src/events/run-plan.types.ts +18 -0
- package/src/events/status.types.ts +2 -0
- package/src/expand/accepted-kinds.ts +23 -0
- package/src/expand/deco/deco-decorator.ts +77 -0
- package/src/expand/deco/deco-env.ts +24 -0
- package/src/expand/deco/deco.types.ts +43 -0
- package/src/expand/deco/document-decos.ts +64 -0
- package/src/expand/deco/index.ts +7 -0
- package/src/expand/deco/read-signature.ts +57 -0
- package/src/expand/deco/run-body.ts +119 -0
- package/src/expand/decorate-callable.ts +49 -0
- package/src/expand/decorations.ts +41 -0
- package/src/expand/expand.ts +108 -0
- package/src/expand/expand.types.ts +78 -0
- package/src/expand/handles/around-verbs.ts +35 -0
- package/src/expand/handles/binding-verbs.ts +27 -0
- package/src/expand/handles/common-verbs.ts +40 -0
- package/src/expand/handles/fn-verbs.ts +58 -0
- package/src/expand/handles/handle.types.ts +33 -0
- package/src/expand/handles/index.ts +4 -0
- package/src/expand/handles/kind-of.ts +36 -0
- package/src/expand/handles/make-handle.ts +100 -0
- package/src/expand/handles/missing-verb.ts +27 -0
- package/src/expand/handles/runnable-verbs.ts +13 -0
- package/src/expand/handles/type-verbs.ts +56 -0
- package/src/expand/index.ts +40 -0
- package/src/expand/make-context.ts +69 -0
- package/src/expand/node-meta.ts +30 -0
- package/src/expand/node-span.ts +17 -0
- package/src/expand/swap-node.ts +28 -0
- package/src/expand/wrong-kind.ts +102 -0
- package/src/expr/cell.types.ts +25 -0
- package/src/expr/closure.ts +53 -0
- package/src/expr/closure.types.ts +31 -0
- package/src/expr/eval-env.types.ts +9 -0
- package/src/expr/evaluate.ts +18 -0
- package/src/expr/frame.ts +60 -0
- package/src/expr/index.ts +14 -0
- package/src/expr/invoke.ts +140 -0
- package/src/expr/member-value.ts +91 -0
- package/src/expr/methods/index.ts +65 -0
- package/src/expr/methods/list-grouping.ts +107 -0
- package/src/expr/methods/list-methods.ts +57 -0
- package/src/expr/methods/list-selection.ts +142 -0
- package/src/expr/methods/map-extras.ts +87 -0
- package/src/expr/methods/map-methods.ts +17 -0
- package/src/expr/methods/number-methods.ts +29 -0
- package/src/expr/methods/string-extras.ts +66 -0
- package/src/expr/methods/string-methods.ts +32 -0
- package/src/expr/methods/unit-methods.ts +54 -0
- package/src/expr/namespace.ts +20 -0
- package/src/expr/native.types.ts +40 -0
- package/src/expr/operators.ts +91 -0
- package/src/expr/pending.ts +47 -0
- package/src/expr/prelude.ts +75 -0
- package/src/expr/task.ts +71 -0
- package/src/format/format-text.ts +22 -0
- package/src/format/format.types.ts +18 -0
- package/src/format/from-settings.ts +40 -0
- package/src/format/index.ts +5 -0
- package/src/format/organize-header.ts +66 -0
- package/src/format/reindent.ts +35 -0
- package/src/generated/ast.ts +2383 -0
- package/src/generated/grammar.ts +5236 -0
- package/src/generated/module.ts +25 -0
- package/src/grammar/venn.langium +291 -0
- package/src/graph/graph.types.ts +20 -0
- package/src/graph/index.ts +2 -0
- package/src/graph/to-graph.ts +87 -0
- package/src/index.ts +93 -0
- package/src/interpolation/compile-template.ts +40 -0
- package/src/interpolation/index.ts +4 -0
- package/src/interpolation/interpolation.types.ts +18 -0
- package/src/interpolation/scan-interpolations.ts +47 -0
- package/src/interpolation/template.types.ts +19 -0
- package/src/lang/default-services.ts +14 -0
- package/src/lang/index.ts +3 -0
- package/src/lang/venn-lexer.ts +34 -0
- package/src/lang/venn-module.ts +51 -0
- package/src/module/index.ts +5 -0
- package/src/module/specifier.ts +21 -0
- package/src/parse/error-to-problem.ts +43 -0
- package/src/parse/index.ts +3 -0
- package/src/parse/parse-expression.ts +27 -0
- package/src/parse/parse-output.types.ts +8 -0
- package/src/parse/parse.ts +26 -0
- package/src/problem/build-diff.ts +116 -0
- package/src/problem/diff.types.ts +20 -0
- package/src/problem/format-value.ts +40 -0
- package/src/problem/index.ts +8 -0
- package/src/problem/problem-error.ts +15 -0
- package/src/problem/problem.types.ts +21 -0
- package/src/problem/related.types.ts +7 -0
- package/src/problem/severity.types.ts +2 -0
- package/src/problem/span.types.ts +8 -0
- package/src/typecheck/action-signature.ts +53 -0
- package/src/typecheck/builtin-types.ts +63 -0
- package/src/typecheck/builtins.ts +267 -0
- package/src/typecheck/catalog.types.ts +16 -0
- package/src/typecheck/check-deco.ts +174 -0
- package/src/typecheck/check-stmts.ts +151 -0
- package/src/typecheck/check-types.ts +232 -0
- package/src/typecheck/context.ts +31 -0
- package/src/typecheck/imported-types.ts +127 -0
- package/src/typecheck/index.ts +26 -0
- package/src/typecheck/infer.ts +416 -0
- package/src/typecheck/kind-types.ts +79 -0
- package/src/typecheck/member-docs.ts +211 -0
- package/src/typecheck/named-types.ts +57 -0
- package/src/typecheck/prelude-types.ts +152 -0
- package/src/typecheck/reshaped-fns.ts +58 -0
- package/src/typecheck/scheme.ts +75 -0
- package/src/typecheck/seed-params.ts +72 -0
- package/src/typecheck/seed-values.ts +64 -0
- package/src/typecheck/show.ts +64 -0
- package/src/typecheck/solidify.ts +60 -0
- package/src/typecheck/spec-to-type.ts +88 -0
- package/src/typecheck/type-env.ts +46 -0
- package/src/typecheck/type-ref.ts +62 -0
- package/src/typecheck/type.types.ts +168 -0
- package/src/typecheck/unify.ts +192 -0
- package/src/typecheck/unit-types.ts +49 -0
- package/src/units/combine.ts +97 -0
- package/src/units/index.ts +6 -0
- package/src/units/parse-instant.ts +12 -0
- package/src/units/parse-number.ts +48 -0
- package/src/units/unit-guards.ts +16 -0
- package/src/units/unit.types.ts +38 -0
- package/src/value/equals.ts +4 -0
- package/src/value/index.ts +4 -0
- package/src/value/is-numeric.ts +6 -0
- package/src/value/truthiness.ts +9 -0
- package/src/value/value.types.ts +12 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["walk","compare","NO_SPAN","numeric","NO_SPAN","split","NO_SPAN","TASK","group","split","compare","end","count","names","walk","reach","matches","dispatch","NOTHING","NOTHING","nameOf","NO_SPAN","refuse","refuse","bind","signatureProblem","kindOf","prune","NUMBER","STRING","DURATION","SIZE","PERCENT","NUMBER","STRING","NUMBER","STRING","NUMBER","ast.isLetStmt","ast.isExpectStmt","ast.isActionCall","ast.isRunStmt","ast.isIfStmt","ast.isForEachStmt","ast.isWhileStmt","ast.isRepeatStmt","ast.isTryStmt","ast.isReturnStmt","ast.isStepDecl","ast.isGroupDecl","ast.isParallelStmt","ast.isRaceStmt","ast.isLifecycleDecl","isCall","NUMBER","STRING","ast.isFnDecl","ast.isActionCall","settled","ast.isFnDecl","ast.isFnDecl","ast.isLetStmt","ast.isFnDecl","ast.isLetStmt","ast.isFlowDecl","ast.isFragmentDecl","ast.isDecoDecl","ast.isTypeDecl","ast.isConfigDecl","ast.isMatrixDecl","spanOf","ast.isValueImport","ast.isFnDecl"],"sources":["../src/ast/call-args.ts","../src/generated/ast.ts","../src/ast/dotted-path.ts","../src/ast/is-statement.ts","../src/ast/split-call.ts","../src/ast/walk.ts","../src/codes/build-problem.ts","../src/codes/catalog.ts","../src/compile/lex-scope.ts","../src/problem/format-value.ts","../src/problem/build-diff.ts","../src/problem/problem-error.ts","../src/units/combine.ts","../src/units/parse-instant.ts","../src/units/parse-number.ts","../src/units/unit-guards.ts","../src/value/equals.ts","../src/value/is-numeric.ts","../src/value/truthiness.ts","../src/expr/pending.ts","../src/expr/operators.ts","../src/compile/nodes/fast-binary.ts","../src/compile/nodes/binary.ts","../src/expr/cell.types.ts","../src/expr/closure.types.ts","../src/expr/closure.ts","../src/expr/frame.ts","../src/expr/native.types.ts","../src/expr/invoke.ts","../src/compile/nodes/call.ts","../src/compile/nodes/map-fields.ts","../src/compile/nodes/collection.ts","../src/generated/grammar.ts","../src/generated/module.ts","../src/lang/venn-lexer.ts","../src/lang/venn-module.ts","../src/lang/default-services.ts","../src/parse/error-to-problem.ts","../src/parse/parse.ts","../src/parse/parse-expression.ts","../src/interpolation/scan-interpolations.ts","../src/interpolation/compile-template.ts","../src/compile/nodes/literal.ts","../src/compile/nodes/const-lit.ts","../src/compile/nodes/fn.ts","../src/expr/task.ts","../src/expr/methods/list-grouping.ts","../src/expr/methods/list-methods.ts","../src/expr/methods/list-selection.ts","../src/expr/methods/map-extras.ts","../src/expr/methods/map-methods.ts","../src/expr/methods/number-methods.ts","../src/expr/methods/string-extras.ts","../src/expr/methods/string-methods.ts","../src/expr/methods/unit-methods.ts","../src/expr/methods/index.ts","../src/expr/member-value.ts","../src/compile/nodes/member.ts","../src/compile/compile.ts","../src/expand/handles/kind-of.ts","../src/expr/evaluate.ts","../src/expr/namespace.ts","../src/expr/prelude.ts","../src/expand/node-meta.ts","../src/expand/decorations.ts","../src/expand/handles/around-verbs.ts","../src/expand/handles/binding-verbs.ts","../src/expand/swap-node.ts","../src/expand/handles/common-verbs.ts","../src/expand/handles/fn-verbs.ts","../src/expand/handles/missing-verb.ts","../src/expand/handles/runnable-verbs.ts","../src/expand/handles/type-verbs.ts","../src/expand/handles/make-handle.ts","../src/expand/accepted-kinds.ts","../src/expand/node-span.ts","../src/expand/deco/deco-env.ts","../src/expand/wrong-kind.ts","../src/expand/deco/read-signature.ts","../src/expand/deco/run-body.ts","../src/expand/deco/deco-decorator.ts","../src/expand/deco/document-decos.ts","../src/expand/decorate-callable.ts","../src/expand/make-context.ts","../src/expand/expand.ts","../src/format/format.types.ts","../src/format/organize-header.ts","../src/format/reindent.ts","../src/format/format-text.ts","../src/format/from-settings.ts","../src/graph/to-graph.ts","../src/module/specifier.ts","../src/typecheck/builtin-types.ts","../src/typecheck/type.types.ts","../src/typecheck/unify.ts","../src/typecheck/builtins.ts","../src/typecheck/scheme.ts","../src/typecheck/show.ts","../src/typecheck/type-ref.ts","../src/typecheck/unit-types.ts","../src/typecheck/infer.ts","../src/typecheck/action-signature.ts","../src/typecheck/check-stmts.ts","../src/typecheck/type-env.ts","../src/typecheck/check-deco.ts","../src/typecheck/context.ts","../src/typecheck/spec-to-type.ts","../src/typecheck/kind-types.ts","../src/typecheck/named-types.ts","../src/typecheck/prelude-types.ts","../src/typecheck/reshaped-fns.ts","../src/typecheck/solidify.ts","../src/typecheck/seed-params.ts","../src/typecheck/seed-values.ts","../src/typecheck/check-types.ts","../src/typecheck/imported-types.ts","../src/typecheck/member-docs.ts"],"sourcesContent":["import type { ActionCall, Expr } from \"../generated/ast.js\";\n\n/**\n * The arguments of a call, however it was written.\n *\n * The language spells a call two ways, `conn.close()` with brackets and\n * `http.get \"url\"` without, and the parser keeps them in different places on\n * the node. They are the same call with the same arguments, so every reader\n * downstream asks here and sees one list.\n */\nexport function callArgs(call: ActionCall): readonly Expr[] {\n const bracketed = call.call?.args ?? [];\n if (bracketed.length === 0) return call.args;\n return [...bracketed.map((arg) => arg.value), ...call.args];\n}\n","/******************************************************************************\n * This file was generated by langium-cli 4.3.0.\n * DO NOT EDIT MANUALLY!\n ******************************************************************************/\n\n/* eslint-disable */\nimport * as langium from 'langium';\n\nexport const VennTerminals = {\n NL: /([ \\t]*(\\r?\\n|;)[ \\t]*)+/,\n WS: /[ \\t]+/,\n COMMENT: /#[^\\n\\r]*/,\n INSTANT: /[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?Z/,\n STRING: /\"(\\\\.|[^\"\\\\])*\"|'(\\\\.|[^'\\\\])*'/,\n NUMBER: /[0-9]+(_[0-9]+)*(\\.[0-9]+(_[0-9]+)*)?(ms|kb|mb|gb|b|s|m|h|%)?/,\n ID: /[_a-zA-Z]\\w*/,\n};\n\nexport type VennTerminalNames = keyof typeof VennTerminals;\n\nexport type VennKeywordNames =\n | \"!\"\n | \"!=\"\n | \"%\"\n | \"&&\"\n | \"(\"\n | \")\"\n | \"*\"\n | \"+\"\n | \",\"\n | \"-\"\n | \"->\"\n | \".\"\n | \"/\"\n | \":\"\n | \"<\"\n | \"<=\"\n | \"=\"\n | \"==\"\n | \"=>\"\n | \">\"\n | \">=\"\n | \"?\"\n | \"?.\"\n | \"??\"\n | \"@\"\n | \"[\"\n | \"]\"\n | \"afterEach\"\n | \"all\"\n | \"as\"\n | \"beforeEach\"\n | \"break\"\n | \"capture\"\n | \"catch\"\n | \"config\"\n | \"const\"\n | \"continue\"\n | \"dataset\"\n | \"deco\"\n | \"defer\"\n | \"else\"\n | \"expect\"\n | \"factory\"\n | \"false\"\n | \"finally\"\n | \"flow\"\n | \"fn\"\n | \"forEach\"\n | \"fragment\"\n | \"from\"\n | \"group\"\n | \"if\"\n | \"import\"\n | \"in\"\n | \"let\"\n | \"matrix\"\n | \"module\"\n | \"not\"\n | \"null\"\n | \"on\"\n | \"parallel\"\n | \"pub\"\n | \"race\"\n | \"repeat\"\n | \"report\"\n | \"return\"\n | \"run\"\n | \"setup\"\n | \"soft\"\n | \"step\"\n | \"teardown\"\n | \"true\"\n | \"try\"\n | \"type\"\n | \"use\"\n | \"while\"\n | \"{\"\n | \"|\"\n | \"||\"\n | \"}\"\n | \"~=\";\n\nexport type VennTokenNames = VennTerminalNames | VennKeywordNames;\n\nexport interface ActionCall extends Declaration, Statement {\n readonly $type: 'ActionCall';\n args: Array<Expr>;\n call?: ArgList;\n called: boolean;\n opts?: MapLit;\n target: QualifiedName;\n}\n\nexport const ActionCall = {\n $type: 'ActionCall',\n annotations: 'annotations',\n args: 'args',\n call: 'call',\n called: 'called',\n opts: 'opts',\n target: 'target'\n} as const;\n\nexport function isActionCall(item: unknown): item is ActionCall {\n return reflection.isInstance(item, ActionCall.$type);\n}\n\nexport interface Annotation extends langium.AstNode {\n readonly $container: Declaration | FieldDecl | Param | Statement;\n readonly $type: 'Annotation';\n args?: ArgList;\n name: string;\n}\n\nexport const Annotation = {\n $type: 'Annotation',\n args: 'args',\n name: 'name'\n} as const;\n\nexport function isAnnotation(item: unknown): item is Annotation {\n return reflection.isInstance(item, Annotation.$type);\n}\n\nexport interface Arg extends langium.AstNode {\n readonly $container: ArgList;\n readonly $type: 'Arg';\n name?: string;\n value: Expr;\n}\n\nexport const Arg = {\n $type: 'Arg',\n name: 'name',\n value: 'value'\n} as const;\n\nexport function isArg(item: unknown): item is Arg {\n return reflection.isInstance(item, Arg.$type);\n}\n\nexport interface ArgList extends langium.AstNode {\n readonly $container: ActionCall | Annotation | Call | RunStmt;\n readonly $type: 'ArgList';\n args: Array<Arg>;\n}\n\nexport const ArgList = {\n $type: 'ArgList',\n args: 'args'\n} as const;\n\nexport function isArgList(item: unknown): item is ArgList {\n return reflection.isInstance(item, ArgList.$type);\n}\n\nexport interface Binary extends langium.AstNode {\n readonly $container: ActionCall | Arg | Binary | Call | CaptureStmt | DatasetDecl | ExpectStmt | FnBody | ForEachStmt | IfStmt | Index | LetStmt | LifecycleDecl | ListLit | MapEntry | MatcherClause | Member | RepeatStmt | ReportDecl | ReturnStmt | Ternary | Unary | WhileStmt;\n readonly $type: 'Binary';\n left: Expr;\n operator: '!=' | '%' | '&&' | '*' | '+' | '-' | '/' | '<' | '<=' | '==' | '>' | '>=' | '??' | 'in' | '||' | '~=';\n right: Expr;\n}\n\nexport const Binary = {\n $type: 'Binary',\n left: 'left',\n operator: 'operator',\n right: 'right'\n} as const;\n\nexport function isBinary(item: unknown): item is Binary {\n return reflection.isInstance(item, Binary.$type);\n}\n\nexport interface Block extends langium.AstNode {\n readonly $container: DecoDecl | FlowDecl | ForEachStmt | FragmentDecl | GroupDecl | IfStmt | LifecycleDecl | ParallelStmt | RaceStmt | RepeatStmt | StepDecl | TryStmt | WhileStmt;\n readonly $type: 'Block';\n stmts: Array<Statement>;\n}\n\nexport const Block = {\n $type: 'Block',\n stmts: 'stmts'\n} as const;\n\nexport function isBlock(item: unknown): item is Block {\n return reflection.isInstance(item, Block.$type);\n}\n\nexport interface BoolLit extends langium.AstNode {\n readonly $container: ActionCall | Arg | Binary | Call | CaptureStmt | DatasetDecl | ExpectStmt | FnBody | ForEachStmt | IfStmt | Index | LetStmt | LifecycleDecl | ListLit | MapEntry | MatcherClause | Member | RepeatStmt | ReportDecl | ReturnStmt | Ternary | Unary | WhileStmt;\n readonly $type: 'BoolLit';\n value: 'false' | 'true';\n}\n\nexport const BoolLit = {\n $type: 'BoolLit',\n value: 'value'\n} as const;\n\nexport function isBoolLit(item: unknown): item is BoolLit {\n return reflection.isInstance(item, BoolLit.$type);\n}\n\nexport interface BreakStmt extends Statement {\n readonly $type: 'BreakStmt';\n}\n\nexport const BreakStmt = {\n $type: 'BreakStmt',\n annotations: 'annotations'\n} as const;\n\nexport function isBreakStmt(item: unknown): item is BreakStmt {\n return reflection.isInstance(item, BreakStmt.$type);\n}\n\nexport interface Call extends langium.AstNode {\n readonly $container: ActionCall | Arg | Binary | Call | CaptureStmt | DatasetDecl | ExpectStmt | FnBody | ForEachStmt | IfStmt | Index | LetStmt | LifecycleDecl | ListLit | MapEntry | MatcherClause | Member | RepeatStmt | ReportDecl | ReturnStmt | Ternary | Unary | WhileStmt;\n readonly $type: 'Call';\n args?: ArgList;\n callee: Expr;\n}\n\nexport const Call = {\n $type: 'Call',\n args: 'args',\n callee: 'callee'\n} as const;\n\nexport function isCall(item: unknown): item is Call {\n return reflection.isInstance(item, Call.$type);\n}\n\nexport interface CaptureStmt extends Statement {\n readonly $type: 'CaptureStmt';\n name: string;\n opts?: MapLit;\n value: Expr;\n}\n\nexport const CaptureStmt = {\n $type: 'CaptureStmt',\n annotations: 'annotations',\n name: 'name',\n opts: 'opts',\n value: 'value'\n} as const;\n\nexport function isCaptureStmt(item: unknown): item is CaptureStmt {\n return reflection.isInstance(item, CaptureStmt.$type);\n}\n\nexport interface ConfigDecl extends Declaration {\n readonly $type: 'ConfigDecl';\n body: MapLit;\n}\n\nexport const ConfigDecl = {\n $type: 'ConfigDecl',\n annotations: 'annotations',\n body: 'body'\n} as const;\n\nexport function isConfigDecl(item: unknown): item is ConfigDecl {\n return reflection.isInstance(item, ConfigDecl.$type);\n}\n\nexport interface ContinueStmt extends Statement {\n readonly $type: 'ContinueStmt';\n}\n\nexport const ContinueStmt = {\n $type: 'ContinueStmt',\n annotations: 'annotations'\n} as const;\n\nexport function isContinueStmt(item: unknown): item is ContinueStmt {\n return reflection.isInstance(item, ContinueStmt.$type);\n}\n\nexport interface DatasetDecl extends Declaration {\n readonly $type: 'DatasetDecl';\n declaredType?: TypeRef;\n name: string;\n value: Expr;\n}\n\nexport const DatasetDecl = {\n $type: 'DatasetDecl',\n annotations: 'annotations',\n declaredType: 'declaredType',\n name: 'name',\n value: 'value'\n} as const;\n\nexport function isDatasetDecl(item: unknown): item is DatasetDecl {\n return reflection.isInstance(item, DatasetDecl.$type);\n}\n\nexport interface Declaration extends langium.AstNode {\n readonly $type: 'ActionCall' | 'ConfigDecl' | 'DatasetDecl' | 'Declaration' | 'DecoDecl' | 'ExpectStmt' | 'FactoryDecl' | 'FlowDecl' | 'FnDecl' | 'ForEachStmt' | 'FragmentDecl' | 'IfStmt' | 'LetStmt' | 'LifecycleDecl' | 'MatrixDecl' | 'ParallelStmt' | 'RaceStmt' | 'RepeatStmt' | 'ReportDecl' | 'RunStmt' | 'TryStmt' | 'TypeDecl' | 'WhileStmt';\n annotations: Array<Annotation>;\n}\n\nexport const Declaration = {\n $type: 'Declaration',\n annotations: 'annotations'\n} as const;\n\nexport function isDeclaration(item: unknown): item is Declaration {\n return reflection.isInstance(item, Declaration.$type);\n}\n\nexport interface DecoDecl extends Declaration {\n readonly $type: 'DecoDecl';\n body: Block;\n export: boolean;\n name: string;\n params?: ParamList;\n}\n\nexport const DecoDecl = {\n $type: 'DecoDecl',\n annotations: 'annotations',\n body: 'body',\n export: 'export',\n name: 'name',\n params: 'params'\n} as const;\n\nexport function isDecoDecl(item: unknown): item is DecoDecl {\n return reflection.isInstance(item, DecoDecl.$type);\n}\n\nexport interface Document extends langium.AstNode {\n readonly $type: 'Document';\n decls: Array<Declaration>;\n imports: Array<ImportDecl>;\n name?: QualifiedName;\n}\n\nexport const Document = {\n $type: 'Document',\n decls: 'decls',\n imports: 'imports',\n name: 'name'\n} as const;\n\nexport function isDocument(item: unknown): item is Document {\n return reflection.isInstance(item, Document.$type);\n}\n\nexport type ElseBranch = Block | IfStmt;\n\nexport const ElseBranch = {\n $type: 'ElseBranch'\n} as const;\n\nexport function isElseBranch(item: unknown): item is ElseBranch {\n return reflection.isInstance(item, ElseBranch.$type);\n}\n\nexport interface ExpectStmt extends Declaration, Statement {\n readonly $type: 'ExpectStmt';\n checks: Array<Expr>;\n matcher?: MatcherClause;\n modifier?: 'all' | 'soft';\n negate: boolean;\n subject?: Expr;\n}\n\nexport const ExpectStmt = {\n $type: 'ExpectStmt',\n annotations: 'annotations',\n checks: 'checks',\n matcher: 'matcher',\n modifier: 'modifier',\n negate: 'negate',\n subject: 'subject'\n} as const;\n\nexport function isExpectStmt(item: unknown): item is ExpectStmt {\n return reflection.isInstance(item, ExpectStmt.$type);\n}\n\nexport type Expr = Binary | BoolLit | Call | FnExpr | Index | InstantLit | ListLit | MapLit | Member | NullLit | NumberLit | Ref | StringLit | Ternary | Unary;\n\nexport const Expr = {\n $type: 'Expr'\n} as const;\n\nexport function isExpr(item: unknown): item is Expr {\n return reflection.isInstance(item, Expr.$type);\n}\n\nexport interface FactoryDecl extends Declaration {\n readonly $type: 'FactoryDecl';\n body: MapLit;\n name: string;\n}\n\nexport const FactoryDecl = {\n $type: 'FactoryDecl',\n annotations: 'annotations',\n body: 'body',\n name: 'name'\n} as const;\n\nexport function isFactoryDecl(item: unknown): item is FactoryDecl {\n return reflection.isInstance(item, FactoryDecl.$type);\n}\n\nexport interface FieldDecl extends langium.AstNode {\n readonly $container: TypeBody;\n readonly $type: 'FieldDecl';\n annotations: Array<Annotation>;\n fieldType: TypeRef;\n name: string;\n optional: boolean;\n}\n\nexport const FieldDecl = {\n $type: 'FieldDecl',\n annotations: 'annotations',\n fieldType: 'fieldType',\n name: 'name',\n optional: 'optional'\n} as const;\n\nexport function isFieldDecl(item: unknown): item is FieldDecl {\n return reflection.isInstance(item, FieldDecl.$type);\n}\n\nexport interface FlowDecl extends Declaration {\n readonly $type: 'FlowDecl';\n body: Block;\n title: string;\n}\n\nexport const FlowDecl = {\n $type: 'FlowDecl',\n annotations: 'annotations',\n body: 'body',\n title: 'title'\n} as const;\n\nexport function isFlowDecl(item: unknown): item is FlowDecl {\n return reflection.isInstance(item, FlowDecl.$type);\n}\n\nexport interface FnBody extends langium.AstNode {\n readonly $container: FnDecl | FnExpr;\n readonly $type: 'FnBody';\n locals: Array<LetStmt>;\n result: Expr;\n}\n\nexport const FnBody = {\n $type: 'FnBody',\n locals: 'locals',\n result: 'result'\n} as const;\n\nexport function isFnBody(item: unknown): item is FnBody {\n return reflection.isInstance(item, FnBody.$type);\n}\n\nexport interface FnDecl extends Declaration {\n readonly $type: 'FnDecl';\n body: FnBody;\n export: boolean;\n name: string;\n params?: ParamList;\n returns?: TypeRef;\n}\n\nexport const FnDecl = {\n $type: 'FnDecl',\n annotations: 'annotations',\n body: 'body',\n export: 'export',\n name: 'name',\n params: 'params',\n returns: 'returns'\n} as const;\n\nexport function isFnDecl(item: unknown): item is FnDecl {\n return reflection.isInstance(item, FnDecl.$type);\n}\n\nexport interface FnExpr extends langium.AstNode {\n readonly $container: ActionCall | Arg | Binary | Call | CaptureStmt | DatasetDecl | ExpectStmt | FnBody | ForEachStmt | IfStmt | Index | LetStmt | LifecycleDecl | ListLit | MapEntry | MatcherClause | Member | RepeatStmt | ReportDecl | ReturnStmt | Ternary | Unary | WhileStmt;\n readonly $type: 'FnExpr';\n body: FnBody;\n params: ParamList;\n returns?: TypeRef;\n}\n\nexport const FnExpr = {\n $type: 'FnExpr',\n body: 'body',\n params: 'params',\n returns: 'returns'\n} as const;\n\nexport function isFnExpr(item: unknown): item is FnExpr {\n return reflection.isInstance(item, FnExpr.$type);\n}\n\nexport interface ForEachStmt extends Declaration, Statement {\n readonly $type: 'ForEachStmt';\n body: Block;\n item: string;\n opts?: MapLit;\n source: Expr;\n}\n\nexport const ForEachStmt = {\n $type: 'ForEachStmt',\n annotations: 'annotations',\n body: 'body',\n item: 'item',\n opts: 'opts',\n source: 'source'\n} as const;\n\nexport function isForEachStmt(item: unknown): item is ForEachStmt {\n return reflection.isInstance(item, ForEachStmt.$type);\n}\n\nexport interface FragmentDecl extends Declaration {\n readonly $type: 'FragmentDecl';\n body: Block;\n export: boolean;\n name: string;\n params?: ParamList;\n returns?: TypeRef;\n}\n\nexport const FragmentDecl = {\n $type: 'FragmentDecl',\n annotations: 'annotations',\n body: 'body',\n export: 'export',\n name: 'name',\n params: 'params',\n returns: 'returns'\n} as const;\n\nexport function isFragmentDecl(item: unknown): item is FragmentDecl {\n return reflection.isInstance(item, FragmentDecl.$type);\n}\n\nexport interface GroupDecl extends Statement {\n readonly $type: 'GroupDecl';\n body: Block;\n title: string;\n}\n\nexport const GroupDecl = {\n $type: 'GroupDecl',\n annotations: 'annotations',\n body: 'body',\n title: 'title'\n} as const;\n\nexport function isGroupDecl(item: unknown): item is GroupDecl {\n return reflection.isInstance(item, GroupDecl.$type);\n}\n\nexport interface IfStmt extends Declaration, Statement {\n readonly $container: IfStmt;\n readonly $type: 'IfStmt';\n cond: Expr;\n otherwise?: ElseBranch;\n then: Block;\n}\n\nexport const IfStmt = {\n $type: 'IfStmt',\n annotations: 'annotations',\n cond: 'cond',\n otherwise: 'otherwise',\n then: 'then'\n} as const;\n\nexport function isIfStmt(item: unknown): item is IfStmt {\n return reflection.isInstance(item, IfStmt.$type);\n}\n\nexport type ImportDecl = UseDecl | ValueImport;\n\nexport const ImportDecl = {\n $type: 'ImportDecl'\n} as const;\n\nexport function isImportDecl(item: unknown): item is ImportDecl {\n return reflection.isInstance(item, ImportDecl.$type);\n}\n\nexport interface Index extends langium.AstNode {\n readonly $container: ActionCall | Arg | Binary | Call | CaptureStmt | DatasetDecl | ExpectStmt | FnBody | ForEachStmt | IfStmt | Index | LetStmt | LifecycleDecl | ListLit | MapEntry | MatcherClause | Member | RepeatStmt | ReportDecl | ReturnStmt | Ternary | Unary | WhileStmt;\n readonly $type: 'Index';\n index: Expr;\n receiver: Expr;\n}\n\nexport const Index = {\n $type: 'Index',\n index: 'index',\n receiver: 'receiver'\n} as const;\n\nexport function isIndex(item: unknown): item is Index {\n return reflection.isInstance(item, Index.$type);\n}\n\nexport interface InstantLit extends langium.AstNode {\n readonly $container: ActionCall | Arg | Binary | Call | CaptureStmt | DatasetDecl | ExpectStmt | FnBody | ForEachStmt | IfStmt | Index | LetStmt | LifecycleDecl | ListLit | MapEntry | MatcherClause | Member | RepeatStmt | ReportDecl | ReturnStmt | Ternary | Unary | WhileStmt;\n readonly $type: 'InstantLit';\n value: string;\n}\n\nexport const InstantLit = {\n $type: 'InstantLit',\n value: 'value'\n} as const;\n\nexport function isInstantLit(item: unknown): item is InstantLit {\n return reflection.isInstance(item, InstantLit.$type);\n}\n\nexport interface LetStmt extends Declaration, Statement {\n readonly $container: FnBody;\n readonly $type: 'LetStmt';\n args: Array<Expr>;\n declaredType?: TypeRef;\n kind: 'const' | 'let';\n name: string;\n opts?: MapLit;\n value: Expr;\n}\n\nexport const LetStmt = {\n $type: 'LetStmt',\n annotations: 'annotations',\n args: 'args',\n declaredType: 'declaredType',\n kind: 'kind',\n name: 'name',\n opts: 'opts',\n value: 'value'\n} as const;\n\nexport function isLetStmt(item: unknown): item is LetStmt {\n return reflection.isInstance(item, LetStmt.$type);\n}\n\nexport interface LifecycleDecl extends Declaration, Statement {\n readonly $type: 'LifecycleDecl';\n arg?: Expr;\n body: Block;\n event?: string;\n hook?: 'afterEach' | 'beforeEach' | 'defer' | 'setup' | 'teardown';\n}\n\nexport const LifecycleDecl = {\n $type: 'LifecycleDecl',\n annotations: 'annotations',\n arg: 'arg',\n body: 'body',\n event: 'event',\n hook: 'hook'\n} as const;\n\nexport function isLifecycleDecl(item: unknown): item is LifecycleDecl {\n return reflection.isInstance(item, LifecycleDecl.$type);\n}\n\nexport interface ListLit extends langium.AstNode {\n readonly $container: ActionCall | Arg | Binary | Call | CaptureStmt | DatasetDecl | ExpectStmt | FnBody | ForEachStmt | IfStmt | Index | LetStmt | LifecycleDecl | ListLit | MapEntry | MatcherClause | Member | RepeatStmt | ReportDecl | ReturnStmt | Ternary | Unary | WhileStmt;\n readonly $type: 'ListLit';\n items: Array<Expr>;\n}\n\nexport const ListLit = {\n $type: 'ListLit',\n items: 'items'\n} as const;\n\nexport function isListLit(item: unknown): item is ListLit {\n return reflection.isInstance(item, ListLit.$type);\n}\n\nexport interface LiteralType extends langium.AstNode {\n readonly $container: TypeRef;\n readonly $type: 'LiteralType';\n value: string;\n}\n\nexport const LiteralType = {\n $type: 'LiteralType',\n value: 'value'\n} as const;\n\nexport function isLiteralType(item: unknown): item is LiteralType {\n return reflection.isInstance(item, LiteralType.$type);\n}\n\nexport interface MapEntry extends langium.AstNode {\n readonly $container: MapLit;\n readonly $type: 'MapEntry';\n key: MapKey;\n value: Expr;\n}\n\nexport const MapEntry = {\n $type: 'MapEntry',\n key: 'key',\n value: 'value'\n} as const;\n\nexport function isMapEntry(item: unknown): item is MapEntry {\n return reflection.isInstance(item, MapEntry.$type);\n}\n\nexport type MapKey = Word | string;\n\nexport function isMapKey(item: unknown): item is MapKey {\n return isWord(item) || (typeof item === 'string' && (/\"(\\\\.|[^\"\\\\])*\"|'(\\\\.|[^'\\\\])*'/.test(item)));\n}\n\nexport interface MapLit extends langium.AstNode {\n readonly $container: ActionCall | Arg | Binary | Call | CaptureStmt | ConfigDecl | DatasetDecl | ExpectStmt | FactoryDecl | FnBody | ForEachStmt | IfStmt | Index | LetStmt | LifecycleDecl | ListLit | MapEntry | MatcherClause | MatrixDecl | Member | ParallelStmt | RaceStmt | RepeatStmt | ReportDecl | ReturnStmt | Ternary | Unary | WhileStmt;\n readonly $type: 'MapLit';\n entries: Array<MapEntry>;\n}\n\nexport const MapLit = {\n $type: 'MapLit',\n entries: 'entries'\n} as const;\n\nexport function isMapLit(item: unknown): item is MapLit {\n return reflection.isInstance(item, MapLit.$type);\n}\n\nexport interface MatcherClause extends langium.AstNode {\n readonly $container: ExpectStmt;\n readonly $type: 'MatcherClause';\n args: Array<Expr>;\n name: string;\n opts?: MapLit;\n}\n\nexport const MatcherClause = {\n $type: 'MatcherClause',\n args: 'args',\n name: 'name',\n opts: 'opts'\n} as const;\n\nexport function isMatcherClause(item: unknown): item is MatcherClause {\n return reflection.isInstance(item, MatcherClause.$type);\n}\n\nexport interface MatrixDecl extends Declaration {\n readonly $type: 'MatrixDecl';\n body: MapLit;\n}\n\nexport const MatrixDecl = {\n $type: 'MatrixDecl',\n annotations: 'annotations',\n body: 'body'\n} as const;\n\nexport function isMatrixDecl(item: unknown): item is MatrixDecl {\n return reflection.isInstance(item, MatrixDecl.$type);\n}\n\nexport interface Member extends langium.AstNode {\n readonly $container: ActionCall | Arg | Binary | Call | CaptureStmt | DatasetDecl | ExpectStmt | FnBody | ForEachStmt | IfStmt | Index | LetStmt | LifecycleDecl | ListLit | MapEntry | MatcherClause | Member | RepeatStmt | ReportDecl | ReturnStmt | Ternary | Unary | WhileStmt;\n readonly $type: 'Member';\n member: Word | string;\n optional: boolean;\n receiver: Expr;\n}\n\nexport const Member = {\n $type: 'Member',\n member: 'member',\n optional: 'optional',\n receiver: 'receiver'\n} as const;\n\nexport function isMember(item: unknown): item is Member {\n return reflection.isInstance(item, Member.$type);\n}\n\nexport interface NamedType extends langium.AstNode {\n readonly $container: TypeRef;\n readonly $type: 'NamedType';\n args: Array<TypeRef>;\n name: QualifiedName;\n}\n\nexport const NamedType = {\n $type: 'NamedType',\n args: 'args',\n name: 'name'\n} as const;\n\nexport function isNamedType(item: unknown): item is NamedType {\n return reflection.isInstance(item, NamedType.$type);\n}\n\nexport interface NullLit extends langium.AstNode {\n readonly $container: ActionCall | Arg | Binary | Call | CaptureStmt | DatasetDecl | ExpectStmt | FnBody | ForEachStmt | IfStmt | Index | LetStmt | LifecycleDecl | ListLit | MapEntry | MatcherClause | Member | RepeatStmt | ReportDecl | ReturnStmt | Ternary | Unary | WhileStmt;\n readonly $type: 'NullLit';\n}\n\nexport const NullLit = {\n $type: 'NullLit'\n} as const;\n\nexport function isNullLit(item: unknown): item is NullLit {\n return reflection.isInstance(item, NullLit.$type);\n}\n\nexport interface NumberLit extends langium.AstNode {\n readonly $container: ActionCall | Arg | Binary | Call | CaptureStmt | DatasetDecl | ExpectStmt | FnBody | ForEachStmt | IfStmt | Index | LetStmt | LifecycleDecl | ListLit | MapEntry | MatcherClause | Member | RepeatStmt | ReportDecl | ReturnStmt | Ternary | Unary | WhileStmt;\n readonly $type: 'NumberLit';\n raw: string;\n}\n\nexport const NumberLit = {\n $type: 'NumberLit',\n raw: 'raw'\n} as const;\n\nexport function isNumberLit(item: unknown): item is NumberLit {\n return reflection.isInstance(item, NumberLit.$type);\n}\n\nexport interface ParallelStmt extends Declaration, Statement {\n readonly $type: 'ParallelStmt';\n body: Block;\n opts?: MapLit;\n}\n\nexport const ParallelStmt = {\n $type: 'ParallelStmt',\n annotations: 'annotations',\n body: 'body',\n opts: 'opts'\n} as const;\n\nexport function isParallelStmt(item: unknown): item is ParallelStmt {\n return reflection.isInstance(item, ParallelStmt.$type);\n}\n\nexport interface Param extends langium.AstNode {\n readonly $container: ParamList;\n readonly $type: 'Param';\n annotations: Array<Annotation>;\n name: string;\n paramType?: TypeRef;\n}\n\nexport const Param = {\n $type: 'Param',\n annotations: 'annotations',\n name: 'name',\n paramType: 'paramType'\n} as const;\n\nexport function isParam(item: unknown): item is Param {\n return reflection.isInstance(item, Param.$type);\n}\n\nexport interface ParamList extends langium.AstNode {\n readonly $container: DecoDecl | FnDecl | FnExpr | FragmentDecl;\n readonly $type: 'ParamList';\n params: Array<Param>;\n}\n\nexport const ParamList = {\n $type: 'ParamList',\n params: 'params'\n} as const;\n\nexport function isParamList(item: unknown): item is ParamList {\n return reflection.isInstance(item, ParamList.$type);\n}\n\nexport type QualifiedName = string;\n\nexport function isQualifiedName(item: unknown): item is QualifiedName {\n return typeof item === 'string';\n}\n\nexport interface RaceStmt extends Declaration, Statement {\n readonly $type: 'RaceStmt';\n body: Block;\n opts?: MapLit;\n}\n\nexport const RaceStmt = {\n $type: 'RaceStmt',\n annotations: 'annotations',\n body: 'body',\n opts: 'opts'\n} as const;\n\nexport function isRaceStmt(item: unknown): item is RaceStmt {\n return reflection.isInstance(item, RaceStmt.$type);\n}\n\nexport interface Ref extends langium.AstNode {\n readonly $container: ActionCall | Arg | Binary | Call | CaptureStmt | DatasetDecl | ExpectStmt | FnBody | ForEachStmt | IfStmt | Index | LetStmt | LifecycleDecl | ListLit | MapEntry | MatcherClause | Member | RepeatStmt | ReportDecl | ReturnStmt | Ternary | Unary | WhileStmt;\n readonly $type: 'Ref';\n name: RefName;\n}\n\nexport const Ref = {\n $type: 'Ref',\n name: 'name'\n} as const;\n\nexport function isRef(item: unknown): item is Ref {\n return reflection.isInstance(item, Ref.$type);\n}\n\nexport type RefName = 'flow' | 'matrix' | 'step' | string;\n\nexport function isRefName(item: unknown): item is RefName {\n return item === 'matrix' || item === 'flow' || item === 'step' || (typeof item === 'string' && (/[_a-zA-Z]\\w*/.test(item)));\n}\n\nexport interface RepeatStmt extends Declaration, Statement {\n readonly $type: 'RepeatStmt';\n body: Block;\n count: Expr;\n index?: string;\n}\n\nexport const RepeatStmt = {\n $type: 'RepeatStmt',\n annotations: 'annotations',\n body: 'body',\n count: 'count',\n index: 'index'\n} as const;\n\nexport function isRepeatStmt(item: unknown): item is RepeatStmt {\n return reflection.isInstance(item, RepeatStmt.$type);\n}\n\nexport interface ReportDecl extends Declaration {\n readonly $type: 'ReportDecl';\n reporters: Array<Expr>;\n}\n\nexport const ReportDecl = {\n $type: 'ReportDecl',\n annotations: 'annotations',\n reporters: 'reporters'\n} as const;\n\nexport function isReportDecl(item: unknown): item is ReportDecl {\n return reflection.isInstance(item, ReportDecl.$type);\n}\n\nexport interface ReturnStmt extends Statement {\n readonly $type: 'ReturnStmt';\n value?: Expr;\n}\n\nexport const ReturnStmt = {\n $type: 'ReturnStmt',\n annotations: 'annotations',\n value: 'value'\n} as const;\n\nexport function isReturnStmt(item: unknown): item is ReturnStmt {\n return reflection.isInstance(item, ReturnStmt.$type);\n}\n\nexport interface RunStmt extends Declaration, Statement {\n readonly $type: 'RunStmt';\n args?: ArgList;\n bind?: string;\n target: QualifiedName;\n}\n\nexport const RunStmt = {\n $type: 'RunStmt',\n annotations: 'annotations',\n args: 'args',\n bind: 'bind',\n target: 'target'\n} as const;\n\nexport function isRunStmt(item: unknown): item is RunStmt {\n return reflection.isInstance(item, RunStmt.$type);\n}\n\nexport type SingleType = LiteralType | NamedType;\n\nexport const SingleType = {\n $type: 'SingleType'\n} as const;\n\nexport function isSingleType(item: unknown): item is SingleType {\n return reflection.isInstance(item, SingleType.$type);\n}\n\nexport interface Statement extends langium.AstNode {\n readonly $type: 'ActionCall' | 'BreakStmt' | 'CaptureStmt' | 'ContinueStmt' | 'ExpectStmt' | 'ForEachStmt' | 'GroupDecl' | 'IfStmt' | 'LetStmt' | 'LifecycleDecl' | 'ParallelStmt' | 'RaceStmt' | 'RepeatStmt' | 'ReturnStmt' | 'RunStmt' | 'Statement' | 'StepDecl' | 'TryStmt' | 'WhileStmt';\n annotations: Array<Annotation>;\n}\n\nexport const Statement = {\n $type: 'Statement',\n annotations: 'annotations'\n} as const;\n\nexport function isStatement(item: unknown): item is Statement {\n return reflection.isInstance(item, Statement.$type);\n}\n\nexport interface StepDecl extends Statement {\n readonly $type: 'StepDecl';\n body: Block;\n title: string;\n}\n\nexport const StepDecl = {\n $type: 'StepDecl',\n annotations: 'annotations',\n body: 'body',\n title: 'title'\n} as const;\n\nexport function isStepDecl(item: unknown): item is StepDecl {\n return reflection.isInstance(item, StepDecl.$type);\n}\n\nexport interface StringLit extends langium.AstNode {\n readonly $container: ActionCall | Arg | Binary | Call | CaptureStmt | DatasetDecl | ExpectStmt | FnBody | ForEachStmt | IfStmt | Index | LetStmt | LifecycleDecl | ListLit | MapEntry | MatcherClause | Member | RepeatStmt | ReportDecl | ReturnStmt | Ternary | Unary | WhileStmt;\n readonly $type: 'StringLit';\n value: string;\n}\n\nexport const StringLit = {\n $type: 'StringLit',\n value: 'value'\n} as const;\n\nexport function isStringLit(item: unknown): item is StringLit {\n return reflection.isInstance(item, StringLit.$type);\n}\n\nexport interface Ternary extends langium.AstNode {\n readonly $container: ActionCall | Arg | Binary | Call | CaptureStmt | DatasetDecl | ExpectStmt | FnBody | ForEachStmt | IfStmt | Index | LetStmt | LifecycleDecl | ListLit | MapEntry | MatcherClause | Member | RepeatStmt | ReportDecl | ReturnStmt | Ternary | Unary | WhileStmt;\n readonly $type: 'Ternary';\n condition: Expr;\n otherwise: Expr;\n then: Expr;\n}\n\nexport const Ternary = {\n $type: 'Ternary',\n condition: 'condition',\n otherwise: 'otherwise',\n then: 'then'\n} as const;\n\nexport function isTernary(item: unknown): item is Ternary {\n return reflection.isInstance(item, Ternary.$type);\n}\n\nexport interface TryStmt extends Declaration, Statement {\n readonly $type: 'TryStmt';\n body: Block;\n error?: string;\n finalizer?: Block;\n handler?: Block;\n}\n\nexport const TryStmt = {\n $type: 'TryStmt',\n annotations: 'annotations',\n body: 'body',\n error: 'error',\n finalizer: 'finalizer',\n handler: 'handler'\n} as const;\n\nexport function isTryStmt(item: unknown): item is TryStmt {\n return reflection.isInstance(item, TryStmt.$type);\n}\n\nexport interface TypeBody extends langium.AstNode {\n readonly $container: TypeDecl;\n readonly $type: 'TypeBody';\n fields: Array<FieldDecl>;\n}\n\nexport const TypeBody = {\n $type: 'TypeBody',\n fields: 'fields'\n} as const;\n\nexport function isTypeBody(item: unknown): item is TypeBody {\n return reflection.isInstance(item, TypeBody.$type);\n}\n\nexport interface TypeDecl extends Declaration {\n readonly $type: 'TypeDecl';\n alias?: TypeRef;\n body?: TypeBody;\n name: string;\n}\n\nexport const TypeDecl = {\n $type: 'TypeDecl',\n alias: 'alias',\n annotations: 'annotations',\n body: 'body',\n name: 'name'\n} as const;\n\nexport function isTypeDecl(item: unknown): item is TypeDecl {\n return reflection.isInstance(item, TypeDecl.$type);\n}\n\nexport interface TypeRef extends langium.AstNode {\n readonly $container: DatasetDecl | FieldDecl | FnDecl | FnExpr | FragmentDecl | LetStmt | NamedType | Param | TypeDecl;\n readonly $type: 'TypeRef';\n members: Array<SingleType>;\n}\n\nexport const TypeRef = {\n $type: 'TypeRef',\n members: 'members'\n} as const;\n\nexport function isTypeRef(item: unknown): item is TypeRef {\n return reflection.isInstance(item, TypeRef.$type);\n}\n\nexport interface Unary extends langium.AstNode {\n readonly $container: ActionCall | Arg | Binary | Call | CaptureStmt | DatasetDecl | ExpectStmt | FnBody | ForEachStmt | IfStmt | Index | LetStmt | LifecycleDecl | ListLit | MapEntry | MatcherClause | Member | RepeatStmt | ReportDecl | ReturnStmt | Ternary | Unary | WhileStmt;\n readonly $type: 'Unary';\n operand: Expr;\n operator: '!' | '-';\n}\n\nexport const Unary = {\n $type: 'Unary',\n operand: 'operand',\n operator: 'operator'\n} as const;\n\nexport function isUnary(item: unknown): item is Unary {\n return reflection.isInstance(item, Unary.$type);\n}\n\nexport interface UseDecl extends langium.AstNode {\n readonly $container: Document;\n readonly $type: 'UseDecl';\n alias?: string;\n pkg: string;\n}\n\nexport const UseDecl = {\n $type: 'UseDecl',\n alias: 'alias',\n pkg: 'pkg'\n} as const;\n\nexport function isUseDecl(item: unknown): item is UseDecl {\n return reflection.isInstance(item, UseDecl.$type);\n}\n\nexport interface ValueImport extends langium.AstNode {\n readonly $container: Document;\n readonly $type: 'ValueImport';\n default?: string;\n export: boolean;\n names: Array<string>;\n path: string;\n wildcard?: string;\n}\n\nexport const ValueImport = {\n $type: 'ValueImport',\n default: 'default',\n export: 'export',\n names: 'names',\n path: 'path',\n wildcard: 'wildcard'\n} as const;\n\nexport function isValueImport(item: unknown): item is ValueImport {\n return reflection.isInstance(item, ValueImport.$type);\n}\n\nexport interface WhileStmt extends Declaration, Statement {\n readonly $type: 'WhileStmt';\n body: Block;\n cond: Expr;\n}\n\nexport const WhileStmt = {\n $type: 'WhileStmt',\n annotations: 'annotations',\n body: 'body',\n cond: 'cond'\n} as const;\n\nexport function isWhileStmt(item: unknown): item is WhileStmt {\n return reflection.isInstance(item, WhileStmt.$type);\n}\n\nexport type Word = 'afterEach' | 'all' | 'as' | 'beforeEach' | 'break' | 'capture' | 'catch' | 'config' | 'const' | 'continue' | 'dataset' | 'deco' | 'defer' | 'else' | 'expect' | 'factory' | 'finally' | 'flow' | 'fn' | 'forEach' | 'fragment' | 'from' | 'group' | 'if' | 'import' | 'in' | 'let' | 'matrix' | 'module' | 'not' | 'on' | 'parallel' | 'pub' | 'race' | 'repeat' | 'report' | 'return' | 'run' | 'setup' | 'soft' | 'step' | 'teardown' | 'try' | 'type' | 'use' | 'while' | string;\n\nexport function isWord(item: unknown): item is Word {\n return item === 'module' || item === 'use' || item === 'as' || item === 'pub' || item === 'import' || item === 'from' || item === 'flow' || item === 'fragment' || item === 'fn' || item === 'deco' || item === 'return' || item === 'const' || item === 'let' || item === 'config' || item === 'matrix' || item === 'report' || item === 'type' || item === 'factory' || item === 'dataset' || item === 'setup' || item === 'teardown' || item === 'beforeEach' || item === 'afterEach' || item === 'defer' || item === 'on' || item === 'step' || item === 'group' || item === 'if' || item === 'else' || item === 'forEach' || item === 'in' || item === 'repeat' || item === 'while' || item === 'parallel' || item === 'race' || item === 'try' || item === 'catch' || item === 'finally' || item === 'capture' || item === 'run' || item === 'break' || item === 'continue' || item === 'expect' || item === 'all' || item === 'soft' || item === 'not' || (typeof item === 'string' && (/[_a-zA-Z]\\w*/.test(item)));\n}\n\nexport type VennAstType = {\n ActionCall: ActionCall\n Annotation: Annotation\n Arg: Arg\n ArgList: ArgList\n Binary: Binary\n Block: Block\n BoolLit: BoolLit\n BreakStmt: BreakStmt\n Call: Call\n CaptureStmt: CaptureStmt\n ConfigDecl: ConfigDecl\n ContinueStmt: ContinueStmt\n DatasetDecl: DatasetDecl\n Declaration: Declaration\n DecoDecl: DecoDecl\n Document: Document\n ElseBranch: ElseBranch\n ExpectStmt: ExpectStmt\n Expr: Expr\n FactoryDecl: FactoryDecl\n FieldDecl: FieldDecl\n FlowDecl: FlowDecl\n FnBody: FnBody\n FnDecl: FnDecl\n FnExpr: FnExpr\n ForEachStmt: ForEachStmt\n FragmentDecl: FragmentDecl\n GroupDecl: GroupDecl\n IfStmt: IfStmt\n ImportDecl: ImportDecl\n Index: Index\n InstantLit: InstantLit\n LetStmt: LetStmt\n LifecycleDecl: LifecycleDecl\n ListLit: ListLit\n LiteralType: LiteralType\n MapEntry: MapEntry\n MapLit: MapLit\n MatcherClause: MatcherClause\n MatrixDecl: MatrixDecl\n Member: Member\n NamedType: NamedType\n NullLit: NullLit\n NumberLit: NumberLit\n ParallelStmt: ParallelStmt\n Param: Param\n ParamList: ParamList\n RaceStmt: RaceStmt\n Ref: Ref\n RepeatStmt: RepeatStmt\n ReportDecl: ReportDecl\n ReturnStmt: ReturnStmt\n RunStmt: RunStmt\n SingleType: SingleType\n Statement: Statement\n StepDecl: StepDecl\n StringLit: StringLit\n Ternary: Ternary\n TryStmt: TryStmt\n TypeBody: TypeBody\n TypeDecl: TypeDecl\n TypeRef: TypeRef\n Unary: Unary\n UseDecl: UseDecl\n ValueImport: ValueImport\n WhileStmt: WhileStmt\n}\n\nexport class VennAstReflection extends langium.AbstractAstReflection {\n override readonly types = {\n ActionCall: {\n name: ActionCall.$type,\n properties: {\n annotations: {\n name: ActionCall.annotations,\n defaultValue: [],\n optional: true\n },\n args: {\n name: ActionCall.args,\n defaultValue: [],\n optional: true\n },\n call: {\n name: ActionCall.call,\n optional: true\n },\n called: {\n name: ActionCall.called,\n defaultValue: false,\n optional: true\n },\n opts: {\n name: ActionCall.opts,\n optional: true\n },\n target: {\n name: ActionCall.target\n }\n },\n superTypes: [Declaration.$type, Statement.$type]\n },\n Annotation: {\n name: Annotation.$type,\n properties: {\n args: {\n name: Annotation.args,\n optional: true\n },\n name: {\n name: Annotation.name\n }\n },\n superTypes: []\n },\n Arg: {\n name: Arg.$type,\n properties: {\n name: {\n name: Arg.name,\n optional: true\n },\n value: {\n name: Arg.value\n }\n },\n superTypes: []\n },\n ArgList: {\n name: ArgList.$type,\n properties: {\n args: {\n name: ArgList.args,\n defaultValue: []\n }\n },\n superTypes: []\n },\n Binary: {\n name: Binary.$type,\n properties: {\n left: {\n name: Binary.left\n },\n operator: {\n name: Binary.operator\n },\n right: {\n name: Binary.right\n }\n },\n superTypes: [Expr.$type]\n },\n Block: {\n name: Block.$type,\n properties: {\n stmts: {\n name: Block.stmts,\n defaultValue: [],\n optional: true\n }\n },\n superTypes: [ElseBranch.$type]\n },\n BoolLit: {\n name: BoolLit.$type,\n properties: {\n value: {\n name: BoolLit.value\n }\n },\n superTypes: [Expr.$type]\n },\n BreakStmt: {\n name: BreakStmt.$type,\n properties: {\n annotations: {\n name: BreakStmt.annotations,\n defaultValue: [],\n optional: true\n }\n },\n superTypes: [Statement.$type]\n },\n Call: {\n name: Call.$type,\n properties: {\n args: {\n name: Call.args,\n optional: true\n },\n callee: {\n name: Call.callee\n }\n },\n superTypes: [Expr.$type]\n },\n CaptureStmt: {\n name: CaptureStmt.$type,\n properties: {\n annotations: {\n name: CaptureStmt.annotations,\n defaultValue: [],\n optional: true\n },\n name: {\n name: CaptureStmt.name\n },\n opts: {\n name: CaptureStmt.opts,\n optional: true\n },\n value: {\n name: CaptureStmt.value\n }\n },\n superTypes: [Statement.$type]\n },\n ConfigDecl: {\n name: ConfigDecl.$type,\n properties: {\n annotations: {\n name: ConfigDecl.annotations,\n defaultValue: [],\n optional: true\n },\n body: {\n name: ConfigDecl.body\n }\n },\n superTypes: [Declaration.$type]\n },\n ContinueStmt: {\n name: ContinueStmt.$type,\n properties: {\n annotations: {\n name: ContinueStmt.annotations,\n defaultValue: [],\n optional: true\n }\n },\n superTypes: [Statement.$type]\n },\n DatasetDecl: {\n name: DatasetDecl.$type,\n properties: {\n annotations: {\n name: DatasetDecl.annotations,\n defaultValue: [],\n optional: true\n },\n declaredType: {\n name: DatasetDecl.declaredType,\n optional: true\n },\n name: {\n name: DatasetDecl.name\n },\n value: {\n name: DatasetDecl.value\n }\n },\n superTypes: [Declaration.$type]\n },\n Declaration: {\n name: Declaration.$type,\n properties: {\n annotations: {\n name: Declaration.annotations,\n defaultValue: [],\n optional: true\n }\n },\n superTypes: []\n },\n DecoDecl: {\n name: DecoDecl.$type,\n properties: {\n annotations: {\n name: DecoDecl.annotations,\n defaultValue: [],\n optional: true\n },\n body: {\n name: DecoDecl.body\n },\n export: {\n name: DecoDecl.export,\n defaultValue: false,\n optional: true\n },\n name: {\n name: DecoDecl.name\n },\n params: {\n name: DecoDecl.params,\n optional: true\n }\n },\n superTypes: [Declaration.$type]\n },\n Document: {\n name: Document.$type,\n properties: {\n decls: {\n name: Document.decls,\n defaultValue: [],\n optional: true\n },\n imports: {\n name: Document.imports,\n defaultValue: [],\n optional: true\n },\n name: {\n name: Document.name,\n optional: true\n }\n },\n superTypes: []\n },\n ElseBranch: {\n name: ElseBranch.$type,\n properties: {\n },\n superTypes: []\n },\n ExpectStmt: {\n name: ExpectStmt.$type,\n properties: {\n annotations: {\n name: ExpectStmt.annotations,\n defaultValue: [],\n optional: true\n },\n checks: {\n name: ExpectStmt.checks,\n defaultValue: [],\n optional: true\n },\n matcher: {\n name: ExpectStmt.matcher,\n optional: true\n },\n modifier: {\n name: ExpectStmt.modifier,\n optional: true\n },\n negate: {\n name: ExpectStmt.negate,\n defaultValue: false,\n optional: true\n },\n subject: {\n name: ExpectStmt.subject,\n optional: true\n }\n },\n superTypes: [Declaration.$type, Statement.$type]\n },\n Expr: {\n name: Expr.$type,\n properties: {\n },\n superTypes: []\n },\n FactoryDecl: {\n name: FactoryDecl.$type,\n properties: {\n annotations: {\n name: FactoryDecl.annotations,\n defaultValue: [],\n optional: true\n },\n body: {\n name: FactoryDecl.body\n },\n name: {\n name: FactoryDecl.name\n }\n },\n superTypes: [Declaration.$type]\n },\n FieldDecl: {\n name: FieldDecl.$type,\n properties: {\n annotations: {\n name: FieldDecl.annotations,\n defaultValue: [],\n optional: true\n },\n fieldType: {\n name: FieldDecl.fieldType\n },\n name: {\n name: FieldDecl.name\n },\n optional: {\n name: FieldDecl.optional,\n defaultValue: false,\n optional: true\n }\n },\n superTypes: []\n },\n FlowDecl: {\n name: FlowDecl.$type,\n properties: {\n annotations: {\n name: FlowDecl.annotations,\n defaultValue: [],\n optional: true\n },\n body: {\n name: FlowDecl.body\n },\n title: {\n name: FlowDecl.title\n }\n },\n superTypes: [Declaration.$type]\n },\n FnBody: {\n name: FnBody.$type,\n properties: {\n locals: {\n name: FnBody.locals,\n defaultValue: [],\n optional: true\n },\n result: {\n name: FnBody.result\n }\n },\n superTypes: []\n },\n FnDecl: {\n name: FnDecl.$type,\n properties: {\n annotations: {\n name: FnDecl.annotations,\n defaultValue: [],\n optional: true\n },\n body: {\n name: FnDecl.body\n },\n export: {\n name: FnDecl.export,\n defaultValue: false,\n optional: true\n },\n name: {\n name: FnDecl.name\n },\n params: {\n name: FnDecl.params,\n optional: true\n },\n returns: {\n name: FnDecl.returns,\n optional: true\n }\n },\n superTypes: [Declaration.$type]\n },\n FnExpr: {\n name: FnExpr.$type,\n properties: {\n body: {\n name: FnExpr.body\n },\n params: {\n name: FnExpr.params\n },\n returns: {\n name: FnExpr.returns,\n optional: true\n }\n },\n superTypes: [Expr.$type]\n },\n ForEachStmt: {\n name: ForEachStmt.$type,\n properties: {\n annotations: {\n name: ForEachStmt.annotations,\n defaultValue: [],\n optional: true\n },\n body: {\n name: ForEachStmt.body\n },\n item: {\n name: ForEachStmt.item\n },\n opts: {\n name: ForEachStmt.opts,\n optional: true\n },\n source: {\n name: ForEachStmt.source\n }\n },\n superTypes: [Declaration.$type, Statement.$type]\n },\n FragmentDecl: {\n name: FragmentDecl.$type,\n properties: {\n annotations: {\n name: FragmentDecl.annotations,\n defaultValue: [],\n optional: true\n },\n body: {\n name: FragmentDecl.body\n },\n export: {\n name: FragmentDecl.export,\n defaultValue: false,\n optional: true\n },\n name: {\n name: FragmentDecl.name\n },\n params: {\n name: FragmentDecl.params,\n optional: true\n },\n returns: {\n name: FragmentDecl.returns,\n optional: true\n }\n },\n superTypes: [Declaration.$type]\n },\n GroupDecl: {\n name: GroupDecl.$type,\n properties: {\n annotations: {\n name: GroupDecl.annotations,\n defaultValue: [],\n optional: true\n },\n body: {\n name: GroupDecl.body\n },\n title: {\n name: GroupDecl.title\n }\n },\n superTypes: [Statement.$type]\n },\n IfStmt: {\n name: IfStmt.$type,\n properties: {\n annotations: {\n name: IfStmt.annotations,\n defaultValue: [],\n optional: true\n },\n cond: {\n name: IfStmt.cond\n },\n otherwise: {\n name: IfStmt.otherwise,\n optional: true\n },\n then: {\n name: IfStmt.then\n }\n },\n superTypes: [Declaration.$type, Statement.$type, ElseBranch.$type]\n },\n ImportDecl: {\n name: ImportDecl.$type,\n properties: {\n },\n superTypes: []\n },\n Index: {\n name: Index.$type,\n properties: {\n index: {\n name: Index.index\n },\n receiver: {\n name: Index.receiver\n }\n },\n superTypes: [Expr.$type]\n },\n InstantLit: {\n name: InstantLit.$type,\n properties: {\n value: {\n name: InstantLit.value\n }\n },\n superTypes: [Expr.$type]\n },\n LetStmt: {\n name: LetStmt.$type,\n properties: {\n annotations: {\n name: LetStmt.annotations,\n defaultValue: [],\n optional: true\n },\n args: {\n name: LetStmt.args,\n defaultValue: [],\n optional: true\n },\n declaredType: {\n name: LetStmt.declaredType,\n optional: true\n },\n kind: {\n name: LetStmt.kind\n },\n name: {\n name: LetStmt.name\n },\n opts: {\n name: LetStmt.opts,\n optional: true\n },\n value: {\n name: LetStmt.value\n }\n },\n superTypes: [Declaration.$type, Statement.$type]\n },\n LifecycleDecl: {\n name: LifecycleDecl.$type,\n properties: {\n annotations: {\n name: LifecycleDecl.annotations,\n defaultValue: [],\n optional: true\n },\n arg: {\n name: LifecycleDecl.arg,\n optional: true\n },\n body: {\n name: LifecycleDecl.body\n },\n event: {\n name: LifecycleDecl.event,\n optional: true\n },\n hook: {\n name: LifecycleDecl.hook,\n optional: true\n }\n },\n superTypes: [Declaration.$type, Statement.$type]\n },\n ListLit: {\n name: ListLit.$type,\n properties: {\n items: {\n name: ListLit.items,\n defaultValue: [],\n optional: true\n }\n },\n superTypes: [Expr.$type]\n },\n LiteralType: {\n name: LiteralType.$type,\n properties: {\n value: {\n name: LiteralType.value\n }\n },\n superTypes: [SingleType.$type]\n },\n MapEntry: {\n name: MapEntry.$type,\n properties: {\n key: {\n name: MapEntry.key\n },\n value: {\n name: MapEntry.value\n }\n },\n superTypes: []\n },\n MapLit: {\n name: MapLit.$type,\n properties: {\n entries: {\n name: MapLit.entries,\n defaultValue: [],\n optional: true\n }\n },\n superTypes: [Expr.$type]\n },\n MatcherClause: {\n name: MatcherClause.$type,\n properties: {\n args: {\n name: MatcherClause.args,\n defaultValue: [],\n optional: true\n },\n name: {\n name: MatcherClause.name\n },\n opts: {\n name: MatcherClause.opts,\n optional: true\n }\n },\n superTypes: []\n },\n MatrixDecl: {\n name: MatrixDecl.$type,\n properties: {\n annotations: {\n name: MatrixDecl.annotations,\n defaultValue: [],\n optional: true\n },\n body: {\n name: MatrixDecl.body\n }\n },\n superTypes: [Declaration.$type]\n },\n Member: {\n name: Member.$type,\n properties: {\n member: {\n name: Member.member\n },\n optional: {\n name: Member.optional,\n defaultValue: false,\n optional: true\n },\n receiver: {\n name: Member.receiver\n }\n },\n superTypes: [Expr.$type]\n },\n NamedType: {\n name: NamedType.$type,\n properties: {\n args: {\n name: NamedType.args,\n defaultValue: [],\n optional: true\n },\n name: {\n name: NamedType.name\n }\n },\n superTypes: [SingleType.$type]\n },\n NullLit: {\n name: NullLit.$type,\n properties: {\n },\n superTypes: [Expr.$type]\n },\n NumberLit: {\n name: NumberLit.$type,\n properties: {\n raw: {\n name: NumberLit.raw\n }\n },\n superTypes: [Expr.$type]\n },\n ParallelStmt: {\n name: ParallelStmt.$type,\n properties: {\n annotations: {\n name: ParallelStmt.annotations,\n defaultValue: [],\n optional: true\n },\n body: {\n name: ParallelStmt.body\n },\n opts: {\n name: ParallelStmt.opts,\n optional: true\n }\n },\n superTypes: [Declaration.$type, Statement.$type]\n },\n Param: {\n name: Param.$type,\n properties: {\n annotations: {\n name: Param.annotations,\n defaultValue: [],\n optional: true\n },\n name: {\n name: Param.name\n },\n paramType: {\n name: Param.paramType,\n optional: true\n }\n },\n superTypes: []\n },\n ParamList: {\n name: ParamList.$type,\n properties: {\n params: {\n name: ParamList.params,\n defaultValue: []\n }\n },\n superTypes: []\n },\n RaceStmt: {\n name: RaceStmt.$type,\n properties: {\n annotations: {\n name: RaceStmt.annotations,\n defaultValue: [],\n optional: true\n },\n body: {\n name: RaceStmt.body\n },\n opts: {\n name: RaceStmt.opts,\n optional: true\n }\n },\n superTypes: [Declaration.$type, Statement.$type]\n },\n Ref: {\n name: Ref.$type,\n properties: {\n name: {\n name: Ref.name\n }\n },\n superTypes: [Expr.$type]\n },\n RepeatStmt: {\n name: RepeatStmt.$type,\n properties: {\n annotations: {\n name: RepeatStmt.annotations,\n defaultValue: [],\n optional: true\n },\n body: {\n name: RepeatStmt.body\n },\n count: {\n name: RepeatStmt.count\n },\n index: {\n name: RepeatStmt.index,\n optional: true\n }\n },\n superTypes: [Declaration.$type, Statement.$type]\n },\n ReportDecl: {\n name: ReportDecl.$type,\n properties: {\n annotations: {\n name: ReportDecl.annotations,\n defaultValue: [],\n optional: true\n },\n reporters: {\n name: ReportDecl.reporters,\n defaultValue: []\n }\n },\n superTypes: [Declaration.$type]\n },\n ReturnStmt: {\n name: ReturnStmt.$type,\n properties: {\n annotations: {\n name: ReturnStmt.annotations,\n defaultValue: [],\n optional: true\n },\n value: {\n name: ReturnStmt.value,\n optional: true\n }\n },\n superTypes: [Statement.$type]\n },\n RunStmt: {\n name: RunStmt.$type,\n properties: {\n annotations: {\n name: RunStmt.annotations,\n defaultValue: [],\n optional: true\n },\n args: {\n name: RunStmt.args,\n optional: true\n },\n bind: {\n name: RunStmt.bind,\n optional: true\n },\n target: {\n name: RunStmt.target\n }\n },\n superTypes: [Declaration.$type, Statement.$type]\n },\n SingleType: {\n name: SingleType.$type,\n properties: {\n },\n superTypes: []\n },\n Statement: {\n name: Statement.$type,\n properties: {\n annotations: {\n name: Statement.annotations,\n defaultValue: [],\n optional: true\n }\n },\n superTypes: []\n },\n StepDecl: {\n name: StepDecl.$type,\n properties: {\n annotations: {\n name: StepDecl.annotations,\n defaultValue: [],\n optional: true\n },\n body: {\n name: StepDecl.body\n },\n title: {\n name: StepDecl.title\n }\n },\n superTypes: [Statement.$type]\n },\n StringLit: {\n name: StringLit.$type,\n properties: {\n value: {\n name: StringLit.value\n }\n },\n superTypes: [Expr.$type]\n },\n Ternary: {\n name: Ternary.$type,\n properties: {\n condition: {\n name: Ternary.condition\n },\n otherwise: {\n name: Ternary.otherwise\n },\n then: {\n name: Ternary.then\n }\n },\n superTypes: [Expr.$type]\n },\n TryStmt: {\n name: TryStmt.$type,\n properties: {\n annotations: {\n name: TryStmt.annotations,\n defaultValue: [],\n optional: true\n },\n body: {\n name: TryStmt.body\n },\n error: {\n name: TryStmt.error,\n optional: true\n },\n finalizer: {\n name: TryStmt.finalizer,\n optional: true\n },\n handler: {\n name: TryStmt.handler,\n optional: true\n }\n },\n superTypes: [Declaration.$type, Statement.$type]\n },\n TypeBody: {\n name: TypeBody.$type,\n properties: {\n fields: {\n name: TypeBody.fields,\n defaultValue: []\n }\n },\n superTypes: []\n },\n TypeDecl: {\n name: TypeDecl.$type,\n properties: {\n alias: {\n name: TypeDecl.alias,\n optional: true\n },\n annotations: {\n name: TypeDecl.annotations,\n defaultValue: [],\n optional: true\n },\n body: {\n name: TypeDecl.body,\n optional: true\n },\n name: {\n name: TypeDecl.name\n }\n },\n superTypes: [Declaration.$type]\n },\n TypeRef: {\n name: TypeRef.$type,\n properties: {\n members: {\n name: TypeRef.members,\n defaultValue: []\n }\n },\n superTypes: []\n },\n Unary: {\n name: Unary.$type,\n properties: {\n operand: {\n name: Unary.operand\n },\n operator: {\n name: Unary.operator\n }\n },\n superTypes: [Expr.$type]\n },\n UseDecl: {\n name: UseDecl.$type,\n properties: {\n alias: {\n name: UseDecl.alias,\n optional: true\n },\n pkg: {\n name: UseDecl.pkg\n }\n },\n superTypes: [ImportDecl.$type]\n },\n ValueImport: {\n name: ValueImport.$type,\n properties: {\n default: {\n name: ValueImport.default,\n optional: true\n },\n export: {\n name: ValueImport.export,\n defaultValue: false,\n optional: true\n },\n names: {\n name: ValueImport.names,\n defaultValue: [],\n optional: true\n },\n path: {\n name: ValueImport.path\n },\n wildcard: {\n name: ValueImport.wildcard,\n optional: true\n }\n },\n superTypes: [ImportDecl.$type]\n },\n WhileStmt: {\n name: WhileStmt.$type,\n properties: {\n annotations: {\n name: WhileStmt.annotations,\n defaultValue: [],\n optional: true\n },\n body: {\n name: WhileStmt.body\n },\n cond: {\n name: WhileStmt.cond\n }\n },\n superTypes: [Declaration.$type, Statement.$type]\n }\n } as const satisfies langium.AstMetaData\n}\n\nexport const reflection = new VennAstReflection();\n","import type { AstNode } from \"langium\";\nimport type { Expr } from \"../generated/ast.js\";\nimport { isMember, isRef } from \"../generated/ast.js\";\n\n/**\n * The dotted name an expression spells, such as `http.get` or\n * `data.faker.uuid`.\n *\n * The parser cannot tell a namespace from a field: `res.status` and `http.get`\n * are the same shape. Only a registry knows which is which, so the name is\n * carried this far as text and asked about there.\n *\n * @returns The dotted name, or `undefined` when the expression is not a plain\n * chain of identifiers.\n */\nexport function dottedPath(expr: Expr | AstNode | undefined): string | undefined {\n if (!expr) return undefined;\n if (isRef(expr)) return expr.name;\n if (!isMember(expr) || expr.optional) return undefined;\n const receiver = dottedPath(expr.receiver);\n return receiver === undefined ? undefined : `${receiver}.${expr.member}`;\n}\n","import {\n type Declaration,\n isConfigDecl,\n isDatasetDecl,\n isDecoDecl,\n isFactoryDecl,\n isFlowDecl,\n isFnDecl,\n isFragmentDecl,\n isLifecycleDecl,\n isMatrixDecl,\n isReportDecl,\n isTypeDecl,\n type Statement,\n} from \"../generated/ast.js\";\n\n/**\n * Whether a top-level node runs, or merely defines.\n *\n * A `flow`, a `fn`, a `type` are definitions: they exist for something else to\n * reach. Everything else at the top of a file is a statement, and statements\n * run in the order they are written. That holds in a script, where the file is\n * the program, and in a test file, so the same lines mean the same thing in\n * both.\n */\nexport function isRunnable(node: Declaration): node is Declaration & Statement {\n return !(\n isFlowDecl(node) ||\n isFnDecl(node) ||\n isFragmentDecl(node) ||\n isTypeDecl(node) ||\n isFactoryDecl(node) ||\n isDatasetDecl(node) ||\n isConfigDecl(node) ||\n isMatrixDecl(node) ||\n isReportDecl(node) ||\n isDecoDecl(node) ||\n isLifecycleDecl(node)\n );\n}\n","import type { Expr, MapLit } from \"../generated/ast.js\";\nimport { isMapLit } from \"../generated/ast.js\";\n\n/** A call's arguments, told apart: what it takes, and what configures it. */\nexport interface SplitCall {\n args: readonly Expr[];\n opts?: MapLit;\n}\n\n/**\n * Tell a verb's positional arguments from its options map.\n *\n * The language spells one call two ways, and the trailing `{ … }` means the\n * same in both: `http.get \"url\" { headers }` and `http.get(\"url\", { headers })`\n * are the same request. Only the first spelling puts the map somewhere the\n * parser can label, so the second is disambiguated here.\n *\n * A map beyond the declared positionals is the options; a map *within* them is\n * an argument. `db.seed({ users: […] })` passes a map because seeding is what\n * it does, and that must never be read as configuration.\n *\n * @param takes How many positional arguments the verb declares.\n */\nexport function splitCall(args: readonly Expr[], takes: number): SplitCall {\n const last = args[args.length - 1];\n if (args.length <= takes || !last || !isMapLit(last)) return { args };\n return { args: args.slice(0, -1), opts: last };\n}\n","import { type AstNode, AstUtils } from \"langium\";\n\n/** Every descendant of `root`, depth-first, for whole-document passes. */\nexport function walkAst(root: AstNode): AstNode[] {\n return AstUtils.streamAllContents(root).toArray();\n}\n","import type { Diff, Problem, RelatedInfo, Span } from \"../problem/index.js\";\nimport type { CodeSpec } from \"./code.types.js\";\n\n/** Construct a {@link Problem} from a catalog spec plus location and message. */\nexport function buildProblem(args: {\n spec: CodeSpec;\n span: Span;\n title: string;\n help?: string;\n related?: RelatedInfo[];\n diff?: Diff;\n note?: string;\n}): Problem {\n return {\n code: args.spec.code,\n severity: args.spec.severity,\n title: args.title,\n span: args.span,\n help: args.help,\n related: args.related,\n diff: args.diff,\n note: args.note,\n };\n}\n","import type { CodeSpec } from \"./code.types.js\";\n\n/**\n * Every VNxxxx the kernel itself can raise. Codes are stable, googlable, and\n * documented; families follow the leading digit (1 lex/syntax … 8 timeout).\n */\nexport const CODES = {\n VN1001_LEX: { code: \"VN1001\", severity: \"error\" },\n VN1002_PARSE: { code: \"VN1002\", severity: \"error\" },\n VN2003_UNKNOWN_ACTION: { code: \"VN2003\", severity: \"error\" },\n VN2004_UNKNOWN_MATCHER: { code: \"VN2004\", severity: \"error\" },\n VN2005_UNKNOWN_FRAGMENT: { code: \"VN2005\", severity: \"error\" },\n VN2006_UNKNOWN_ENV: { code: \"VN2006\", severity: \"error\" },\n VN2007_NAMESPACE_NOT_IMPORTED: { code: \"VN2007\", severity: \"error\" },\n VN2008_UNCALLED_ACTION: { code: \"VN2008\", severity: \"error\" },\n VN2009_NOT_EXPORTED: { code: \"VN2009\", severity: \"error\" },\n VN2013_UNKNOWN_DECORATOR: { code: \"VN2013\", severity: \"error\" },\n VN2014_DECORATOR_TARGET: { code: \"VN2014\", severity: \"error\" },\n VN2015_DECO_SIGNATURE: { code: \"VN2015\", severity: \"error\" },\n VN2016_DECO_IMPURE: { code: \"VN2016\", severity: \"error\" },\n VN2017_DECO_VERB: { code: \"VN2017\", severity: \"error\" },\n VN3001_UNKNOWN_OPTION: { code: \"VN3001\", severity: \"error\" },\n VN3010_TYPE_MISMATCH: { code: \"VN3010\", severity: \"error\" },\n VN3012_UNIT_MISMATCH: { code: \"VN3012\", severity: \"error\" },\n VN3013_NOT_CALLABLE: { code: \"VN3013\", severity: \"error\" },\n VN3014_STILL_WAITING: { code: \"VN3014\", severity: \"error\" },\n VN3015_NOT_A_LIST: { code: \"VN3015\", severity: \"error\" },\n VN3016_NOT_A_NUMBER: { code: \"VN3016\", severity: \"error\" },\n VN3017_DECO_ARGUMENTS: { code: \"VN3017\", severity: \"error\" },\n VN5001_REMOVED_KEYWORD: { code: \"VN5001\", severity: \"error\" },\n VN6001_ASSERTION_FAILED: { code: \"VN6001\", severity: \"error\" },\n VN7001_ACTION_FAILED: { code: \"VN7001\", severity: \"error\" },\n VN7004_HOOK_FAILED: { code: \"VN7004\", severity: \"error\" },\n VN8002_LOOP_LIMIT: { code: \"VN8002\", severity: \"error\" },\n} as const satisfies Record<string, CodeSpec>;\n","import type { Cell } from \"../expr/cell.types.js\";\nimport type { Expr, FnBody, ParamList } from \"../generated/ast.js\";\nimport type { Thunk } from \"./compile.types.js\";\n\n/**\n * What the compiler knows by name at one point in the source: the parameters\n * and locals of the function being compiled, in slot order.\n *\n * Only the *current* function. A name from an enclosing one is left dynamic:\n * resolving across frames would mean walking a chain at run time, which is the\n * cost slots exist to remove.\n */\nexport interface LexScope {\n readonly names: readonly string[];\n /**\n * Compiled nodes for this scope. Per scope, not global: a placeholder's\n * expression is shared between every string literal with the same text, so a\n * single cache would hand one scope's slot numbers to another.\n */\n readonly cache: WeakMap<Expr, Thunk>;\n /**\n * Names the body reads but does not bind, in the order they were first seen.\n * Each becomes a cell the closure resolves once, so reading one costs an\n * index rather than a walk up the environment chain.\n *\n * Absent at the root, where there is no closure to hold the cells and a\n * shared list would grow across every program the process ever compiles.\n */\n readonly free?: string[];\n /**\n * This body binds one name and nothing else, so the value bound to it *is*\n * the environment: there is no frame, and reading the parameter is reading\n * the argument. Set optimistically and withdrawn by whoever compiled the body\n * if it turns out to need an environment after all.\n */\n bare?: boolean;\n /** The body asks for some name as text, so it needs a real environment. */\n dynamic?: boolean;\n /**\n * The cell a free name resolves to, when this body belongs to exactly one\n * closure and so may hold cells of its own. Absent for a `fn (…) => …`, whose\n * compiled body is shared by every closure the expression produces.\n */\n cellOf?: (name: string) => Cell;\n}\n\n/** Outside any function: every name is looked up by asking the environment. */\nexport function rootScope(): LexScope {\n return { names: [], cache: new WeakMap() };\n}\n\n/**\n * The scope inside a function: its parameters, then its locals. A local that\n * repeats a parameter's name takes that slot, the way an assignment would.\n */\nexport function scopeOf(params: ParamList | undefined, body: FnBody): LexScope {\n const names: string[] = (params?.params ?? []).map((param) => param.name);\n for (const local of body.locals) {\n if (!names.includes(local.name)) names.push(local.name);\n }\n // Worth trying without a frame: one name, and nothing bound after it.\n const bare = names.length === 1 && body.locals.length === 0;\n return { names, cache: new WeakMap(), free: [], bare };\n}\n\n/** Whether a body compiled optimistically can keep doing without a frame. */\nexport function stayedBare(scope: LexScope): boolean {\n return Boolean(scope.bare) && !scope.dynamic && (scope.free?.length ?? 0) === 0;\n}\n\n/** Where a free name sits in this scope's cell list, adding it if new. */\nexport function freeSlot(scope: LexScope, name: string): number | undefined {\n const free = scope.free;\n if (!free) return undefined;\n const at = free.indexOf(name);\n if (at !== -1) return at;\n return free.push(name) - 1;\n}\n","/** Past this a value stops informing and starts scrolling. */\nconst LIMIT = 200;\n\n/**\n * One side of a diff, rendered the way the language shows values: strings quoted\n * so `\"1\"` never reads as `1`, structures as compact JSON. Never `[object\n * Object]`, because a failure that hides what it compared is not a report.\n */\nexport function formatValue(value: unknown): string {\n if (value === undefined) return \"absent\";\n if (value === null) return \"null\";\n if (typeof value === \"function\") return \"fn\";\n if (typeof value === \"string\") return JSON.stringify(value);\n if (typeof value !== \"object\") return String(value);\n return json(value);\n}\n\n/** Trim for display only. Sameness is decided on the untrimmed rendering. */\nexport function clamp(text: string): string {\n return text.length <= LIMIT ? text : `${text.slice(0, LIMIT)}…`;\n}\n\nfunction json(value: object): string {\n try {\n return JSON.stringify(value) ?? shapeOf(value);\n } catch {\n // Cyclic, or a BigInt inside: say what it is rather than what it prints as.\n return shapeOf(value);\n }\n}\n\nfunction shapeOf(value: object): string {\n if (Array.isArray(value)) return `a list of ${value.length} ${plural(\"item\", value.length)}`;\n const count = Object.keys(value).length;\n return `a map with ${count} ${plural(\"field\", count)}`;\n}\n\nfunction plural(noun: string, count: number): string {\n return count === 1 ? noun : `${noun}s`;\n}\n","import type { Diff, DiffEntry } from \"./diff.types.js\";\nimport { clamp, formatValue } from \"./format-value.js\";\n\n/** Past this many fields a wall of text stops being a diff. */\nconst MAX_ENTRIES = 40;\n\n/**\n * Past this the walk stops descending. A value that contains itself has no\n * bottom, and a stack overflow inside a failure report is a crash, not a report.\n */\nconst MAX_DEPTH = 16;\n\n/**\n * Turn the two sides a producer compared into a {@link Diff}. Two structures are\n * walked field by field, so the failure names the field that moved instead of\n * printing the same rendering twice; anything else stays a plain pair.\n */\nexport function buildDiff(args: {\n /** Heading for the field-by-field form. */\n label: string;\n expected: unknown;\n actual: unknown;\n /**\n * Whether the two sides correspond position by position. Pass `false` for a\n * comparison that does not, such as `contains`. See {@link walkable}.\n */\n aligned?: boolean;\n}): Diff {\n const entries: DiffEntry[] = [];\n const { expected, actual } = args;\n if (walkable(args)) walk({ expected, actual, path: \"\", entries, depth: 0 });\n if (entries.length === 0) return pair(expected, actual);\n return { kind: \"fields\", label: args.label, entries };\n}\n\n/**\n * A field-by-field walk claims the two sides correspond position by position.\n * `equals` claims that; `contains` holds one needle against every item, and\n * lining that needle up with the haystack would invent a comparison nobody\n * made, such as `[0] expected 5, actual [1,2]`.\n */\nfunction walkable(args: { expected: unknown; actual: unknown; aligned?: boolean }): boolean {\n return args.aligned !== false && comparable(args.expected, args.actual);\n}\n\nfunction pair(expected: unknown, actual: unknown): Diff {\n return {\n kind: \"scalar\",\n expected: clamp(formatValue(expected)),\n actual: clamp(formatValue(actual)),\n };\n}\n\n/** Only two structures of the same shape are worth walking side by side. */\nfunction comparable(expected: unknown, actual: unknown): boolean {\n if (Array.isArray(expected) !== Array.isArray(actual)) return false;\n return isStructure(expected) && isStructure(actual);\n}\n\nfunction isStructure(value: unknown): boolean {\n return typeof value === \"object\" && value !== null;\n}\n\nfunction walk(args: {\n expected: unknown;\n actual: unknown;\n path: string;\n entries: DiffEntry[];\n depth: number;\n}): void {\n const list = Array.isArray(args.expected);\n for (const key of keysOf(args.expected, args.actual)) {\n if (args.entries.length >= MAX_ENTRIES) return;\n visit({ from: args, key, path: childPath({ parent: args.path, key, list }) });\n }\n}\n\n/**\n * One field of the walk. It descends only where the two sides disagree: an\n * untouched subtree is worth one line of context, not fifty.\n */\nfunction visit(args: {\n from: { expected: unknown; actual: unknown; entries: DiffEntry[]; depth: number };\n key: string;\n path: string;\n}): void {\n const expected = read(args.from.expected, args.key);\n const actual = read(args.from.actual, args.key);\n const { entries, depth } = args.from;\n const entry = entryOf(args.path, expected, actual);\n if (entry.same || depth >= MAX_DEPTH || !comparable(expected, actual)) entries.push(entry);\n else walk({ expected, actual, path: args.path, entries, depth: depth + 1 });\n}\n\nfunction entryOf(path: string, expected: unknown, actual: unknown): DiffEntry {\n const left = formatValue(expected);\n const right = formatValue(actual);\n return { path, expected: clamp(left), actual: clamp(right), same: left === right };\n}\n\n/** Every field either side has, in expected-first order. */\nfunction keysOf(expected: unknown, actual: unknown): string[] {\n const keys = Object.keys(expected as object);\n for (const key of Object.keys(actual as object)) {\n if (!keys.includes(key)) keys.push(key);\n }\n return keys;\n}\n\nfunction childPath(args: { parent: string; key: string; list: boolean }): string {\n return args.list ? `${args.parent}[${args.key}]` : `${args.parent}.${args.key}`;\n}\n\nfunction read(value: unknown, key: string): unknown {\n return (value as Record<string, unknown>)[key];\n}\n","import type { Problem } from \"./problem.types.js\";\n\n/**\n * Carries a {@link Problem} across a throw boundary at runtime. Catch it to\n * recover the structured problem; `message` is only the title.\n */\nexport class ProblemError extends Error {\n readonly problem: Problem;\n\n constructor(problem: Problem) {\n super(problem.title);\n this.name = \"ProblemError\";\n this.problem = problem;\n }\n}\n","import type { UnitKind, UnitValue } from \"./unit.types.js\";\n\n/** Anything arithmetic accepts: a plain number, or a number carrying a unit. */\nexport type Numeric = number | UnitValue;\n\n/** Why two operands would not combine: the operator, and the kind of each side. */\nexport type UnitMismatch = { op: string; left: string; right: string };\n\n/** The outcome of {@link combine}: the value, or the mismatch behind VN3012. */\nexport type CombineResult =\n | { ok: true; value: Numeric | boolean }\n | { ok: false; mismatch: UnitMismatch };\n\ntype Norm = { kind: UnitKind | \"scalar\"; base: number };\n\nconst COMPARE = new Set([\"<\", \"<=\", \">\", \">=\", \"==\", \"!=\"]);\n\n/**\n * Combine two numerics with an operator, checking that their units agree.\n *\n * `300ms + 1s` succeeds; `300ms + 2mb` reports a mismatch. Never throws: the\n * caller decides whether a mismatch is a problem and where to point at it.\n *\n * @returns The combined value, or the mismatch that stopped it.\n */\nexport function combine(args: { op: string; left: Numeric; right: Numeric }): CombineResult {\n const left = norm(args.left);\n const right = norm(args.right);\n const value = COMPARE.has(args.op) ? compare(args.op, left, right) : arith(args.op, left, right);\n if (value === null)\n return { ok: false, mismatch: { op: args.op, left: left.kind, right: right.kind } };\n return { ok: true, value };\n}\n\n/**\n * Ordering needs a shared unit; equality does not.\n *\n * Asking whether a duration is *less than* a size is a question with no answer,\n * so it reports a mismatch. Asking whether they are *equal* has an obvious one:\n * they are not. Reporting a mismatch there made `a == b` able to fail, so no\n * program could compare two values whose units it did not already know.\n */\nfunction compare(op: string, l: Norm, r: Norm): boolean | null {\n if (l.kind === r.kind) return applyCompare(op, l.base, r.base);\n if (op === \"==\") return false;\n return op === \"!=\" ? true : null;\n}\n\nfunction arith(op: string, l: Norm, r: Norm): Numeric | null {\n if (l.kind === \"scalar\" && r.kind === \"scalar\") return applyScalar(op, l.base, r.base);\n if (op === \"+\" || op === \"-\")\n return l.kind === r.kind ? fromBase(l.kind, applyScalar(op, l.base, r.base)) : null;\n if (op === \"*\") return scale(l, r);\n return divide(op, l, r);\n}\n\nfunction scale(l: Norm, r: Norm): Numeric | null {\n if (l.kind === \"scalar\") return fromBase(r.kind, l.base * r.base);\n if (r.kind === \"scalar\") return fromBase(l.kind, l.base * r.base);\n return null;\n}\n\nfunction divide(op: string, l: Norm, r: Norm): Numeric | null {\n if (op !== \"/\" && op !== \"%\") return null;\n if (r.kind === \"scalar\") return fromBase(l.kind, applyScalar(op, l.base, r.base));\n return l.kind === r.kind ? applyScalar(op, l.base, r.base) : null;\n}\n\nfunction norm(value: Numeric): Norm {\n if (typeof value === \"number\") return { kind: \"scalar\", base: value };\n if (value.kind === \"duration\") return { kind: \"duration\", base: value.ms };\n if (value.kind === \"size\") return { kind: \"size\", base: value.bytes };\n return { kind: \"percent\", base: value.ratio };\n}\n\nfunction fromBase(kind: UnitKind | \"scalar\", base: number): Numeric {\n if (kind === \"duration\") return { kind, ms: base };\n if (kind === \"size\") return { kind, bytes: base };\n if (kind === \"percent\") return { kind, ratio: base };\n return base;\n}\n\nfunction applyScalar(op: string, a: number, b: number): number {\n if (op === \"+\") return a + b;\n if (op === \"-\") return a - b;\n if (op === \"*\") return a * b;\n if (op === \"/\") return a / b;\n return a % b;\n}\n\nfunction applyCompare(op: string, a: number, b: number): boolean {\n if (op === \"<\") return a < b;\n if (op === \"<=\") return a <= b;\n if (op === \">\") return a > b;\n if (op === \">=\") return a >= b;\n return op === \"==\" ? a === b : a !== b;\n}\n","import type { Instant } from \"./unit.types.js\";\n\n/**\n * Read an ISO-8601 lexeme into an {@link Instant}, keeping the source text.\n *\n * A lexeme that does not parse takes epoch 0 rather than NaN, so comparing two\n * instants stays total. The grammar has already accepted the shape by here.\n */\nexport function parseInstant(iso: string): Instant {\n const epochMs = Date.parse(iso);\n return { kind: \"instant\", epochMs: Number.isNaN(epochMs) ? 0 : epochMs, iso };\n}\n","import type { UnitValue } from \"./unit.types.js\";\n\nconst DURATION_MS: Record<string, number> = { ms: 1, s: 1000, m: 60000, h: 3600000 };\nconst SIZE_BYTES: Record<string, number> = { b: 1, kb: 1024, mb: 1048576, gb: 1073741824 };\n\n/**\n * Lexemes already read, keyed by their text.\n *\n * Callers pass `NumberLit.raw`, so this holds one entry per literal written in\n * the loaded programs. Handing the same parsed value to every caller is safe:\n * numbers are primitives and a `UnitValue` is readonly throughout, so `combine`\n * builds new values rather than mutating.\n */\nconst parsed = new Map<string, number | UnitValue>();\n\n/**\n * Read a NUMBER lexeme into the value it denotes.\n *\n * Accepts digit grouping and an optional unit suffix: \"200\", \"1_000\", \"300ms\",\n * \"2mb\", \"50%\". A lexeme with no recognised suffix reads as a plain number.\n *\n * @returns A number, or the `UnitValue` the suffix asks for.\n */\nexport function parseNumber(raw: string): number | UnitValue {\n const known = parsed.get(raw);\n if (known !== undefined) return known;\n const value = readLexeme(raw);\n parsed.set(raw, value);\n return value;\n}\n\nfunction readLexeme(raw: string): number | UnitValue {\n // `_` groups digits for the reader and means nothing to the value: the\n // grammar only lets it sit between them, so dropping it is safe here.\n const digits = raw.includes(\"_\") ? raw.replaceAll(\"_\", \"\") : raw;\n const match = /^([0-9]+(?:\\.[0-9]+)?)(ms|kb|mb|gb|b|s|m|h|%)?$/.exec(digits);\n if (!match) return Number(digits);\n const value = Number(match[1]);\n return match[2] ? toUnitValue(value, match[2]) : value;\n}\n\nfunction toUnitValue(value: number, unit: string): UnitValue {\n const ms = DURATION_MS[unit];\n if (ms !== undefined) return { kind: \"duration\", ms: value * ms };\n const bytes = SIZE_BYTES[unit];\n if (bytes !== undefined) return { kind: \"size\", bytes: value * bytes };\n return { kind: \"percent\", ratio: value / 100 };\n}\n","import type { Instant, UnitValue } from \"./unit.types.js\";\n\n/** Whether this value carries a unit: a duration, a size or a percent. */\nexport function isUnitValue(value: unknown): value is UnitValue {\n return hasKind(value, [\"duration\", \"size\", \"percent\"]);\n}\n\n/** Whether this value is a point in time. */\nexport function isInstant(value: unknown): value is Instant {\n return hasKind(value, [\"instant\"]);\n}\n\nfunction hasKind(value: unknown, kinds: readonly string[]): boolean {\n if (typeof value !== \"object\" || value === null || !(\"kind\" in value)) return false;\n return kinds.includes((value as { kind: string }).kind);\n}\n","/** Strict equality with no coercion: \"99.00\" (string) never equals 99 (number). */\nexport function strictEquals(left: unknown, right: unknown): boolean {\n return left === right;\n}\n","import { isUnitValue, type Numeric } from \"../units/index.js\";\n\n/** True for plain numbers and unit values (duration/size/percent). */\nexport function isNumeric(value: unknown): value is Numeric {\n return typeof value === \"number\" || isUnitValue(value);\n}\n","import { isUnitValue } from \"../units/index.js\";\n\n/** Boolean coercion for `!`, `&&`, `||`, and `if` conditions. */\nexport function truthy(value: unknown): boolean {\n if (value === null || value === undefined || value === false) return false;\n if (value === 0 || value === \"\") return false;\n if (isUnitValue(value)) return true;\n return Boolean(value);\n}\n","/**\n * Values that have not arrived yet, travelling up an expression.\n *\n * Expressions compile to synchronous functions, so a plugin verb called from\n * inside one hands back the promise it is running on rather than its result.\n * Computing with that promise would quietly produce nonsense, so each node that\n * meets one chains onto it and hands a promise to *its* parent. The statement\n * at the top is already asynchronous and waits there.\n *\n * The effect is that `await` never has to be written: a function reaching for\n * something slow returns something slow, all the way up, and the statement that\n * binds it gets the value. Nothing pays for this until a promise appears, and\n * the checks sit past the fast paths ordinary values take.\n */\n\n/** Whether this value is still on its way. */\nexport function isWaiting(value: unknown): value is Promise<unknown> {\n return value instanceof Promise;\n}\n\n/** Continue once this value has arrived, or immediately if it already has. */\nexport function whenReady<T>(value: unknown, then: (settled: unknown) => T): T | Promise<T> {\n return isWaiting(value) ? value.then(then) : then(value);\n}\n\n/** The same for a pair, without building an array when neither is waiting. */\nexport function whenBothReady<T>(\n left: unknown,\n right: unknown,\n then: (a: unknown, b: unknown) => T,\n): T | Promise<T> {\n if (!isWaiting(left) && !isWaiting(right)) return then(left, right);\n return Promise.all([left, right]).then(([a, b]) => then(a, b));\n}\n\n/** The same for a list: `Promise.all` only when one of them is waiting. */\nexport function whenAllReady<T>(\n values: readonly unknown[],\n then: (settled: unknown[]) => T,\n): T | Promise<T> {\n // An index loop, not `for…of`: this runs once per call and the iterator a\n // `for…of` allocates showed up as 25% on a call-heavy program.\n for (let at = 0; at < values.length; at += 1) {\n if (isWaiting(values[at])) return Promise.all(values).then(then);\n }\n return then(values as unknown[]);\n}\n","import { buildProblem, CODES } from \"../codes/index.js\";\nimport { ProblemError } from \"../problem/index.js\";\nimport { combine, type Numeric } from \"../units/index.js\";\nimport { isNumeric, strictEquals } from \"../value/index.js\";\nimport { isWaiting, whenBothReady } from \"./pending.js\";\n\nconst NO_SPAN = { uri: \"\", offset: 0, length: 0, line: 1, column: 1 };\n\n/**\n * Two plain numbers, where the unit machinery has nothing to decide. Going\n * through `combine` for `x + 1` normalises both sides into fresh objects and\n * asks whether their units agree, which for scalars is always yes.\n *\n * The compiler looks the operator up here once, so at run time this is a\n * captured function rather than a table read.\n */\nexport const PLAIN: Record<string, (a: number, b: number) => number | boolean> = {\n \"+\": (a, b) => a + b,\n \"-\": (a, b) => a - b,\n \"*\": (a, b) => a * b,\n \"/\": (a, b) => a / b,\n \"%\": (a, b) => a % b,\n \"<\": (a, b) => a < b,\n \"<=\": (a, b) => a <= b,\n \">\": (a, b) => a > b,\n \">=\": (a, b) => a >= b,\n \"==\": (a, b) => a === b,\n \"!=\": (a, b) => a !== b,\n};\n\n/**\n * Apply a binary operator to two values of any kind.\n *\n * @throws ProblemError VN3012 when the units do not agree, or when the operator\n * has no meaning for these values.\n */\nexport function applyBinary(op: string, left: unknown, right: unknown): unknown {\n // Only on the slow path: two plain numbers never reach here. Either side may\n // still be on its way, in which case the answer is too.\n if (isWaiting(left) || isWaiting(right)) {\n return whenBothReady(left, right, (a, b) => applyBinary(op, a, b));\n }\n if (op === \"in\") return isIn(left, right);\n if (op === \"~=\") return regexMatch(left, right);\n if (isNumeric(left) && isNumeric(right)) return numeric(op, left, right);\n if (op === \"==\") return strictEquals(left, right);\n if (op === \"!=\") return !strictEquals(left, right);\n throw operatorError(op);\n}\n\n/** Negate a numeric, keeping its unit. */\nexport function negate(value: Numeric): unknown {\n const result = combine({ op: \"*\", left: value, right: -1 });\n return result.ok ? result.value : value;\n}\n\nfunction numeric(op: string, left: Numeric, right: Numeric): unknown {\n const result = combine({ op, left, right });\n if (result.ok) return result.value;\n throw new ProblemError(\n buildProblem({\n spec: CODES.VN3012_UNIT_MISMATCH,\n span: NO_SPAN,\n title: `Cannot combine ${result.mismatch.left} with ${result.mismatch.right} using \"${op}\".`,\n }),\n );\n}\n\nfunction isIn(left: unknown, right: unknown): boolean {\n if (Array.isArray(right)) return right.includes(left);\n if (typeof right === \"string\") return right.includes(String(left));\n return false;\n}\n\nfunction regexMatch(subject: unknown, pattern: unknown): boolean {\n try {\n return new RegExp(String(pattern)).test(String(subject));\n } catch {\n return false;\n }\n}\n\nfunction operatorError(op: string): ProblemError {\n return new ProblemError(\n buildProblem({\n spec: CODES.VN3012_UNIT_MISMATCH,\n span: NO_SPAN,\n title: `Operator \"${op}\" cannot be applied to these values.`,\n }),\n );\n}\n","import { applyBinary } from \"../../expr/operators.js\";\nimport type { Thunk } from \"../compile.types.js\";\n\n/**\n * One thunk builder per arithmetic operator, with the operation written out.\n *\n * The repetition is the point. Sharing `(a, b) => a + b` and calling it from\n * the compiled thunk gives one call site eleven different callees, which is\n * megamorphic and stops V8 inlining it. Writing `a + b` into each thunk gives\n * every operator its own site with one callee.\n *\n * Two plain numbers take the short way; anything else (units, strings, values\n * still arriving) falls through to `applyBinary`.\n */\nexport const FAST_BINARY: Readonly<Record<string, (left: Thunk, right: Thunk) => Thunk>> = {\n \"+\": (l, r) => (env) => {\n const a = l(env);\n const b = r(env);\n return typeof a === \"number\" && typeof b === \"number\" ? a + b : applyBinary(\"+\", a, b);\n },\n \"-\": (l, r) => (env) => {\n const a = l(env);\n const b = r(env);\n return typeof a === \"number\" && typeof b === \"number\" ? a - b : applyBinary(\"-\", a, b);\n },\n \"*\": (l, r) => (env) => {\n const a = l(env);\n const b = r(env);\n return typeof a === \"number\" && typeof b === \"number\" ? a * b : applyBinary(\"*\", a, b);\n },\n \"/\": (l, r) => (env) => {\n const a = l(env);\n const b = r(env);\n return typeof a === \"number\" && typeof b === \"number\" ? a / b : applyBinary(\"/\", a, b);\n },\n \"%\": (l, r) => (env) => {\n const a = l(env);\n const b = r(env);\n return typeof a === \"number\" && typeof b === \"number\" ? a % b : applyBinary(\"%\", a, b);\n },\n \"<\": (l, r) => (env) => {\n const a = l(env);\n const b = r(env);\n return typeof a === \"number\" && typeof b === \"number\" ? a < b : applyBinary(\"<\", a, b);\n },\n \"<=\": (l, r) => (env) => {\n const a = l(env);\n const b = r(env);\n return typeof a === \"number\" && typeof b === \"number\" ? a <= b : applyBinary(\"<=\", a, b);\n },\n \">\": (l, r) => (env) => {\n const a = l(env);\n const b = r(env);\n return typeof a === \"number\" && typeof b === \"number\" ? a > b : applyBinary(\">\", a, b);\n },\n \">=\": (l, r) => (env) => {\n const a = l(env);\n const b = r(env);\n return typeof a === \"number\" && typeof b === \"number\" ? a >= b : applyBinary(\">=\", a, b);\n },\n \"==\": (l, r) => (env) => {\n const a = l(env);\n const b = r(env);\n return typeof a === \"number\" && typeof b === \"number\" ? a === b : applyBinary(\"==\", a, b);\n },\n \"!=\": (l, r) => (env) => {\n const a = l(env);\n const b = r(env);\n return typeof a === \"number\" && typeof b === \"number\" ? a !== b : applyBinary(\"!=\", a, b);\n },\n};\n","import { applyBinary, negate } from \"../../expr/operators.js\";\nimport { isWaiting } from \"../../expr/pending.js\";\nimport type { Binary, Unary } from \"../../generated/ast.js\";\nimport { isNumeric, truthy } from \"../../value/index.js\";\nimport type { Compile, Thunk } from \"../compile.types.js\";\nimport { FAST_BINARY } from \"./fast-binary.js\";\n\n/** A binary operation, with its operator resolved at compile time. */\nexport function compileBinary(expr: Binary, compile: Compile): Thunk {\n const op = expr.operator;\n if (op === \"&&\" || op === \"||\" || op === \"??\") return compileLogical(op, expr, compile);\n const left = compile(expr.left);\n const right = compile(expr.right);\n // Two plain numbers take the short way, in a thunk written for this operator\n // alone; anything else falls back to units.\n const fast = FAST_BINARY[op];\n if (fast) return fast(left, right);\n return (env) => applyBinary(op, left(env), right(env));\n}\n\nfunction compileLogical(op: string, expr: Binary, compile: Compile): Thunk {\n const left = compile(expr.left);\n const right = compile(expr.right);\n // The left side is evaluated once and kept: an action can sit in expression\n // position, and running it twice would be a second request.\n if (op === \"&&\")\n return (env) => {\n const a = left(env);\n return truthy(a) ? right(env) : a;\n };\n if (op === \"||\")\n return (env) => {\n const a = left(env);\n return truthy(a) ? a : right(env);\n };\n return (env) => left(env) ?? right(env);\n}\n\n/** `!x` and `-x`, taking the settled value straight through when it is one. */\nexport function compileUnary(expr: Unary, compile: Compile): Thunk {\n const operand = compile(expr.operand);\n if (expr.operator === \"!\") {\n return (env) => {\n const value = operand(env);\n return isWaiting(value) ? value.then((v) => !truthy(v)) : !truthy(value);\n };\n }\n return (env) => {\n const value = operand(env);\n return isWaiting(value) ? value.then(negated) : negated(value);\n };\n}\n\nfunction negated(value: unknown): unknown {\n return isNumeric(value) ? negate(value) : -Number(value);\n}\n","import type { EvalEnv } from \"./eval-env.types.js\";\n\n/**\n * A binding's storage, addressed once and read many times.\n *\n * The language has no assignment, so a name never changes what it holds, but it\n * can be *filled in* after the function reading it was built. A recursive `fn`\n * is the plain case: `fib` becomes a value before the name `fib` is bound, so\n * anything resolved eagerly would capture nothing. The cell is handed out empty\n * and filled when the binding happens, which is what lets a name be resolved at\n * compile time and still read the right value.\n */\nexport interface Cell {\n value: unknown;\n}\n\n/** An environment that can hand out a cell per name: the top of the chain. */\nexport interface CellEnv extends EvalEnv {\n cell(name: string): Cell;\n}\n\n/** Whether this environment addresses its bindings by cell. */\nexport function hasCells(env: EvalEnv): env is CellEnv {\n return typeof (env as CellEnv).cell === \"function\";\n}\n","import type { CompiledBody } from \"../compile/compile.types.js\";\nimport type { Cell } from \"./cell.types.js\";\nimport type { EvalEnv } from \"./eval-env.types.js\";\n\n/** The brand that tells a function value apart from a map that happens to look like one. */\nexport const CLOSURE: unique symbol = Symbol(\"venn.closure\");\n\n/**\n * A function value: its parameter names, its compiled body, and the environment\n * it was defined in.\n *\n * Because `fn` is pure (§08), a closure runs entirely in the evaluator, which\n * is what makes functions first-class and callable from any expression,\n * interpolation included.\n *\n * The body arrives already compiled. A `fn (…) => …` written inside `map` is\n * evaluated once per call to `map`, so compiling there would put the compiler\n * back in the hot loop.\n */\nexport interface Closure {\n readonly [CLOSURE]: true;\n readonly params: readonly string[];\n readonly body: CompiledBody;\n readonly env: EvalEnv;\n /**\n * A cell per free name of the body, resolved when this value was made.\n * Absent when the defining environment does not address bindings by cell: a\n * function nested inside another, whose free names live in its frame.\n */\n readonly up?: readonly Cell[];\n}\n","import type { CompiledBody } from \"../compile/compile.types.js\";\nimport { hasCells } from \"./cell.types.js\";\nimport { CLOSURE, type Closure } from \"./closure.types.js\";\nimport type { EvalEnv } from \"./eval-env.types.js\";\n\n/** Whether this value is a `fn`. The brand distinguishes it from a lookalike map. */\nexport function isClosure(value: unknown): value is Closure {\n return typeof value === \"object\" && value !== null && CLOSURE in value;\n}\n\n/**\n * Build a function value from parts the compiler already prepared.\n *\n * The free names are addressed here, once, against the environment the function\n * is being defined in, so the body reads them by index rather than walking the\n * chain on every call. Only where that environment hands out cells: a function\n * nested in another reads its parent's frame, which has slots and no cells, and\n * there the body falls back to asking by name.\n */\nexport function makeClosure(params: readonly string[], body: CompiledBody, env: EvalEnv): Closure {\n if (body.free.length === 0 || !hasCells(env)) return { [CLOSURE]: true, params, body, env };\n const up = body.free.map((name) => env.cell(name));\n return { [CLOSURE]: true, params, body, env, up };\n}\n\n/**\n * A class, not an object literal holding a closure: one shared prototype method\n * means the `lookup` call site inside the evaluator sees a single callee.\n *\n * `Object.hasOwn`, not `in`: `in` walks the prototype chain, so a Venn binding\n * named `constructor` or `toString` would resolve to JavaScript's own.\n */\nclass ChildEnv implements EvalEnv {\n constructor(\n private readonly parent: EvalEnv,\n private readonly bindings: Record<string, unknown>,\n ) {}\n\n lookup(name: string): unknown {\n if (Object.hasOwn(this.bindings, name)) return this.bindings[name];\n return this.parent.lookup(name);\n }\n}\n\n/**\n * An environment nested in `parent`, holding the given bindings.\n *\n * Only own properties of `bindings` count as bound, so a name such as\n * `toString` resolves through to the parent rather than to JavaScript's own.\n */\nexport function childEnv(parent: EvalEnv, bindings: Record<string, unknown>): EvalEnv {\n return new ChildEnv(parent, bindings);\n}\n","import type { Closure } from \"./closure.types.js\";\nimport type { EvalEnv } from \"./eval-env.types.js\";\n\n/** Past this many names a function keeps the rest in an array. */\nexport const INLINE_SLOTS = 3;\n\n/**\n * A function call's own storage: one slot per name it binds.\n *\n * The compiler knows every name a function introduces, so a reference to one\n * becomes a field read instead of a search. A name it does *not* introduce (a\n * top-level binding, a namespace, the prelude) is a cell the closure resolved\n * when it was built, which is an index into `up`.\n *\n * The first three slots are fields rather than an array because almost every\n * function binds three names or fewer, and a frame plus an array is two\n * allocations per call. Beyond three, `rest` holds the remainder.\n *\n * `lookup` stays because a name can still arrive as text: an expression inside\n * `\"${…}\"` is compiled apart from the body that holds it, so it asks by name.\n * Scanning a handful of parameters beats walking a chain of maps.\n */\nexport class Frame implements EvalEnv {\n s0: unknown;\n s1: unknown;\n s2: unknown;\n rest: unknown[] | undefined;\n /** The cells this function's free names resolved to, in compile order. */\n readonly up: readonly { value: unknown }[] | undefined;\n\n constructor(readonly closure: Closure) {\n const body = closure.body;\n this.s0 = undefined;\n this.s1 = undefined;\n this.s2 = undefined;\n this.rest = body.extra === 0 ? undefined : new Array<unknown>(body.extra);\n this.up = closure.up;\n }\n\n lookup(name: string): unknown {\n const at = this.closure.body.names.indexOf(name);\n return at === -1 ? this.closure.env.lookup(name) : readSlot(this, at);\n }\n}\n\n/** The slot at `at`, wherever it is held. */\nexport function readSlot(frame: Frame, at: number): unknown {\n if (at === 0) return frame.s0;\n if (at === 1) return frame.s1;\n if (at === 2) return frame.s2;\n return (frame.rest as unknown[])[at - INLINE_SLOTS];\n}\n\n/** Write the slot at `at`. Used for the parameters and the body's locals. */\nexport function writeSlot(frame: Frame, at: number, value: unknown): void {\n if (at === 0) frame.s0 = value;\n else if (at === 1) frame.s1 = value;\n else if (at === 2) frame.s2 = value;\n else (frame.rest as unknown[])[at - INLINE_SLOTS] = value;\n}\n","/**\n * Invoke a Venn callable (a closure or another native fn) with values.\n *\n * The fixed arities are part of the contract because the built-in methods are\n * the hottest callers there are: `map` and `reduce` call once per element, and\n * an argument list would be one array per element. Injected rather than\n * imported, so a method never depends on the invoker itself.\n */\nexport interface Invoke {\n (fn: unknown, values: readonly unknown[]): unknown;\n one(fn: unknown, a: unknown): unknown;\n two(fn: unknown, a: unknown, b: unknown): unknown;\n three(fn: unknown, a: unknown, b: unknown, c: unknown): unknown;\n}\n\n/** A built-in method on a native value: `[1,2].map`, `\"a\".upper`. */\nexport type Method = (receiver: never, invoke: Invoke) => unknown;\n\nconst NATIVE = Symbol(\"venn.native\");\n\n/** A callable backed by a host function rather than by Venn source. */\nexport interface NativeFn {\n readonly [NATIVE]: true;\n call(values: readonly unknown[]): unknown;\n}\n\n/** Whether this value is a host-backed callable. */\nexport function isNativeFn(value: unknown): value is NativeFn {\n return typeof value === \"object\" && value !== null && NATIVE in value;\n}\n\n/**\n * Wrap a host function so the language can call it.\n *\n * The wrapper takes the whole argument list: arity is the host function's own\n * business, and a plugin verb reads what it needs and ignores the rest.\n */\nexport function nativeFn(call: (values: readonly unknown[]) => unknown): NativeFn {\n return { [NATIVE]: true, call };\n}\n","import { buildProblem, CODES } from \"../codes/index.js\";\nimport { ProblemError } from \"../problem/index.js\";\nimport { isClosure } from \"./closure.js\";\nimport type { Closure } from \"./closure.types.js\";\nimport { Frame, writeSlot } from \"./frame.js\";\nimport { type Invoke, isNativeFn } from \"./native.types.js\";\n\nconst NO_SPAN = { uri: \"\", offset: 0, length: 0, line: 1, column: 1 };\n\n/**\n * Call any Venn callable, a `fn` closure or a built-in method, with values.\n *\n * A callee declaring fewer parameters than it is handed ignores the rest.\n *\n * @throws ProblemError VN3013 when the value is not callable.\n */\nexport function invoke(callee: unknown, values: readonly unknown[]): unknown {\n if (isClosure(callee)) return callClosure(callee, values);\n if (isNativeFn(callee)) return callee.call(values);\n throw notCallable(callee);\n}\n\n/** Whether {@link invoke} can call this, asked before committing to a call. */\nexport function isCallable(value: unknown): boolean {\n return isClosure(value) || isNativeFn(value);\n}\n\n/** The invoker handed to the built-in methods, fixed arities included. */\nexport const INVOKE: Invoke = Object.assign(invoke, {\n one: invoke1,\n two: invoke2,\n three: invoke3,\n});\n\n/**\n * Call with a single value, without building an argument list for it.\n *\n * One argument is what most calls carry, and the array holding it would live\n * exactly as long as the call takes to read it out again.\n *\n * @throws ProblemError VN3013 when the value is not callable.\n */\nexport function invoke1(callee: unknown, arg: unknown): unknown {\n if (isClosure(callee)) return callClosure1(callee, arg);\n if (isNativeFn(callee)) return callee.call([arg]);\n throw notCallable(callee);\n}\n\n/**\n * The same for two and three values, which is what the list methods hand over.\n *\n * `xs.map(fn (x) => …)` calls its function once per element, so an argument\n * list would be one array per element built only to be taken apart again.\n */\nexport function invoke2(callee: unknown, a: unknown, b: unknown): unknown {\n if (isClosure(callee)) return callClosure2(callee, a, b);\n if (isNativeFn(callee)) return callee.call([a, b]);\n throw notCallable(callee);\n}\n\nexport function invoke3(callee: unknown, a: unknown, b: unknown, c: unknown): unknown {\n if (isClosure(callee)) return callClosure3(callee, a, b, c);\n if (isNativeFn(callee)) return callee.call([a, b, c]);\n throw notCallable(callee);\n}\n\n/**\n * Run a closure's compiled body against the given argument values.\n *\n * One allocation for the call: the frame itself. The names, the body and every\n * expression in it were settled when the function was compiled.\n *\n * @returns The body's result, or a promise for it when the body reached\n * something that has not arrived yet.\n */\nexport function callClosure(closure: Closure, values: readonly unknown[]): unknown {\n if (closure.body.bare) return closure.body.result(values[0] as never);\n const frame = new Frame(closure);\n const arity = closure.params.length;\n for (let at = 0; at < arity; at += 1) writeSlot(frame, at, values[at]);\n return runBody(closure, frame);\n}\n\n/**\n * The one-argument call.\n *\n * A body the compiler found needs no environment gets the value itself as one:\n * its single name reads as `env`, so the call is the body running on the\n * argument, with nothing allocated. That is most of what `map`, `filter` and\n * `sortBy` call.\n */\nfunction callClosure1(closure: Closure, value: unknown): unknown {\n const body = closure.body;\n if (body.bare) return body.result(value as never);\n const frame = new Frame(closure);\n if (closure.params.length > 0) frame.s0 = value;\n return runBody(closure, frame);\n}\n\n// A function declaring fewer parameters than it is handed ignores the rest:\n// `xs.map(fn (x) => x)` never asks for the index it is offered.\nfunction callClosure2(closure: Closure, a: unknown, b: unknown): unknown {\n if (closure.body.bare) return closure.body.result(a as never);\n const frame = new Frame(closure);\n const arity = closure.params.length;\n if (arity > 0) frame.s0 = a;\n if (arity > 1) frame.s1 = b;\n return runBody(closure, frame);\n}\n\nfunction callClosure3(closure: Closure, a: unknown, b: unknown, c: unknown): unknown {\n if (closure.body.bare) return closure.body.result(a as never);\n const frame = new Frame(closure);\n const arity = closure.params.length;\n if (arity > 0) frame.s0 = a;\n if (arity > 1) frame.s1 = b;\n if (arity > 2) frame.s2 = c;\n return runBody(closure, frame);\n}\n\n/** Fill the body's locals in order, then answer with its result. */\nfunction runBody(closure: Closure, frame: Frame): unknown {\n const body = closure.body;\n const locals = body.locals;\n for (let at = 0; at < locals.length; at += 1) {\n const local = locals[at] as (typeof locals)[number];\n writeSlot(frame, local.slot, local.value(frame));\n }\n return body.result(frame);\n}\n\nfunction notCallable(value: unknown): ProblemError {\n return new ProblemError(\n buildProblem({\n spec: CODES.VN3013_NOT_CALLABLE,\n span: NO_SPAN,\n title: `This value is not a function, so it cannot be called: ${typeof value}.`,\n }),\n );\n}\n","import { invoke, invoke1 } from \"../../expr/invoke.js\";\nimport { isWaiting, whenAllReady, whenBothReady } from \"../../expr/pending.js\";\nimport type { Call } from \"../../generated/ast.js\";\nimport type { Compile, Thunk } from \"../compile.types.js\";\n\n/**\n * A call, with its argument list compiled.\n *\n * A call is the hottest thing a program does, so the common arities get their\n * own thunk and build the argument array from a literal rather than with `map`.\n */\nexport function compileCall(expr: Call, compile: Compile): Thunk {\n const callee = compile(expr.callee);\n const args = (expr.args?.args ?? []).map((arg) => compile(arg.value));\n if (args.length === 0) return (env) => call(callee(env), []);\n if (args.length === 1) return oneArg(callee, args[0] as Thunk);\n if (args.length === 2) return twoArgs(callee, args[0] as Thunk, args[1] as Thunk);\n return (env) =>\n call(\n callee(env),\n args.map((arg) => arg(env)),\n );\n}\n\nfunction oneArg(callee: Thunk, first: Thunk): Thunk {\n return (env) => {\n const fn = callee(env);\n const arg = first(env);\n // The overwhelmingly common shape: nothing is waiting, so the value goes\n // straight in, with no list built to hold one thing.\n if (!isWaiting(fn) && !isWaiting(arg)) return invoke1(fn, arg);\n return call(fn, [arg]);\n };\n}\n\nfunction twoArgs(callee: Thunk, first: Thunk, second: Thunk): Thunk {\n return (env) => {\n const fn = callee(env);\n const a = first(env);\n const b = second(env);\n if (!isWaiting(fn) && !isWaiting(a) && !isWaiting(b)) return invoke(fn, [a, b]);\n return call(fn, [a, b]);\n };\n}\n\n/** Wait for whatever is not here yet: the function, or what it is given. */\nfunction call(callee: unknown, values: unknown[]): unknown {\n if (!isWaiting(callee)) return whenAllReady(values, (ready) => invoke(callee, ready));\n return whenBothReady(callee, Promise.all(values), (fn, ready) => invoke(fn, ready as unknown[]));\n}\n","import { isWaiting } from \"../../expr/pending.js\";\nimport type { Thunk } from \"../compile.types.js\";\n\n/** Replace each field with what it was waiting for, keeping the same shape. */\ntype Settle = (out: Record<string, unknown>, keys: readonly string[]) => Promise<unknown>;\n\n/** How a map of a known size is built, given its keys and its value thunks. */\ntype Build = (keys: readonly string[], values: readonly Thunk[], settle: Settle) => Thunk;\n\n/**\n * Map literals of the everyday sizes, with the loop written out.\n *\n * The object is still made empty and filled by assignment, which is what gives\n * every map from one site the same shape and so makes reading a field fast.\n * What goes is the loop: reading `keys[at]` and `values[at]` per field, and\n * carrying a flag for whether anything was waiting.\n *\n * Writing the literal in one go (`{ [k0]: a, [k1]: b }`) is faster to build and\n * much slower to read, because those objects share no shape with each other.\n * Records are built once and read many times, so it is the wrong trade.\n */\nexport const UNROLLED_MAP: Readonly<Record<number, Build>> = {\n 1: (keys, values, settle) => {\n const k0 = keys[0] as string;\n const v0 = values[0] as Thunk;\n return (env) => {\n const a = v0(env);\n const out: Record<string, unknown> = {};\n out[k0] = a;\n return isWaiting(a) ? settle(out, keys) : out;\n };\n },\n 2: (keys, values, settle) => {\n const [k0, k1] = keys as [string, string];\n const [v0, v1] = values as [Thunk, Thunk];\n return (env) => {\n const a = v0(env);\n const b = v1(env);\n const out: Record<string, unknown> = {};\n out[k0] = a;\n out[k1] = b;\n return isWaiting(a) || isWaiting(b) ? settle(out, keys) : out;\n };\n },\n 3: (keys, values, settle) => {\n const [k0, k1, k2] = keys as [string, string, string];\n const [v0, v1, v2] = values as [Thunk, Thunk, Thunk];\n return (env) => {\n const a = v0(env);\n const b = v1(env);\n const c = v2(env);\n const out: Record<string, unknown> = {};\n out[k0] = a;\n out[k1] = b;\n out[k2] = c;\n return isWaiting(a) || isWaiting(b) || isWaiting(c) ? settle(out, keys) : out;\n };\n },\n 4: (keys, values, settle) => {\n const [k0, k1, k2, k3] = keys as [string, string, string, string];\n const [v0, v1, v2, v3] = values as [Thunk, Thunk, Thunk, Thunk];\n return (env) => {\n const a = v0(env);\n const b = v1(env);\n const c = v2(env);\n const d = v3(env);\n const out: Record<string, unknown> = {};\n out[k0] = a;\n out[k1] = b;\n out[k2] = c;\n out[k3] = d;\n return waiting4(a, b, c, d) ? settle(out, keys) : out;\n };\n },\n};\n\nfunction waiting4(a: unknown, b: unknown, c: unknown, d: unknown): boolean {\n return isWaiting(a) || isWaiting(b) || isWaiting(c) || isWaiting(d);\n}\n","import { isWaiting } from \"../../expr/pending.js\";\nimport type { ListLit, MapLit, Ternary } from \"../../generated/ast.js\";\nimport { truthy } from \"../../value/index.js\";\nimport type { Compile, Thunk } from \"../compile.types.js\";\nimport { UNROLLED_MAP } from \"./map-fields.js\";\n\n/**\n * A list literal, built in one pass.\n *\n * The values are collected and watched for at the same time: walking the list\n * again to ask whether anything is waiting would cost a second pass on every\n * literal, which a program shaping many records feels.\n */\nexport function compileList(expr: ListLit, compile: Compile): Thunk {\n const items = expr.items.map(compile);\n return (env) => {\n const out: unknown[] = [];\n let waiting = false;\n for (let at = 0; at < items.length; at += 1) {\n const value = (items[at] as Thunk)(env);\n waiting = waiting || isWaiting(value);\n out.push(value);\n }\n return waiting ? Promise.all(out) : out;\n };\n}\n\n/**\n * A map literal, filled field by field into an empty object.\n *\n * Writing the whole literal at once with computed keys builds faster and is a\n * trap: the object it makes shares no shape with the next one, so every later\n * read of a field is slow. Records are built once and read many times, so the\n * assignment order must stay.\n */\nexport function compileMap(expr: MapLit, compile: Compile): Thunk {\n // Keys are fixed by the source; only the values are computed.\n const keys = expr.entries.map((entry) => entry.key);\n const values = expr.entries.map((entry) => compile(entry.value));\n const build = UNROLLED_MAP[keys.length];\n if (build) return build(keys, values, settleFields);\n return (env) => {\n const out: Record<string, unknown> = {};\n let waiting = false;\n for (let at = 0; at < keys.length; at += 1) {\n const value = (values[at] as Thunk)(env);\n waiting = waiting || isWaiting(value);\n out[keys[at] as string] = value;\n }\n return waiting ? settleFields(out, keys) : out;\n };\n}\n\n/** Replace each field with what it was waiting for, keeping the same shape. */\nasync function settleFields(\n out: Record<string, unknown>,\n keys: readonly string[],\n): Promise<Record<string, unknown>> {\n const ready = await Promise.all(keys.map((key) => out[key]));\n keys.forEach((key, at) => {\n out[key] = ready[at];\n });\n return out;\n}\n\n/**\n * `cond ? a : b`, branching without allocating to do it.\n *\n * Handing the continuation to `whenReady` reads better, but the continuation\n * closes over `env`, so it costs a fresh function object per evaluation. The\n * waiting branch pays that willingly: there it is a real suspension, and one\n * allocation is the least of it.\n */\nexport function compileTernary(expr: Ternary, compile: Compile): Thunk {\n const condition = compile(expr.condition);\n const then = compile(expr.then);\n const otherwise = compile(expr.otherwise);\n return (env) => {\n const cond = condition(env);\n if (!isWaiting(cond)) return truthy(cond) ? then(env) : otherwise(env);\n return cond.then((ready) => (truthy(ready) ? then(env) : otherwise(env)));\n };\n}\n","/******************************************************************************\n * This file was generated by langium-cli 4.3.0.\n * DO NOT EDIT MANUALLY!\n ******************************************************************************/\n\nimport type { Grammar } from 'langium';\nimport { loadGrammarFromJson } from 'langium';\n\nlet loadedVennGrammar: Grammar | undefined;\nexport const VennGrammar = (): Grammar => loadedVennGrammar ?? (loadedVennGrammar = loadGrammarFromJson(`{\n \"$type\": \"Grammar\",\n \"isDeclared\": true,\n \"name\": \"Venn\",\n \"rules\": [\n {\n \"$type\": \"ParserRule\",\n \"entry\": true,\n \"name\": \"Document\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@71\"\n },\n \"arguments\": [],\n \"cardinality\": \"*\"\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"module\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"name\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@68\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@71\"\n },\n \"arguments\": [],\n \"cardinality\": \"*\"\n }\n ],\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Assignment\",\n \"feature\": \"imports\",\n \"operator\": \"+=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@1\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@71\"\n },\n \"arguments\": [],\n \"cardinality\": \"*\"\n }\n ],\n \"cardinality\": \"*\"\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Assignment\",\n \"feature\": \"decls\",\n \"operator\": \"+=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@4\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@71\"\n },\n \"arguments\": [],\n \"cardinality\": \"*\"\n }\n ],\n \"cardinality\": \"*\"\n }\n ]\n },\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"ImportDecl\",\n \"definition\": {\n \"$type\": \"Alternatives\",\n \"elements\": [\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@2\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@3\"\n },\n \"arguments\": []\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"UseDecl\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"use\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"pkg\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@75\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"as\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"alias\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@77\"\n },\n \"arguments\": []\n }\n }\n ],\n \"cardinality\": \"?\"\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"ValueImport\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Assignment\",\n \"feature\": \"export\",\n \"operator\": \"?=\",\n \"terminal\": {\n \"$type\": \"Keyword\",\n \"value\": \"pub\"\n },\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"import\"\n },\n {\n \"$type\": \"Alternatives\",\n \"elements\": [\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"{\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"names\",\n \"operator\": \"+=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@77\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \",\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"names\",\n \"operator\": \"+=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@77\"\n },\n \"arguments\": []\n }\n }\n ],\n \"cardinality\": \"*\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"}\"\n }\n ]\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"*\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"as\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"wildcard\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@77\"\n },\n \"arguments\": []\n }\n }\n ]\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"default\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@77\"\n },\n \"arguments\": []\n }\n }\n ]\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"from\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"path\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@75\"\n },\n \"arguments\": []\n }\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"Declaration\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Assignment\",\n \"feature\": \"annotations\",\n \"operator\": \"+=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@5\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@71\"\n },\n \"arguments\": [],\n \"cardinality\": \"*\"\n }\n ],\n \"cardinality\": \"*\"\n },\n {\n \"$type\": \"Alternatives\",\n \"elements\": [\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@6\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@7\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@8\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@10\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@14\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@17\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@18\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@11\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@12\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@13\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@35\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@27\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@29\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@30\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@31\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@32\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@33\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@34\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@38\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@36\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@42\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@44\"\n },\n \"arguments\": []\n }\n ]\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"Annotation\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"@\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"name\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@77\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"(\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"args\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@66\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \")\"\n }\n ],\n \"cardinality\": \"?\"\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"FlowDecl\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"flow\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"title\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@75\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"body\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@23\"\n },\n \"arguments\": []\n }\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"FragmentDecl\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Assignment\",\n \"feature\": \"export\",\n \"operator\": \"?=\",\n \"terminal\": {\n \"$type\": \"Keyword\",\n \"value\": \"pub\"\n },\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"fragment\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"name\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@77\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"(\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"params\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@19\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \")\"\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"->\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"returns\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@21\"\n },\n \"arguments\": []\n }\n }\n ],\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"body\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@23\"\n },\n \"arguments\": []\n }\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"FnDecl\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Assignment\",\n \"feature\": \"export\",\n \"operator\": \"?=\",\n \"terminal\": {\n \"$type\": \"Keyword\",\n \"value\": \"pub\"\n },\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"fn\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"name\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@77\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"(\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"params\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@19\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \")\"\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"->\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"returns\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@21\"\n },\n \"arguments\": []\n }\n }\n ],\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"body\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@9\"\n },\n \"arguments\": []\n }\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"FnBody\",\n \"definition\": {\n \"$type\": \"Alternatives\",\n \"elements\": [\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"=>\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"result\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@46\"\n },\n \"arguments\": []\n }\n }\n ]\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"{\"\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@71\"\n },\n \"arguments\": [],\n \"cardinality\": \"*\"\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Assignment\",\n \"feature\": \"locals\",\n \"operator\": \"+=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@36\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@71\"\n },\n \"arguments\": [],\n \"cardinality\": \"+\"\n }\n ],\n \"cardinality\": \"*\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"return\",\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"result\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@46\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@71\"\n },\n \"arguments\": [],\n \"cardinality\": \"*\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"}\"\n }\n ]\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"DecoDecl\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Assignment\",\n \"feature\": \"export\",\n \"operator\": \"?=\",\n \"terminal\": {\n \"$type\": \"Keyword\",\n \"value\": \"pub\"\n },\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"deco\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"name\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@77\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"(\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"params\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@19\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \")\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"body\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@23\"\n },\n \"arguments\": []\n }\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"ConfigDecl\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"config\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"body\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@63\"\n },\n \"arguments\": []\n }\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"MatrixDecl\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"matrix\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"body\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@63\"\n },\n \"arguments\": []\n }\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"ReportDecl\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"report\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"reporters\",\n \"operator\": \"+=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@46\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \",\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"reporters\",\n \"operator\": \"+=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@46\"\n },\n \"arguments\": []\n }\n }\n ],\n \"cardinality\": \"*\"\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"TypeDecl\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"type\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"name\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@77\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"Alternatives\",\n \"elements\": [\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"=\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"alias\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@21\"\n },\n \"arguments\": []\n }\n }\n ]\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"body\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@15\"\n },\n \"arguments\": []\n }\n }\n ]\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"TypeBody\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"{\"\n },\n {\n \"$type\": \"Alternatives\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \",\"\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@71\"\n },\n \"arguments\": []\n }\n ],\n \"cardinality\": \"*\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"fields\",\n \"operator\": \"+=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@16\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Alternatives\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \",\"\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@71\"\n },\n \"arguments\": []\n }\n ],\n \"cardinality\": \"+\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"fields\",\n \"operator\": \"+=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@16\"\n },\n \"arguments\": []\n }\n }\n ],\n \"cardinality\": \"*\"\n },\n {\n \"$type\": \"Alternatives\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \",\"\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@71\"\n },\n \"arguments\": []\n }\n ],\n \"cardinality\": \"*\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"}\"\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"FieldDecl\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Assignment\",\n \"feature\": \"annotations\",\n \"operator\": \"+=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@5\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@71\"\n },\n \"arguments\": [],\n \"cardinality\": \"*\"\n }\n ],\n \"cardinality\": \"*\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"name\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@77\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"optional\",\n \"operator\": \"?=\",\n \"terminal\": {\n \"$type\": \"Keyword\",\n \"value\": \"?\"\n },\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \":\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"fieldType\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@21\"\n },\n \"arguments\": []\n }\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"FactoryDecl\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"factory\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"name\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@77\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"body\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@63\"\n },\n \"arguments\": []\n }\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"DatasetDecl\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"dataset\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"name\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@77\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \":\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"declaredType\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@21\"\n },\n \"arguments\": []\n }\n }\n ],\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"=\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"value\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@46\"\n },\n \"arguments\": []\n }\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"ParamList\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Assignment\",\n \"feature\": \"params\",\n \"operator\": \"+=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@20\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \",\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"params\",\n \"operator\": \"+=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@20\"\n },\n \"arguments\": []\n }\n }\n ],\n \"cardinality\": \"*\"\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"Param\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Assignment\",\n \"feature\": \"annotations\",\n \"operator\": \"+=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@5\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"*\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"name\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@77\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \":\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"paramType\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@21\"\n },\n \"arguments\": []\n }\n }\n ],\n \"cardinality\": \"?\"\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"TypeRef\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Assignment\",\n \"feature\": \"members\",\n \"operator\": \"+=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@22\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"|\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"members\",\n \"operator\": \"+=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@22\"\n },\n \"arguments\": []\n }\n }\n ],\n \"cardinality\": \"*\"\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"SingleType\",\n \"definition\": {\n \"$type\": \"Alternatives\",\n \"elements\": [\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Action\",\n \"inferredType\": {\n \"$type\": \"InferredType\",\n \"name\": \"NamedType\"\n }\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"name\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@68\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"<\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"args\",\n \"operator\": \"+=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@21\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \",\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"args\",\n \"operator\": \"+=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@21\"\n },\n \"arguments\": []\n }\n }\n ],\n \"cardinality\": \"*\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \">\"\n }\n ],\n \"cardinality\": \"?\"\n }\n ]\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Action\",\n \"inferredType\": {\n \"$type\": \"InferredType\",\n \"name\": \"LiteralType\"\n }\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"value\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@75\"\n },\n \"arguments\": []\n }\n }\n ]\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"Block\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"{\"\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@71\"\n },\n \"arguments\": [],\n \"cardinality\": \"*\"\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Assignment\",\n \"feature\": \"stmts\",\n \"operator\": \"+=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@24\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@71\"\n },\n \"arguments\": [],\n \"cardinality\": \"+\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"stmts\",\n \"operator\": \"+=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@24\"\n },\n \"arguments\": []\n }\n }\n ],\n \"cardinality\": \"*\"\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@71\"\n },\n \"arguments\": [],\n \"cardinality\": \"*\"\n }\n ],\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"}\"\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"Statement\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Assignment\",\n \"feature\": \"annotations\",\n \"operator\": \"+=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@5\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@71\"\n },\n \"arguments\": [],\n \"cardinality\": \"*\"\n }\n ],\n \"cardinality\": \"*\"\n },\n {\n \"$type\": \"Alternatives\",\n \"elements\": [\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@25\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@26\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@27\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@29\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@30\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@31\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@32\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@33\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@34\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@35\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@36\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@37\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@42\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@38\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@39\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@40\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@41\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@44\"\n },\n \"arguments\": []\n }\n ]\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"StepDecl\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"step\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"title\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@75\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"body\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@23\"\n },\n \"arguments\": []\n }\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"GroupDecl\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"group\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"title\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@75\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"body\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@23\"\n },\n \"arguments\": []\n }\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"IfStmt\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"if\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"cond\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@46\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"then\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@23\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"else\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"otherwise\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@28\"\n },\n \"arguments\": []\n }\n }\n ],\n \"cardinality\": \"?\"\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"ElseBranch\",\n \"definition\": {\n \"$type\": \"Alternatives\",\n \"elements\": [\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@27\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@23\"\n },\n \"arguments\": []\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"ForEachStmt\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"forEach\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"item\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@77\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"in\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"source\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@46\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"opts\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@63\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"body\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@23\"\n },\n \"arguments\": []\n }\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"RepeatStmt\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"repeat\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"count\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@46\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"as\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"index\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@77\"\n },\n \"arguments\": []\n }\n }\n ],\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"body\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@23\"\n },\n \"arguments\": []\n }\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"WhileStmt\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"while\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"cond\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@46\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"body\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@23\"\n },\n \"arguments\": []\n }\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"ParallelStmt\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"parallel\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"opts\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@63\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"body\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@23\"\n },\n \"arguments\": []\n }\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"RaceStmt\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"race\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"opts\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@63\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"body\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@23\"\n },\n \"arguments\": []\n }\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"TryStmt\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"try\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"body\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@23\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"catch\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"error\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@77\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"handler\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@23\"\n },\n \"arguments\": []\n }\n }\n ],\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"finally\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"finalizer\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@23\"\n },\n \"arguments\": []\n }\n }\n ],\n \"cardinality\": \"?\"\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"LifecycleDecl\",\n \"definition\": {\n \"$type\": \"Alternatives\",\n \"elements\": [\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Assignment\",\n \"feature\": \"hook\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"Alternatives\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"setup\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"teardown\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"beforeEach\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"afterEach\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"defer\"\n }\n ]\n }\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"body\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@23\"\n },\n \"arguments\": []\n }\n }\n ]\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"on\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"event\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@77\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"(\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"arg\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@46\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \")\"\n }\n ],\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"body\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@23\"\n },\n \"arguments\": []\n }\n }\n ]\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"LetStmt\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Assignment\",\n \"feature\": \"kind\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"Alternatives\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"let\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"const\"\n }\n ]\n }\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"name\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@77\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \":\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"declaredType\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@21\"\n },\n \"arguments\": []\n }\n }\n ],\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"=\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"value\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@46\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"args\",\n \"operator\": \"+=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@45\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"*\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"opts\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@63\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"?\"\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"CaptureStmt\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"capture\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"name\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@77\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"=\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"value\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@46\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"opts\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@63\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"?\"\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"RunStmt\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"run\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"target\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@68\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"(\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"args\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@66\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \")\"\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"as\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"bind\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@77\"\n },\n \"arguments\": []\n }\n }\n ],\n \"cardinality\": \"?\"\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"ReturnStmt\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Action\",\n \"inferredType\": {\n \"$type\": \"InferredType\",\n \"name\": \"ReturnStmt\"\n }\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"return\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"value\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@46\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"?\"\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"BreakStmt\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Action\",\n \"inferredType\": {\n \"$type\": \"InferredType\",\n \"name\": \"BreakStmt\"\n }\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"break\"\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"ContinueStmt\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Action\",\n \"inferredType\": {\n \"$type\": \"InferredType\",\n \"name\": \"ContinueStmt\"\n }\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"continue\"\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"ExpectStmt\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"expect\"\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \".\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"modifier\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"Alternatives\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"soft\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"all\"\n }\n ]\n }\n }\n ],\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Alternatives\",\n \"elements\": [\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"{\"\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@71\"\n },\n \"arguments\": [],\n \"cardinality\": \"*\"\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Assignment\",\n \"feature\": \"checks\",\n \"operator\": \"+=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@46\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@71\"\n },\n \"arguments\": [],\n \"cardinality\": \"+\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"checks\",\n \"operator\": \"+=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@46\"\n },\n \"arguments\": []\n }\n }\n ],\n \"cardinality\": \"*\"\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@71\"\n },\n \"arguments\": [],\n \"cardinality\": \"*\"\n }\n ],\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"}\"\n }\n ]\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Assignment\",\n \"feature\": \"negate\",\n \"operator\": \"?=\",\n \"terminal\": {\n \"$type\": \"Keyword\",\n \"value\": \"not\"\n },\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"subject\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@46\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"matcher\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@43\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"?\"\n }\n ]\n }\n ]\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"MatcherClause\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Assignment\",\n \"feature\": \"name\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@77\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"args\",\n \"operator\": \"+=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@45\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"*\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"opts\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@63\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"?\"\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"ActionCall\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Assignment\",\n \"feature\": \"target\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@68\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Assignment\",\n \"feature\": \"called\",\n \"operator\": \"?=\",\n \"terminal\": {\n \"$type\": \"Keyword\",\n \"value\": \"(\"\n }\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"call\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@66\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \")\"\n }\n ],\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"args\",\n \"operator\": \"+=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@45\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"*\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"opts\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@63\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"?\"\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"ActionArg\",\n \"inferredType\": {\n \"$type\": \"InferredType\",\n \"name\": \"Expr\"\n },\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@58\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"Alternatives\",\n \"elements\": [\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Action\",\n \"inferredType\": {\n \"$type\": \"InferredType\",\n \"name\": \"Member\"\n },\n \"feature\": \"receiver\",\n \"operator\": \"=\"\n },\n {\n \"$type\": \"Alternatives\",\n \"elements\": [\n {\n \"$type\": \"Assignment\",\n \"feature\": \"optional\",\n \"operator\": \"?=\",\n \"terminal\": {\n \"$type\": \"Keyword\",\n \"value\": \"?.\"\n }\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \".\"\n }\n ]\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"member\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@77\"\n },\n \"arguments\": []\n }\n }\n ]\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Action\",\n \"inferredType\": {\n \"$type\": \"InferredType\",\n \"name\": \"Index\"\n },\n \"feature\": \"receiver\",\n \"operator\": \"=\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"[\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"index\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@46\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"]\"\n }\n ]\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Action\",\n \"inferredType\": {\n \"$type\": \"InferredType\",\n \"name\": \"Call\"\n },\n \"feature\": \"callee\",\n \"operator\": \"=\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"(\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"args\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@66\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \")\"\n }\n ]\n }\n ],\n \"cardinality\": \"*\"\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"Expr\",\n \"definition\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@47\"\n },\n \"arguments\": []\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"Ternary\",\n \"inferredType\": {\n \"$type\": \"InferredType\",\n \"name\": \"Expr\"\n },\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@48\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Action\",\n \"inferredType\": {\n \"$type\": \"InferredType\",\n \"name\": \"Ternary\"\n },\n \"feature\": \"condition\",\n \"operator\": \"=\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"?\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"then\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@46\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \":\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"otherwise\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@46\"\n },\n \"arguments\": []\n }\n }\n ],\n \"cardinality\": \"?\"\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"Coalesce\",\n \"inferredType\": {\n \"$type\": \"InferredType\",\n \"name\": \"Expr\"\n },\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@49\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Action\",\n \"inferredType\": {\n \"$type\": \"InferredType\",\n \"name\": \"Binary\"\n },\n \"feature\": \"left\",\n \"operator\": \"=\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"operator\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"Keyword\",\n \"value\": \"??\"\n }\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"right\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@49\"\n },\n \"arguments\": []\n }\n }\n ],\n \"cardinality\": \"*\"\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"LogicalOr\",\n \"inferredType\": {\n \"$type\": \"InferredType\",\n \"name\": \"Expr\"\n },\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@50\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Action\",\n \"inferredType\": {\n \"$type\": \"InferredType\",\n \"name\": \"Binary\"\n },\n \"feature\": \"left\",\n \"operator\": \"=\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"operator\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"Keyword\",\n \"value\": \"||\"\n }\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"right\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@50\"\n },\n \"arguments\": []\n }\n }\n ],\n \"cardinality\": \"*\"\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"LogicalAnd\",\n \"inferredType\": {\n \"$type\": \"InferredType\",\n \"name\": \"Expr\"\n },\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@51\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Action\",\n \"inferredType\": {\n \"$type\": \"InferredType\",\n \"name\": \"Binary\"\n },\n \"feature\": \"left\",\n \"operator\": \"=\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"operator\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"Keyword\",\n \"value\": \"&&\"\n }\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"right\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@51\"\n },\n \"arguments\": []\n }\n }\n ],\n \"cardinality\": \"*\"\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"Equality\",\n \"inferredType\": {\n \"$type\": \"InferredType\",\n \"name\": \"Expr\"\n },\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@52\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Action\",\n \"inferredType\": {\n \"$type\": \"InferredType\",\n \"name\": \"Binary\"\n },\n \"feature\": \"left\",\n \"operator\": \"=\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"operator\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"Alternatives\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"==\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"!=\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"~=\"\n }\n ]\n }\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"right\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@52\"\n },\n \"arguments\": []\n }\n }\n ],\n \"cardinality\": \"*\"\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"Relational\",\n \"inferredType\": {\n \"$type\": \"InferredType\",\n \"name\": \"Expr\"\n },\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@53\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Action\",\n \"inferredType\": {\n \"$type\": \"InferredType\",\n \"name\": \"Binary\"\n },\n \"feature\": \"left\",\n \"operator\": \"=\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"operator\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"Alternatives\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"<=\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \">=\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"<\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \">\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"in\"\n }\n ]\n }\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"right\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@53\"\n },\n \"arguments\": []\n }\n }\n ],\n \"cardinality\": \"*\"\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"Additive\",\n \"inferredType\": {\n \"$type\": \"InferredType\",\n \"name\": \"Expr\"\n },\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@54\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Action\",\n \"inferredType\": {\n \"$type\": \"InferredType\",\n \"name\": \"Binary\"\n },\n \"feature\": \"left\",\n \"operator\": \"=\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"operator\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"Alternatives\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"+\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"-\"\n }\n ]\n }\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"right\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@54\"\n },\n \"arguments\": []\n }\n }\n ],\n \"cardinality\": \"*\"\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"Multiplicative\",\n \"inferredType\": {\n \"$type\": \"InferredType\",\n \"name\": \"Expr\"\n },\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@55\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Action\",\n \"inferredType\": {\n \"$type\": \"InferredType\",\n \"name\": \"Binary\"\n },\n \"feature\": \"left\",\n \"operator\": \"=\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"operator\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"Alternatives\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"*\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"/\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"%\"\n }\n ]\n }\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"right\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@55\"\n },\n \"arguments\": []\n }\n }\n ],\n \"cardinality\": \"*\"\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"Unary\",\n \"inferredType\": {\n \"$type\": \"InferredType\",\n \"name\": \"Expr\"\n },\n \"definition\": {\n \"$type\": \"Alternatives\",\n \"elements\": [\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Action\",\n \"inferredType\": {\n \"$type\": \"InferredType\",\n \"name\": \"Unary\"\n }\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"operator\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"Alternatives\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"!\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"-\"\n }\n ]\n }\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"operand\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@55\"\n },\n \"arguments\": []\n }\n }\n ]\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@56\"\n },\n \"arguments\": []\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"Postfix\",\n \"inferredType\": {\n \"$type\": \"InferredType\",\n \"name\": \"Expr\"\n },\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@57\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"Alternatives\",\n \"elements\": [\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Action\",\n \"inferredType\": {\n \"$type\": \"InferredType\",\n \"name\": \"Member\"\n },\n \"feature\": \"receiver\",\n \"operator\": \"=\"\n },\n {\n \"$type\": \"Alternatives\",\n \"elements\": [\n {\n \"$type\": \"Assignment\",\n \"feature\": \"optional\",\n \"operator\": \"?=\",\n \"terminal\": {\n \"$type\": \"Keyword\",\n \"value\": \"?.\"\n }\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \".\"\n }\n ]\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"member\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@70\"\n },\n \"arguments\": []\n }\n }\n ]\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Action\",\n \"inferredType\": {\n \"$type\": \"InferredType\",\n \"name\": \"Index\"\n },\n \"feature\": \"receiver\",\n \"operator\": \"=\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"[\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"index\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@46\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"]\"\n }\n ]\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Action\",\n \"inferredType\": {\n \"$type\": \"InferredType\",\n \"name\": \"Call\"\n },\n \"feature\": \"callee\",\n \"operator\": \"=\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"(\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"args\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@66\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \")\"\n }\n ]\n }\n ],\n \"cardinality\": \"*\"\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"Primary\",\n \"inferredType\": {\n \"$type\": \"InferredType\",\n \"name\": \"Expr\"\n },\n \"definition\": {\n \"$type\": \"Alternatives\",\n \"elements\": [\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@58\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@63\"\n },\n \"arguments\": []\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"Atom\",\n \"inferredType\": {\n \"$type\": \"InferredType\",\n \"name\": \"Expr\"\n },\n \"definition\": {\n \"$type\": \"Alternatives\",\n \"elements\": [\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Action\",\n \"inferredType\": {\n \"$type\": \"InferredType\",\n \"name\": \"NumberLit\"\n }\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"raw\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@76\"\n },\n \"arguments\": []\n }\n }\n ]\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Action\",\n \"inferredType\": {\n \"$type\": \"InferredType\",\n \"name\": \"InstantLit\"\n }\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"value\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@74\"\n },\n \"arguments\": []\n }\n }\n ]\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Action\",\n \"inferredType\": {\n \"$type\": \"InferredType\",\n \"name\": \"StringLit\"\n }\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"value\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@75\"\n },\n \"arguments\": []\n }\n }\n ]\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Action\",\n \"inferredType\": {\n \"$type\": \"InferredType\",\n \"name\": \"BoolLit\"\n }\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"value\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"Alternatives\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"true\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"false\"\n }\n ]\n }\n }\n ]\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Action\",\n \"inferredType\": {\n \"$type\": \"InferredType\",\n \"name\": \"NullLit\"\n }\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"null\"\n }\n ]\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Action\",\n \"inferredType\": {\n \"$type\": \"InferredType\",\n \"name\": \"FnExpr\"\n }\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"fn\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"(\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"params\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@19\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \")\"\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"->\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"returns\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@21\"\n },\n \"arguments\": []\n }\n }\n ],\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"body\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@9\"\n },\n \"arguments\": []\n }\n }\n ]\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Action\",\n \"inferredType\": {\n \"$type\": \"InferredType\",\n \"name\": \"FnExpr\"\n }\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"params\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@59\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"=>\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"body\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@61\"\n },\n \"arguments\": []\n }\n }\n ]\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Action\",\n \"inferredType\": {\n \"$type\": \"InferredType\",\n \"name\": \"FnExpr\"\n }\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"(\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"params\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@19\"\n },\n \"arguments\": []\n },\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \")\"\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"->\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"returns\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@21\"\n },\n \"arguments\": []\n }\n }\n ],\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"=>\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"body\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@61\"\n },\n \"arguments\": []\n }\n }\n ]\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Action\",\n \"inferredType\": {\n \"$type\": \"InferredType\",\n \"name\": \"Ref\"\n }\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"name\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@69\"\n },\n \"arguments\": []\n }\n }\n ]\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@62\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"(\"\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@46\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \")\"\n }\n ]\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"BareParam\",\n \"inferredType\": {\n \"$type\": \"InferredType\",\n \"name\": \"ParamList\"\n },\n \"definition\": {\n \"$type\": \"Assignment\",\n \"feature\": \"params\",\n \"operator\": \"+=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@60\"\n },\n \"arguments\": []\n }\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"BareParamName\",\n \"inferredType\": {\n \"$type\": \"InferredType\",\n \"name\": \"Param\"\n },\n \"definition\": {\n \"$type\": \"Assignment\",\n \"feature\": \"name\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@77\"\n },\n \"arguments\": []\n }\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"ArrowBody\",\n \"inferredType\": {\n \"$type\": \"InferredType\",\n \"name\": \"FnBody\"\n },\n \"definition\": {\n \"$type\": \"Assignment\",\n \"feature\": \"result\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@46\"\n },\n \"arguments\": []\n }\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"ListLit\",\n \"inferredType\": {\n \"$type\": \"InferredType\",\n \"name\": \"ListLit\"\n },\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"[\"\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Assignment\",\n \"feature\": \"items\",\n \"operator\": \"+=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@46\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \",\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"items\",\n \"operator\": \"+=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@46\"\n },\n \"arguments\": []\n }\n }\n ],\n \"cardinality\": \"*\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \",\",\n \"cardinality\": \"?\"\n }\n ],\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"]\"\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"MapLit\",\n \"inferredType\": {\n \"$type\": \"InferredType\",\n \"name\": \"MapLit\"\n },\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \"{\"\n },\n {\n \"$type\": \"Alternatives\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \",\"\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@71\"\n },\n \"arguments\": []\n }\n ],\n \"cardinality\": \"*\"\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Assignment\",\n \"feature\": \"entries\",\n \"operator\": \"+=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@64\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Alternatives\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \",\"\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@71\"\n },\n \"arguments\": []\n }\n ],\n \"cardinality\": \"+\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"entries\",\n \"operator\": \"+=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@64\"\n },\n \"arguments\": []\n }\n }\n ],\n \"cardinality\": \"*\"\n },\n {\n \"$type\": \"Alternatives\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \",\"\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@71\"\n },\n \"arguments\": []\n }\n ],\n \"cardinality\": \"*\"\n }\n ],\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"}\"\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"MapEntry\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Assignment\",\n \"feature\": \"key\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@65\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \":\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"value\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@46\"\n },\n \"arguments\": []\n }\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"MapKey\",\n \"dataType\": \"string\",\n \"definition\": {\n \"$type\": \"Alternatives\",\n \"elements\": [\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@70\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@75\"\n },\n \"arguments\": []\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"ArgList\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Assignment\",\n \"feature\": \"args\",\n \"operator\": \"+=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@67\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \",\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"args\",\n \"operator\": \"+=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@67\"\n },\n \"arguments\": []\n }\n }\n ],\n \"cardinality\": \"*\"\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"Arg\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Assignment\",\n \"feature\": \"name\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@77\"\n },\n \"arguments\": []\n }\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \":\"\n }\n ],\n \"cardinality\": \"?\"\n },\n {\n \"$type\": \"Assignment\",\n \"feature\": \"value\",\n \"operator\": \"=\",\n \"terminal\": {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@46\"\n },\n \"arguments\": []\n }\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"QualifiedName\",\n \"dataType\": \"string\",\n \"definition\": {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@77\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"Group\",\n \"elements\": [\n {\n \"$type\": \"Keyword\",\n \"value\": \".\"\n },\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@70\"\n },\n \"arguments\": []\n }\n ],\n \"cardinality\": \"*\"\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"RefName\",\n \"dataType\": \"string\",\n \"definition\": {\n \"$type\": \"Alternatives\",\n \"elements\": [\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@77\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"matrix\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"flow\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"step\"\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"ParserRule\",\n \"name\": \"Word\",\n \"dataType\": \"string\",\n \"definition\": {\n \"$type\": \"Alternatives\",\n \"elements\": [\n {\n \"$type\": \"RuleCall\",\n \"rule\": {\n \"$ref\": \"#/rules@77\"\n },\n \"arguments\": []\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"module\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"use\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"as\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"pub\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"import\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"from\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"flow\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"fragment\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"fn\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"deco\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"return\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"const\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"let\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"config\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"matrix\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"report\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"type\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"factory\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"dataset\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"setup\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"teardown\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"beforeEach\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"afterEach\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"defer\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"on\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"step\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"group\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"if\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"else\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"forEach\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"in\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"repeat\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"while\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"parallel\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"race\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"try\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"catch\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"finally\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"capture\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"run\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"break\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"continue\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"expect\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"all\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"soft\"\n },\n {\n \"$type\": \"Keyword\",\n \"value\": \"not\"\n }\n ]\n },\n \"entry\": false,\n \"fragment\": false,\n \"parameters\": []\n },\n {\n \"$type\": \"TerminalRule\",\n \"name\": \"NL\",\n \"definition\": {\n \"$type\": \"RegexToken\",\n \"regex\": \"/([ \\\\\\\\t]*(\\\\\\\\r?\\\\\\\\n|;)[ \\\\\\\\t]*)+/\",\n \"parenthesized\": false\n },\n \"fragment\": false,\n \"hidden\": false\n },\n {\n \"$type\": \"TerminalRule\",\n \"hidden\": true,\n \"name\": \"WS\",\n \"definition\": {\n \"$type\": \"RegexToken\",\n \"regex\": \"/[ \\\\\\\\t]+/\",\n \"parenthesized\": false\n },\n \"fragment\": false\n },\n {\n \"$type\": \"TerminalRule\",\n \"hidden\": true,\n \"name\": \"COMMENT\",\n \"definition\": {\n \"$type\": \"RegexToken\",\n \"regex\": \"/#[^\\\\\\\\n\\\\\\\\r]*/\",\n \"parenthesized\": false\n },\n \"fragment\": false\n },\n {\n \"$type\": \"TerminalRule\",\n \"name\": \"INSTANT\",\n \"definition\": {\n \"$type\": \"RegexToken\",\n \"regex\": \"/[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\\\\\\\.[0-9]+)?Z/\",\n \"parenthesized\": false\n },\n \"fragment\": false,\n \"hidden\": false\n },\n {\n \"$type\": \"TerminalRule\",\n \"name\": \"STRING\",\n \"definition\": {\n \"$type\": \"RegexToken\",\n \"regex\": \"/\\\\\"(\\\\\\\\\\\\\\\\.|[^\\\\\"\\\\\\\\\\\\\\\\])*\\\\\"|'(\\\\\\\\\\\\\\\\.|[^'\\\\\\\\\\\\\\\\])*'/\",\n \"parenthesized\": false\n },\n \"fragment\": false,\n \"hidden\": false\n },\n {\n \"$type\": \"TerminalRule\",\n \"name\": \"NUMBER\",\n \"definition\": {\n \"$type\": \"RegexToken\",\n \"regex\": \"/[0-9]+(_[0-9]+)*(\\\\\\\\.[0-9]+(_[0-9]+)*)?(ms|kb|mb|gb|b|s|m|h|%)?/\",\n \"parenthesized\": false\n },\n \"fragment\": false,\n \"hidden\": false\n },\n {\n \"$type\": \"TerminalRule\",\n \"name\": \"ID\",\n \"definition\": {\n \"$type\": \"RegexToken\",\n \"regex\": \"/[_a-zA-Z]\\\\\\\\w*/\",\n \"parenthesized\": false\n },\n \"fragment\": false,\n \"hidden\": false\n }\n ],\n \"imports\": [],\n \"interfaces\": [],\n \"types\": []\n}`));\n","/******************************************************************************\n * This file was generated by langium-cli 4.3.0.\n * DO NOT EDIT MANUALLY!\n ******************************************************************************/\n\nimport type { LangiumSharedCoreServices, LangiumCoreServices, LangiumGeneratedCoreServices, LangiumGeneratedSharedCoreServices, LanguageMetaData, Module } from 'langium';\nimport { VennAstReflection } from './ast.js';\nimport { VennGrammar } from './grammar.js';\n\nexport const VennLanguageMetaData = {\n languageId: 'venn',\n fileExtensions: ['.vn'],\n caseInsensitive: false,\n mode: 'development'\n} as const satisfies LanguageMetaData;\n\nexport const VennGeneratedSharedModule: Module<LangiumSharedCoreServices, LangiumGeneratedSharedCoreServices> = {\n AstReflection: () => new VennAstReflection()\n};\n\nexport const VennGeneratedModule: Module<LangiumCoreServices, LangiumGeneratedCoreServices> = {\n Grammar: () => VennGrammar(),\n LanguageMetaData: () => VennLanguageMetaData,\n parser: {}\n};\n","import { DefaultLexer, type LexerResult, type TokenizeOptions } from \"langium\";\n\n/** A single lexed token; NL suppression keys off its token-type name. */\ntype Token = LexerResult[\"tokens\"][number];\n\n/**\n * Makes `NL` (a newline or `;`) significant between statements, but suppresses\n * it inside `( )` and `[ ]` so calls, arg lists and list literals may still\n * span multiple physical lines. Blocks and maps (`{ }`) keep their newlines.\n */\nexport class VennLexer extends DefaultLexer {\n override tokenize(text: string, options?: TokenizeOptions): LexerResult {\n const result = super.tokenize(text, options);\n result.tokens = suppressBracketedNewlines(result.tokens);\n return result;\n }\n}\n\nfunction suppressBracketedNewlines(tokens: Token[]): Token[] {\n const kept: Token[] = [];\n let depth = 0;\n for (const token of tokens) {\n depth = Math.max(0, depth + bracketDelta(token.tokenType.name));\n if (token.tokenType.name === \"NL\" && depth > 0) continue;\n kept.push(token);\n }\n return kept;\n}\n\nfunction bracketDelta(name: string): number {\n if (name === \"(\" || name === \"[\") return 1;\n if (name === \")\" || name === \"]\") return -1;\n return 0;\n}\n","import {\n createDefaultCoreModule,\n createDefaultSharedCoreModule,\n EmptyFileSystem,\n inject,\n type LangiumCoreServices,\n type LanguageMetaData,\n type Module,\n} from \"langium\";\nimport {\n VennGeneratedModule,\n VennGeneratedSharedModule,\n VennLanguageMetaData,\n} from \"../generated/module.js\";\nimport { VennLexer } from \"./venn-lexer.js\";\n\n// The newline-aware lexer: `NL` is suppressed inside brackets.\nconst VennLexerModule: Module<LangiumCoreServices, { parser: { Lexer: VennLexer } }> = {\n parser: { Lexer: (services) => new VennLexer(services) },\n};\n\nfunction modeModule(\n mode: LanguageMetaData[\"mode\"],\n): Module<LangiumCoreServices, { LanguageMetaData: LanguageMetaData }> {\n return { LanguageMetaData: () => ({ ...VennLanguageMetaData, mode }) };\n}\n\n/**\n * Build the Langium core services on `EmptyFileSystem`, so no `node:*` is\n * touched and this runs in both the CLI (Node) and the LSP (Web Worker).\n *\n * `production` skips Chevrotain's grammar validation, which dominates the cost\n * of a first parse and only ever checks generated code against itself. That\n * check belongs in a test, `venn-module.test.ts`, which is why this takes a\n * mode at all.\n *\n * @param mode Langium language mode; `development` re-enables the validation.\n */\nexport function createVennServices(\n mode: LanguageMetaData[\"mode\"] = \"production\",\n): LangiumCoreServices {\n const shared = inject(createDefaultSharedCoreModule(EmptyFileSystem), VennGeneratedSharedModule);\n const venn = inject(\n createDefaultCoreModule({ shared }),\n VennGeneratedModule,\n VennLexerModule,\n modeModule(mode),\n );\n shared.ServiceRegistry.register(venn);\n return venn;\n}\n","import type { LangiumCoreServices } from \"langium\";\nimport { createVennServices } from \"./venn-module.js\";\n\nlet cached: LangiumCoreServices | undefined;\n\n/**\n * The Langium core services that `parse()` uses, built once on first call.\n * Constructing the Chevrotain parser is the expensive part of a first parse,\n * so it must not happen per document.\n */\nexport function vennServices(): LangiumCoreServices {\n cached ??= createVennServices();\n return cached;\n}\n","import { buildProblem, CODES } from \"../codes/index.js\";\nimport type { Problem, Span } from \"../problem/index.js\";\n\n/** Structural view of a Chevrotain lexer error (avoids importing chevrotain). */\ninterface LexerError {\n offset: number;\n line?: number;\n column?: number;\n length: number;\n message: string;\n}\n\n/** Structural view of a Chevrotain parser (recognition) error. */\ninterface RecognitionError {\n token: { startOffset: number; startLine?: number; startColumn?: number; image: string };\n message: string;\n}\n\n/** Map a lexer error to VN1001. */\nexport function lexerErrorToProblem(args: { error: LexerError; uri: string }): Problem {\n const e = args.error;\n const span: Span = {\n uri: args.uri,\n offset: e.offset,\n length: e.length,\n line: e.line ?? 1,\n column: e.column ?? 1,\n };\n return buildProblem({ spec: CODES.VN1001_LEX, span, title: e.message });\n}\n\n/** Map a parser error to VN1002. */\nexport function parserErrorToProblem(args: { error: RecognitionError; uri: string }): Problem {\n const t = args.error.token;\n const span: Span = {\n uri: args.uri,\n offset: t.startOffset,\n length: t.image?.length ?? 1,\n line: t.startLine ?? 1,\n column: t.startColumn ?? 1,\n };\n return buildProblem({ spec: CODES.VN1002_PARSE, span, title: args.error.message });\n}\n","import type { ParseResult } from \"langium\";\nimport type { Document } from \"../generated/ast.js\";\nimport { vennServices } from \"../lang/index.js\";\nimport type { Problem } from \"../problem/index.js\";\nimport { lexerErrorToProblem, parserErrorToProblem } from \"./error-to-problem.js\";\nimport type { ParseOutput } from \"./parse-output.types.js\";\n\n/**\n * Parse `.vn` source into an AST plus VN1xxx problems. Synchronous and\n * filesystem-free (Chevrotain error recovery keeps a partial AST on failure).\n * It never throws: bad syntax comes back in `problems`.\n *\n * @param options.uri Source URI recorded on every span, for editors and reports.\n */\nexport function parse(text: string, options: { uri?: string } = {}): ParseOutput {\n const uri = options.uri ?? \"memory://inline.vn\";\n const result = vennServices().parser.LangiumParser.parse<Document>(text);\n return { ast: result.value, problems: collectProblems({ result, uri }) };\n}\n\nfunction collectProblems(args: { result: ParseResult<Document>; uri: string }): Problem[] {\n const { result, uri } = args;\n const lexical = result.lexerErrors.map((error) => lexerErrorToProblem({ error, uri }));\n const syntactic = result.parserErrors.map((error) => parserErrorToProblem({ error, uri }));\n return [...lexical, ...syntactic];\n}\n","import type { ExpectStmt, Expr, FlowDecl, StepDecl } from \"../generated/ast.js\";\nimport { parse } from \"./parse.js\";\n\nconst PREFIX = 'flow \"e\" { step \"e\" { expect ';\nconst SUFFIX = \" } }\";\n\n/**\n * How far {@link parseExpression} shifts CST offsets. Exported because the\n * editor maps the parsed expression back onto the `${…}` it came from, and a\n * hand-counted constant there would rot the moment this wrapper changes.\n */\nexport const EXPRESSION_OFFSET: number = PREFIX.length;\n\n/**\n * Parse a standalone expression by wrapping it in a minimal flow and extracting\n * the `expect` subject. Used by string interpolation (`${…}`).\n *\n * @returns The expression, or `undefined` when the source does not parse.\n */\nexport function parseExpression(source: string): Expr | undefined {\n const { ast, problems } = parse(`${PREFIX}${source}${SUFFIX}`);\n if (problems.length > 0) return undefined;\n const flow = ast.decls[0] as FlowDecl | undefined;\n const step = flow?.body.stmts[0] as StepDecl | undefined;\n const stmt = step?.body.stmts[0] as ExpectStmt | undefined;\n return stmt?.subject;\n}\n","import type { InterpolationSlot } from \"./interpolation.types.js\";\n\n/**\n * Find every `${…}` placeholder in a string.\n *\n * The single description of where interpolation starts and stops: the evaluator\n * substitutes what this returns, and the language server colours, hovers and\n * resolves the very same spans. An unclosed `${` ends the scan, so the text\n * after it is ordinary characters.\n *\n * @returns The slots, in the order they appear.\n */\nexport function scanInterpolations(text: string): InterpolationSlot[] {\n const slots: InterpolationSlot[] = [];\n let open = text.indexOf(\"${\");\n while (open !== -1) {\n const close = closingBrace(text, open + 2);\n if (close === -1) break;\n slots.push(slotAt({ text, open, close }));\n open = text.indexOf(\"${\", close + 1);\n }\n return slots;\n}\n\n/** The `}` that closes the placeholder, counting nesting so `${ {a:1}.a }` works. */\nfunction closingBrace(text: string, from: number): number {\n let depth = 1;\n for (let index = from; index < text.length; index += 1) {\n if (text[index] === \"{\") depth += 1;\n else if (text[index] === \"}\") {\n depth -= 1;\n if (depth === 0) return index;\n }\n }\n return -1;\n}\n\nfunction slotAt(args: { text: string; open: number; close: number }): InterpolationSlot {\n const inner = args.text.slice(args.open + 2, args.close);\n const lead = inner.length - inner.trimStart().length;\n return {\n start: args.open,\n end: args.close + 1,\n source: inner.trim(),\n sourceStart: args.open + 2 + lead,\n };\n}\n","import { parseExpression } from \"../parse/index.js\";\nimport { scanInterpolations } from \"./scan-interpolations.js\";\nimport type { Template, TemplateHole } from \"./template.types.js\";\n\n/**\n * Templates already compiled, by the literal's text.\n *\n * Splitting a literal means a full parse per `${…}`, and the result is a pure\n * function of the text, so it is done once. A `.vn` file holds a fixed set of\n * string literals, so this holds one entry per literal.\n */\nconst compiled = new Map<string, Template>();\n\n/**\n * Split a string literal into the constant text around its placeholders and the\n * parsed expression filling each one.\n *\n * @param text The literal's value, placeholders included.\n * @returns The template, memoised: the same text always yields the same object.\n */\nexport function compileTemplate(text: string): Template {\n const known = compiled.get(text);\n if (known) return known;\n const template = split(text);\n compiled.set(text, template);\n return template;\n}\n\nfunction split(text: string): Template {\n const chunks: string[] = [];\n const holes: TemplateHole[] = [];\n let cursor = 0;\n for (const slot of scanInterpolations(text)) {\n chunks.push(text.slice(cursor, slot.start));\n holes.push({ source: slot.source, expr: parseExpression(slot.source) });\n cursor = slot.end;\n }\n chunks.push(text.slice(cursor));\n return { chunks, holes };\n}\n","import { buildProblem, CODES } from \"../../codes/index.js\";\nimport { isWaiting } from \"../../expr/pending.js\";\nimport type { NumberLit, StringLit } from \"../../generated/ast.js\";\nimport { compileTemplate, type TemplateHole } from \"../../interpolation/index.js\";\nimport { ProblemError } from \"../../problem/index.js\";\nimport { isUnitValue, parseInstant, parseNumber, type UnitValue } from \"../../units/index.js\";\nimport type { Compile, Thunk } from \"../compile.types.js\";\n\nconst NO_SPAN = { uri: \"\", offset: 0, length: 0, line: 1, column: 1 };\n\n/** A literal is a constant: read the lexeme once, then hand back the value. */\nexport function constant(value: unknown): Thunk {\n return () => value;\n}\n\nexport function compileNumber(expr: NumberLit): Thunk {\n return constant(parseNumber(expr.raw));\n}\n\nexport function compileInstant(expr: { value: string }): Thunk {\n return constant(parseInstant(expr.value));\n}\n\n/**\n * A string with no `${…}` is a constant. One with placeholders becomes the\n * literal chunks plus a compiled thunk per hole: the scanning, the parsing and\n * the splitting all happen here, never again.\n */\nexport function compileString(expr: StringLit, compile: Compile): Thunk {\n const { chunks, holes } = compileTemplate(expr.value);\n if (holes.length === 0) return constant(expr.value);\n const fills = holes.map((hole) => compileHole(hole, compile));\n // Filled in one pass, watching as it goes for a placeholder still arriving.\n // `map` with a continuation reads better but builds two function objects per\n // evaluation, both closing over `env`. The values still land in an array\n // because a hole cannot be evaluated twice: one of them may be an action.\n return (env) => {\n const values = new Array<unknown>(fills.length);\n let waiting = false;\n for (let at = 0; at < fills.length; at += 1) {\n const value = (fills[at] as Thunk)(env);\n waiting = waiting || isWaiting(value);\n values[at] = value;\n }\n return waiting ? settleJoin(chunks, values) : join(chunks, values);\n };\n}\n\n/** The waiting path: every hole settled, then the same join. */\nasync function settleJoin(chunks: readonly string[], values: unknown[]): Promise<string> {\n return join(chunks, await Promise.all(values));\n}\n\nfunction join(chunks: readonly string[], values: readonly unknown[]): string {\n let out = chunks[0] ?? \"\";\n for (let at = 0; at < values.length; at += 1) {\n out += stringify(values[at]) + (chunks[at + 1] ?? \"\");\n }\n return out;\n}\n\n/** A placeholder that does not parse is a mistake worth reporting, not an empty string. */\nfunction compileHole(hole: TemplateHole, compile: Compile): Thunk {\n if (hole.expr) return compile(hole.expr);\n return () => {\n throw new ProblemError(\n buildProblem({\n spec: CODES.VN1002_PARSE,\n span: NO_SPAN,\n title: `Cannot read \\`\\${${hole.source}}\\` — that is not an expression.`,\n }),\n );\n };\n}\n\nfunction stringify(value: unknown): string {\n if (value === null || value === undefined) return \"\";\n if (isUnitValue(value)) return stringifyUnit(value);\n return String(value);\n}\n\nfunction stringifyUnit(value: UnitValue): string {\n if (value.kind === \"duration\") return `${value.ms}ms`;\n if (value.kind === \"size\") return `${value.bytes}b`;\n return `${value.ratio * 100}%`;\n}\n","import type { Expr } from \"../../generated/ast.js\";\nimport type { Thunk } from \"../compile.types.js\";\nimport { constant } from \"./literal.js\";\n\n/** A value standing where an expression was. Only expansion ever writes one. */\ninterface ConstLit {\n $type: \"ConstLit\";\n value: unknown;\n}\n\nconst CONST_LIT = \"ConstLit\";\n\n/**\n * Wrap a value as an expression node.\n *\n * A decorator's `.setValue` binds a value, and the grammar has no node that\n * holds one: every literal it produces is text still to be read. Expansion\n * writes this instead, so a changed binding is a change to the tree itself\n * rather than to a lookup table kept beside it.\n */\nexport function constLit(value: unknown): Expr {\n return { $type: CONST_LIT, value } as unknown as Expr;\n}\n\n/** The thunk for a node expansion put there, or nothing for anything else. */\nexport function constThunk(expr: unknown): Thunk | undefined {\n const written = expr as ConstLit | undefined;\n if (written?.$type !== CONST_LIT) return undefined;\n return constant(written.value);\n}\n","import type { Cell } from \"../../expr/cell.types.js\";\nimport { hasCells } from \"../../expr/cell.types.js\";\nimport { makeClosure } from \"../../expr/closure.js\";\nimport type { Closure } from \"../../expr/closure.types.js\";\nimport type { EvalEnv } from \"../../expr/eval-env.types.js\";\nimport { INLINE_SLOTS } from \"../../expr/frame.js\";\nimport type { FnBody, FnDecl, FnExpr, ParamList } from \"../../generated/ast.js\";\nimport type { CompiledBody, Thunk } from \"../compile.types.js\";\nimport { type LexScope, scopeOf, stayedBare } from \"../lex-scope.js\";\n\n/** How the dispatcher compiles a sub-expression in a given scope. */\nexport type CompileIn = (expr: FnBody[\"result\"], scope: LexScope) => Thunk;\n\n/** `fn (…) => …` as a value: the body is compiled here, not on every evaluation. */\nexport function compileFnExpr(expr: FnExpr, compileIn: CompileIn): Thunk {\n const params = paramNames(expr.params);\n // No `cellOf`: this body is compiled once and shared by every closure the\n // expression makes, so it cannot hold cells belonging to one of them.\n const body = compileBody({ params: expr.params, body: expr.body, compileIn });\n return (env) => makeClosure(params, body, env);\n}\n\n/**\n * A top-level `fn name(…)`, bound into a scope.\n *\n * This body is compiled per closure, and there is exactly one closure per\n * declaration, so the cells its free names resolve to can be captured in the\n * thunks that read them. That is what lets a recursive function keep its own\n * name without needing an environment to find it in, which in turn is what lets\n * it run without a frame.\n */\nexport function closureIn(decl: FnDecl, env: EvalEnv, compileIn: CompileIn): Closure {\n const cellOf = hasCells(env) ? (name: string) => env.cell(name) : undefined;\n const body = compileBody({ params: decl.params, body: decl.body, compileIn, cellOf });\n return makeClosure(paramNames(decl.params), body, env);\n}\n\ninterface BodyArgs {\n params: ParamList | undefined;\n body: FnBody;\n compileIn: CompileIn;\n /** Absent when the body is shared by more than one closure. */\n cellOf?: (name: string) => Cell;\n}\n\n/**\n * Compile a body, first assuming it needs no frame.\n *\n * Whether it does is known only once it has been compiled: a free name needs\n * cells to reach, and a `\"${…}\"` asks for names as text. So the optimistic pass\n * runs and is thrown away when it was wrong, which costs one extra compile of\n * one body against an allocation saved on every call it will ever receive.\n */\nfunction compileBody(args: BodyArgs): CompiledBody {\n const first = compileInScope(scoped(args), args);\n if (first.bare || !first.wasBare) return first.compiled;\n const plain = scoped(args);\n plain.bare = false;\n return compileInScope(plain, args).compiled;\n}\n\nfunction scoped(args: BodyArgs): LexScope {\n const scope = scopeOf(args.params, args.body);\n scope.cellOf = args.cellOf;\n return scope;\n}\n\nfunction compileInScope(\n scope: LexScope,\n args: BodyArgs,\n): { compiled: CompiledBody; bare: boolean; wasBare: boolean } {\n const { body, compileIn } = args;\n const wasBare = Boolean(scope.bare);\n const locals = body.locals.map((local) => ({\n slot: scope.names.indexOf(local.name),\n value: compileIn(local.value, scope),\n }));\n const result = compileIn(body.result, scope);\n const bare = stayedBare(scope);\n const extra = Math.max(0, scope.names.length - INLINE_SLOTS);\n const free = scope.free ?? [];\n return { compiled: { names: scope.names, extra, free, locals, result, bare }, bare, wasBare };\n}\n\nfunction paramNames(params: ParamList | undefined): readonly string[] {\n return (params?.params ?? []).map((param) => param.name);\n}\n","import { type Method, nativeFn } from \"./native.types.js\";\n\nconst TASK = Symbol(\"venn.task\");\n\n/**\n * Work already under way, held rather than waited for.\n *\n * Every call in Venn waits by itself, which is what makes `async` and `await`\n * unnecessary. `spawn` is how to opt out and start something without stopping\n * for it, the other half of the same feature.\n *\n * A task is deliberately not a promise. A promise handed to `let` would be\n * waited for by the statement, which is exactly what `spawn` exists to avoid,\n * so the promise is kept inside and `.wait` is how a reader asks for it back.\n */\nexport interface Task {\n readonly [TASK]: true;\n readonly promise: Promise<unknown>;\n settled: boolean;\n failed: boolean;\n}\n\n/** Whether this value is a running task. */\nexport function isTask(value: unknown): value is Task {\n return typeof value === \"object\" && value !== null && TASK in value;\n}\n\n/**\n * Start work and hand back a handle to it.\n *\n * The work begins on the next microtask, and the handle observes the promise\n * straight away, so a task nobody waits for cannot raise an unhandled\n * rejection.\n */\nexport function startTask(run: () => unknown): Task {\n const task: Task = {\n [TASK]: true,\n promise: Promise.resolve().then(run),\n settled: false,\n failed: false,\n };\n void task.promise.then(\n () => {\n task.settled = true;\n },\n () => {\n task.settled = true;\n task.failed = true;\n },\n );\n return task;\n}\n\n/**\n * What a task answers to.\n *\n * `.wait` gives back the promise and the statement that binds it does the\n * waiting, which is the same rule as everywhere else.\n */\nexport const TASK_METHODS: Record<string, Method> = {\n wait: (task: Task) => task.promise,\n done: (task: Task) => task.settled,\n failed: (task: Task) => task.failed,\n // Failure is the caller's to handle: a task nobody waits for must not take\n // the process down with an unhandled rejection.\n settle: (task: Task) => nativeFn(() => task.promise.then(ok, () => undefined)),\n};\n\nfunction ok(value: unknown): unknown {\n return value;\n}\n","import { type Invoke, type Method, nativeFn } from \"../native.types.js\";\n\ntype Dict = Record<string, unknown>;\n\n/**\n * A grouping key: what `groupBy`, `countBy` and `keyBy` file an item under.\n *\n * A number or a boolean converts directly; only a shape is serialised. Passing\n * scalars through `JSON.stringify` would be both slower and wrong, since it\n * renders `Infinity` and `NaN` as `null` and would file them alongside items\n * whose key genuinely is null.\n */\nfunction key(value: unknown): string {\n const kind = typeof value;\n if (kind === \"string\") return value as string;\n if (kind === \"number\" || kind === \"boolean\") return String(value);\n // `JSON.stringify` answers `undefined` (not a string) for undefined and for a\n // function, so anything it cannot render is named rather than cast.\n return JSON.stringify(value) ?? String(value);\n}\n\n/**\n * The operations that are a chore to hand-roll everywhere else: grouping,\n * partitioning, keying, counting. Each returns a new value and never mutates.\n */\nexport const LIST_GROUPING: Record<string, Method> = {\n groupBy: (list: readonly unknown[], invoke: Invoke) =>\n nativeFn((args) => group(list, (item, i) => key(invoke.two(args[0], item, i)))),\n countBy: (list: readonly unknown[], invoke: Invoke) =>\n nativeFn((args) => counts(list, (item, i) => key(invoke.two(args[0], item, i)))),\n keyBy: (list: readonly unknown[], invoke: Invoke) =>\n nativeFn((args) => keyed(list, (item, i) => key(invoke.two(args[0], item, i)))),\n partition: (list: readonly unknown[], invoke: Invoke) =>\n nativeFn((args) => split(list, (item, i) => Boolean(invoke.two(args[0], item, i)))),\n chunk: (list: readonly unknown[]) => nativeFn((args) => chunk(list, Number(args[0] ?? 1))),\n windows: (list: readonly unknown[]) => nativeFn((args) => windows(list, Number(args[0] ?? 2))),\n pairwise: (list: readonly unknown[]) => windows(list, 2),\n zip: (list: readonly unknown[]) => nativeFn((args) => zip(list, asList(args[0]))),\n unzip: (list: readonly unknown[]) => unzip(list),\n};\n\nfunction group(list: readonly unknown[], keyOf: (item: unknown, i: number) => string): Dict {\n const out: Dict = {};\n list.forEach((item, index) => {\n const name = keyOf(item, index);\n out[name] = [...((out[name] as unknown[]) ?? []), item];\n });\n return out;\n}\n\nfunction counts(list: readonly unknown[], keyOf: (item: unknown, i: number) => string): Dict {\n const out: Dict = {};\n list.forEach((item, index) => {\n const name = keyOf(item, index);\n out[name] = Number(out[name] ?? 0) + 1;\n });\n return out;\n}\n\n/** Like `groupBy`, but the last item under a key wins: an index, not buckets. */\nfunction keyed(list: readonly unknown[], keyOf: (item: unknown, i: number) => string): Dict {\n const out: Dict = {};\n list.forEach((item, index) => {\n out[keyOf(item, index)] = item;\n });\n return out;\n}\n\nfunction split(list: readonly unknown[], keep: (item: unknown, i: number) => boolean): unknown[][] {\n const yes: unknown[] = [];\n const no: unknown[] = [];\n list.forEach((item, index) => {\n (keep(item, index) ? yes : no).push(item);\n });\n return [yes, no];\n}\n\nfunction chunk(list: readonly unknown[], size: number): unknown[][] {\n const step = Math.max(1, Math.trunc(size));\n const out: unknown[][] = [];\n for (let index = 0; index < list.length; index += step) out.push(list.slice(index, index + step));\n return out;\n}\n\n/** Every consecutive run of `size` items: `[1,2,3].windows(2)` gives `[[1,2],[2,3]]`. */\nfunction windows(list: readonly unknown[], size: number): unknown[][] {\n const width = Math.max(1, Math.trunc(size));\n const out: unknown[][] = [];\n for (let index = 0; index + width <= list.length; index += 1) {\n out.push(list.slice(index, index + width));\n }\n return out;\n}\n\nfunction zip(list: readonly unknown[], other: readonly unknown[]): unknown[][] {\n return list.slice(0, Math.min(list.length, other.length)).map((item, i) => [item, other[i]]);\n}\n\nfunction unzip(list: readonly unknown[]): unknown[][] {\n const pairs = list.map((item) => (Array.isArray(item) ? item : [item]));\n const width = pairs.reduce((most, pair) => Math.max(most, pair.length), 0);\n return Array.from({ length: width }, (_column, index) => pairs.map((pair) => pair[index]));\n}\n\nfunction asList(value: unknown): unknown[] {\n return Array.isArray(value) ? value : [];\n}\n","import { truthy } from \"../../value/index.js\";\nimport { type Invoke, type Method, nativeFn } from \"../native.types.js\";\n\n/** How `sort` orders when given no comparator: numbers by value, else by text. */\nfunction compare(a: unknown, b: unknown): number {\n if (typeof a === \"number\" && typeof b === \"number\") return a - b;\n return String(a) < String(b) ? -1 : String(a) > String(b) ? 1 : 0;\n}\n\nconst at = (list: readonly unknown[], index: number): unknown => list[index] ?? null;\n\n/** Methods on a list value. Every one is pure and returns a new value. */\nexport const LIST_METHODS: Record<string, Method> = {\n len: (list: readonly unknown[]) => list.length,\n first: (list: readonly unknown[]) => at(list, 0),\n last: (list: readonly unknown[]) => at(list, list.length - 1),\n map: (list: readonly unknown[], invoke: Invoke) =>\n nativeFn((args) => list.map((item, i) => invoke.two(args[0], item, i))),\n filter: (list: readonly unknown[], invoke: Invoke) =>\n nativeFn((args) => list.filter((item, i) => truthy(invoke.two(args[0], item, i)))),\n reduce: (list: readonly unknown[], invoke: Invoke) =>\n nativeFn((args) => list.reduce((acc, item, i) => invoke.three(args[0], acc, item, i), args[1])),\n forEach: (list: readonly unknown[], invoke: Invoke) =>\n nativeFn((args) => {\n list.forEach((item, i) => {\n invoke.two(args[0], item, i);\n });\n return null;\n }),\n find: (list: readonly unknown[], invoke: Invoke) =>\n nativeFn((args) => list.find((item, i) => truthy(invoke.two(args[0], item, i))) ?? null),\n some: (list: readonly unknown[], invoke: Invoke) =>\n nativeFn((args) => list.some((item, i) => truthy(invoke.two(args[0], item, i)))),\n every: (list: readonly unknown[], invoke: Invoke) =>\n nativeFn((args) => list.every((item, i) => truthy(invoke.two(args[0], item, i)))),\n contains: (list: readonly unknown[]) => nativeFn((args) => list.includes(args[0])),\n indexOf: (list: readonly unknown[]) => nativeFn((args) => list.indexOf(args[0])),\n reverse: (list: readonly unknown[]) => [...list].reverse(),\n flatten: (list: readonly unknown[]) => list.flat(),\n join: (list: readonly unknown[]) =>\n nativeFn((args) => list.map(String).join(args[0] === undefined ? \",\" : String(args[0]))),\n sort: (list: readonly unknown[], invoke: Invoke) =>\n nativeFn((args) =>\n args[0]\n ? [...list].sort((a, b) => Number(invoke.two(args[0], a, b)))\n : [...list].sort(compare),\n ),\n slice: (list: readonly unknown[]) =>\n nativeFn((args) => list.slice(Number(args[0] ?? 0), end(args[1]))),\n concat: (list: readonly unknown[]) =>\n nativeFn((args) => [...list, ...(Array.isArray(args[0]) ? args[0] : [args[0]])]),\n push: (list: readonly unknown[]) => nativeFn((args) => [...list, ...args]),\n};\n\nfunction end(value: unknown): number | undefined {\n return value === undefined ? undefined : Number(value);\n}\n","import { truthy } from \"../../value/index.js\";\nimport { type Invoke, type Method, nativeFn } from \"../native.types.js\";\n\nconst num = (value: unknown): number => Number(value);\n\n/** Selecting, ordering and summarising: the other half of everyday list work. */\nexport const LIST_SELECTION: Record<string, Method> = {\n take: (list: readonly unknown[]) => nativeFn((args) => list.slice(0, count(args[0]))),\n drop: (list: readonly unknown[]) => nativeFn((args) => list.slice(count(args[0]))),\n // Counted from the front, because `slice(-0)` is `slice(0)` and would hand\n // back the whole list when asked for none of it.\n takeLast: (list: readonly unknown[]) =>\n nativeFn((args) => list.slice(Math.max(0, list.length - count(args[0])))),\n dropLast: (list: readonly unknown[]) =>\n nativeFn((args) => list.slice(0, Math.max(0, list.length - count(args[0])))),\n takeWhile: (list: readonly unknown[], invoke: Invoke) =>\n nativeFn((args) => list.slice(0, edge(list, args[0], invoke))),\n dropWhile: (list: readonly unknown[], invoke: Invoke) =>\n nativeFn((args) => list.slice(edge(list, args[0], invoke))),\n distinct: (list: readonly unknown[]) => distinct(list, (item) => item),\n distinctBy: (list: readonly unknown[], invoke: Invoke) =>\n nativeFn((args) => distinct(list, (item, i) => invoke.two(args[0], item, i))),\n sortBy: (list: readonly unknown[], invoke: Invoke) =>\n nativeFn((args) => sortBy(list, (item, i) => invoke.two(args[0], item, i))),\n minBy: (list: readonly unknown[], invoke: Invoke) =>\n nativeFn((args) => best(list, (item, i) => num(invoke.two(args[0], item, i)), -1)),\n maxBy: (list: readonly unknown[], invoke: Invoke) =>\n nativeFn((args) => best(list, (item, i) => num(invoke.two(args[0], item, i)), 1)),\n sumBy: (list: readonly unknown[], invoke: Invoke) =>\n nativeFn((args) =>\n list.reduce((total: number, x, i) => total + num(invoke.two(args[0], x, i)), 0),\n ),\n flatMap: (list: readonly unknown[], invoke: Invoke) =>\n nativeFn((args) => list.flatMap((item, i) => flatten(invoke.two(args[0], item, i)))),\n sum: (list: readonly unknown[]) => list.reduce((total: number, x) => total + num(x), 0),\n average: (list: readonly unknown[]) =>\n list.length === 0 ? 0 : list.reduce((total: number, x) => total + num(x), 0) / list.length,\n // Folded rather than spread: `Math.min(...list)` passes every element as an\n // argument, and a list of a few hundred thousand overflows the call stack.\n min: (list: readonly unknown[]) => extreme(list, -1),\n max: (list: readonly unknown[]) => extreme(list, 1),\n /** The inverse of a map's `entries`: `[[\"a\", 1]].toMap` gives `{ a: 1 }`. */\n toMap: (list: readonly unknown[]) => toMap(list),\n isEmpty: (list: readonly unknown[]) => list.length === 0,\n};\n\nfunction toMap(list: readonly unknown[]): Record<string, unknown> {\n const out: Record<string, unknown> = {};\n for (const entry of list) {\n const pair = Array.isArray(entry) ? entry : [];\n if (pair.length > 0) out[String(pair[0])] = pair[1];\n }\n return out;\n}\n\nfunction count(value: unknown): number {\n return Math.max(0, Math.trunc(Number(value ?? 0)));\n}\n\n/** The smallest or largest number in a list, or null when there is none. */\nfunction extreme(list: readonly unknown[], direction: 1 | -1): number | null {\n if (list.length === 0) return null;\n let best = num(list[0]);\n for (let at = 1; at < list.length; at += 1) {\n const value = num(list[at]);\n if (Number.isNaN(value)) return Number.NaN;\n if (value * direction > best * direction) best = value;\n }\n return best;\n}\n\n/** Where the run of items satisfying the predicate ends. */\nfunction edge(list: readonly unknown[], fn: unknown, invoke: Invoke): number {\n let index = 0;\n while (index < list.length && truthy(invoke.two(fn, list[index], index))) index += 1;\n return index;\n}\n\nfunction distinct(\n list: readonly unknown[],\n keyOf: (item: unknown, i: number) => unknown,\n): unknown[] {\n const seen = new Set<string>();\n const out: unknown[] = [];\n list.forEach((item, index) => {\n const key = JSON.stringify(keyOf(item, index)) ?? \"\";\n if (seen.has(key)) return;\n seen.add(key);\n out.push(item);\n });\n return out;\n}\n\n/**\n * Sort by a derived key, ordering positions rather than the items themselves.\n *\n * The keys go in one array and the positions in another, so the sort moves\n * numbers and nothing is allocated per item. It stays stable, which is what\n * leaves items whose keys tie in the order they came.\n */\nfunction sortBy(list: readonly unknown[], keyOf: (item: unknown, i: number) => unknown): unknown[] {\n const size = list.length;\n const keys = new Array<unknown>(size);\n const order = new Array<number>(size);\n for (let at = 0; at < size; at += 1) {\n keys[at] = keyOf(list[at], at);\n order[at] = at;\n }\n order.sort((left, right) => compare(keys[left], keys[right]));\n const out = new Array<unknown>(size);\n for (let at = 0; at < size; at += 1) out[at] = list[order[at] as number];\n return out;\n}\n\n/** Numbers compare as numbers; anything else compares as its text. */\nfunction compare(left: unknown, right: unknown): number {\n if (typeof left === \"number\" && typeof right === \"number\") return left - right;\n const a = String(left);\n const b = String(right);\n return a < b ? -1 : a > b ? 1 : 0;\n}\n\nfunction best(\n list: readonly unknown[],\n scoreOf: (item: unknown, i: number) => number,\n direction: number,\n): unknown {\n let winner: unknown = null;\n let score = Number.NaN;\n list.forEach((item, index) => {\n const value = scoreOf(item, index);\n if (Number.isNaN(score) || (value - score) * direction > 0) {\n winner = item;\n score = value;\n }\n });\n return winner;\n}\n\nfunction flatten(value: unknown): unknown[] {\n return Array.isArray(value) ? value : [value];\n}\n","import { type Invoke, type Method, nativeFn } from \"../native.types.js\";\n\ntype Dict = Record<string, unknown>;\n\n/** Reshaping a map without a loop: rename, project, combine, walk a path. */\nexport const MAP_EXTRAS: Record<string, Method> = {\n mapValues: (map: Dict, invoke: Invoke) =>\n nativeFn((args) => rebuild(map, ([k, v]) => [k, invoke.two(args[0], v, k)])),\n mapKeys: (map: Dict, invoke: Invoke) =>\n nativeFn((args) => rebuild(map, ([k, v]) => [String(invoke.two(args[0], k, v)), v])),\n filterValues: (map: Dict, invoke: Invoke) =>\n nativeFn((args) => keepIf(map, ([k, v]) => Boolean(invoke.two(args[0], v, k)))),\n pick: (map: Dict) => nativeFn((args) => keepIf(map, ([k]) => names(args).includes(k))),\n omit: (map: Dict) => nativeFn((args) => keepIf(map, ([k]) => !names(args).includes(k))),\n mergeDeep: (map: Dict) => nativeFn((args) => mergeDeep(map, asDict(args[0]))),\n invert: (map: Dict) => rebuild(map, ([k, v]) => [String(v), k]),\n isEmpty: (map: Dict) => Object.keys(map).length === 0,\n /** `getPath(\"a.b.c\")` reaches into nested data without a chain of guards. */\n getPath: (map: Dict) => nativeFn((args) => walk(map, String(args[0] ?? \"\"))),\n /** Whether the path leads anywhere, including to a field holding `null`. */\n hasPath: (map: Dict) => nativeFn((args) => reach(map, String(args[0] ?? \"\")) !== ABSENT),\n};\n\n/** The inverse of `entries`: `fromEntries([[\"a\", 1]])` gives `{ a: 1 }`. */\nexport function fromEntries(list: readonly unknown[]): Dict {\n const out: Dict = {};\n for (const entry of list) {\n const pair = Array.isArray(entry) ? entry : [];\n if (pair.length > 0) out[String(pair[0])] = pair[1];\n }\n return out;\n}\n\nfunction rebuild(map: Dict, step: (entry: [string, unknown]) => [string, unknown]): Dict {\n return Object.fromEntries(Object.entries(map).map(step));\n}\n\nfunction keepIf(map: Dict, keep: (entry: [string, unknown]) => boolean): Dict {\n return Object.fromEntries(Object.entries(map).filter(keep));\n}\n\n/** Flatten the argument list: `pick(\"a\", \"b\")` and `pick([\"a\", \"b\"])` both work. */\nfunction names(args: readonly unknown[]): string[] {\n return args.flatMap((arg) => (Array.isArray(arg) ? arg : [arg])).map(String);\n}\n\nfunction mergeDeep(left: Dict, right: Dict): Dict {\n const out: Dict = { ...left };\n for (const [key, value] of Object.entries(right)) {\n const current = out[key];\n out[key] = isDict(current) && isDict(value) ? mergeDeep(current, value) : value;\n }\n return out;\n}\n\n/** Nothing at all is here, told apart from a field that holds nothing. */\nconst ABSENT = Symbol(\"venn.absent\");\n\n/**\n * Follow a dotted path, answering {@link ABSENT} when it leads nowhere.\n *\n * A field holding `null` and a field that does not exist are different facts,\n * and collapsing them made `hasPath` answer `false` for a key that was plainly\n * there.\n */\nfunction reach(map: Dict, path: string): unknown {\n let current: unknown = map;\n for (const part of path.split(\".\")) {\n if (!isDict(current) && !Array.isArray(current)) return ABSENT;\n if (!Object.hasOwn(current as Dict, part)) return ABSENT;\n current = (current as Dict)[part];\n }\n return current;\n}\n\nfunction walk(map: Dict, path: string): unknown {\n const found = reach(map, path);\n return found === ABSENT ? null : (found ?? null);\n}\n\nfunction isDict(value: unknown): value is Dict {\n return value !== null && typeof value === \"object\" && !Array.isArray(value);\n}\n\nfunction asDict(value: unknown): Dict {\n return isDict(value) ? value : {};\n}\n","import { type Method, nativeFn } from \"../native.types.js\";\n\ntype Dict = Record<string, unknown>;\n\n/**\n * Methods on a map value. Checked only after a data property of the same name,\n * so a map with a key called `keys` still reads that key.\n */\nexport const MAP_METHODS: Record<string, Method> = {\n keys: (map: Dict) => Object.keys(map),\n values: (map: Dict) => Object.values(map),\n entries: (map: Dict) => Object.entries(map).map(([key, value]) => [key, value]),\n has: (map: Dict) => nativeFn((args) => String(args[0]) in map),\n get: (map: Dict) => nativeFn((args) => map[String(args[0])] ?? null),\n len: (map: Dict) => Object.keys(map).length,\n merge: (map: Dict) => nativeFn((args) => ({ ...map, ...(args[0] as Dict) })),\n};\n","import { type Method, nativeFn } from \"../native.types.js\";\n\n/** Methods on a number. Rounding and clamping without reaching for a namespace. */\nexport const NUMBER_METHODS: Record<string, Method> = {\n abs: (value: number) => Math.abs(value),\n floor: (value: number) => Math.floor(value),\n ceil: (value: number) => Math.ceil(value),\n sign: (value: number) => Math.sign(value),\n sqrt: (value: number) => Math.sqrt(value),\n isEven: (value: number) => value % 2 === 0,\n isOdd: (value: number) => Math.abs(value % 2) === 1,\n round: (value: number) => nativeFn((args) => roundTo(value, Number(args[0] ?? 0))),\n toFixed: (value: number) => nativeFn((args) => value.toFixed(places(args[0]))),\n clamp: (value: number) =>\n nativeFn((args) => Math.min(Math.max(value, Number(args[0])), Number(args[1]))),\n pow: (value: number) => nativeFn((args) => value ** Number(args[0])),\n times: (value: number) => Array.from({ length: Math.max(0, Math.trunc(value)) }, (_x, i) => i),\n toString: (value: number) => String(value),\n};\n\nfunction roundTo(value: number, decimals: number): number {\n const scale = 10 ** places(decimals);\n return Math.round(value * scale) / scale;\n}\n\nfunction places(value: unknown): number {\n const parsed = Math.trunc(Number(value ?? 0));\n return Number.isNaN(parsed) ? 0 : Math.min(20, Math.max(0, parsed));\n}\n","import { type Method, nativeFn } from \"../native.types.js\";\n\nconst COMBINING = /[\\u0300-\\u036f]/g;\n\n/** Text handling a script actually needs: words, lines, casing, slugs, matching. */\nexport const STRING_EXTRAS: Record<string, Method> = {\n words: (text: string) => text.split(/\\s+/).filter(Boolean),\n lines: (text: string) => text.split(/\\r?\\n/),\n chars: (text: string) => [...text],\n capitalize: (text: string) => text.charAt(0).toUpperCase() + text.slice(1),\n title: (text: string) => text.replace(/\\S+/g, capitalizeWord),\n slugify: (text: string) => slugify(text),\n isEmpty: (text: string) => text.length === 0,\n isBlank: (text: string) => text.trim().length === 0,\n trimStart: (text: string) => text.trimStart(),\n trimEnd: (text: string) => text.trimEnd(),\n count: (text: string) => nativeFn((args) => occurrences(text, String(args[0] ?? \"\"))),\n matches: (text: string) => nativeFn((args) => matches(text, String(args[0] ?? \"\"))),\n test: (text: string) => nativeFn((args) => regex(String(args[0] ?? \"\"))?.test(text) ?? false),\n before: (text: string) => nativeFn((args) => cut(text, String(args[0] ?? \"\"), true)),\n after: (text: string) => nativeFn((args) => cut(text, String(args[0] ?? \"\"), false)),\n ensureStart: (text: string) => nativeFn((args) => prefixed(text, String(args[0] ?? \"\"))),\n ensureEnd: (text: string) => nativeFn((args) => suffixed(text, String(args[0] ?? \"\"))),\n};\n\nfunction capitalizeWord(word: string): string {\n return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();\n}\n\n/** `\"João Gonçalves\"` becomes `\"joao-goncalves\"`: ASCII-safe, url-ready. */\nfunction slugify(text: string): string {\n const plain = text.normalize(\"NFD\").replace(COMBINING, \"\").toLowerCase();\n return plain.replace(/[^a-z0-9]+/g, \"-\").replace(/^-+|-+$/g, \"\");\n}\n\nfunction occurrences(text: string, needle: string): number {\n return needle === \"\" ? 0 : text.split(needle).length - 1;\n}\n\n/** Every match of a pattern, as a list of strings. An invalid pattern matches nothing. */\nfunction matches(text: string, pattern: string): string[] {\n const expression = regex(pattern, \"g\");\n return expression ? [...text.matchAll(expression)].map((match) => match[0]) : [];\n}\n\nfunction regex(pattern: string, flags = \"\"): RegExp | undefined {\n try {\n return new RegExp(pattern, flags);\n } catch {\n return undefined;\n }\n}\n\nfunction cut(text: string, marker: string, keepHead: boolean): string {\n const at = text.indexOf(marker);\n if (at < 0) return keepHead ? text : \"\";\n return keepHead ? text.slice(0, at) : text.slice(at + marker.length);\n}\n\nfunction prefixed(text: string, prefix: string): string {\n return text.startsWith(prefix) ? text : `${prefix}${text}`;\n}\n\nfunction suffixed(text: string, suffix: string): string {\n return text.endsWith(suffix) ? text : `${text}${suffix}`;\n}\n","import { type Method, nativeFn } from \"../native.types.js\";\n\nfunction end(value: unknown): number | undefined {\n return value === undefined ? undefined : Number(value);\n}\n\n/**\n * Members of a string value. A no-argument transform is a property, read\n * without parentheses (`name.upper`); anything taking an argument is a method\n * (`name.split(\",\")`). `replace` replaces every occurrence.\n */\nexport const STRING_METHODS: Record<string, Method> = {\n len: (text: string) => text.length,\n upper: (text: string) => text.toUpperCase(),\n lower: (text: string) => text.toLowerCase(),\n trim: (text: string) => text.trim(),\n reverse: (text: string) => [...text].reverse().join(\"\"),\n toNumber: (text: string) => Number(text),\n split: (text: string) => nativeFn((args) => text.split(String(args[0] ?? \"\"))),\n replace: (text: string) =>\n nativeFn((args) => text.split(String(args[0])).join(String(args[1] ?? \"\"))),\n contains: (text: string) => nativeFn((args) => text.includes(String(args[0]))),\n startsWith: (text: string) => nativeFn((args) => text.startsWith(String(args[0]))),\n endsWith: (text: string) => nativeFn((args) => text.endsWith(String(args[0]))),\n slice: (text: string) => nativeFn((args) => text.slice(Number(args[0] ?? 0), end(args[1]))),\n repeat: (text: string) => nativeFn((args) => text.repeat(Math.max(0, Number(args[0] ?? 0)))),\n padStart: (text: string) =>\n nativeFn((args) => text.padStart(Number(args[0] ?? 0), String(args[1] ?? \" \"))),\n padEnd: (text: string) =>\n nativeFn((args) => text.padEnd(Number(args[0] ?? 0), String(args[1] ?? \" \"))),\n indexOf: (text: string) => nativeFn((args) => text.indexOf(String(args[0]))),\n};\n","import type { Duration, Percent, Size } from \"../../units/index.js\";\nimport { type Method, nativeFn } from \"../native.types.js\";\n\n/**\n * Reading a unit back as a plain number, in whichever unit you want it.\n *\n * A `duration` knows it is a duration; what it does not know is whether you\n * want to print milliseconds or minutes. These are the way across, and they all\n * land on `number`, the unit having served its purpose by then.\n */\nexport const DURATION_METHODS: Record<string, Method> = {\n ms: (value: Duration) => value.ms,\n seconds: (value: Duration) => value.ms / 1000,\n minutes: (value: Duration) => value.ms / 60000,\n hours: (value: Duration) => value.ms / 3600000,\n};\n\nexport const SIZE_METHODS: Record<string, Method> = {\n bytes: (value: Size) => value.bytes,\n kb: (value: Size) => value.bytes / 1024,\n mb: (value: Size) => value.bytes / 1048576,\n gb: (value: Size) => value.bytes / 1073741824,\n};\n\nexport const PERCENT_METHODS: Record<string, Method> = {\n ratio: (value: Percent) => value.ratio,\n percent: (value: Percent) => value.ratio * 100,\n // `12%.of(50)` is 6: the share of something, which is what a percent is for.\n of: (value: Percent) => nativeFn((args) => Number(args[0]) * value.ratio),\n};\n\n/**\n * Reading a plain number *as* a unit: the way back.\n *\n * Symmetric with the tables above. `2mb.kb` writes a size out as 2048 and\n * `2048.toKb` reads 2048 back as that size, so for every `X` a unit answers to,\n * a number answers to `toX`.\n */\nexport const NUMBER_TO_UNIT: Record<string, Method> = {\n toMs: (value: number) => duration(value),\n toSeconds: (value: number) => duration(value * 1000),\n toMinutes: (value: number) => duration(value * 60000),\n toHours: (value: number) => duration(value * 3600000),\n toBytes: (value: number) => size(value),\n toKb: (value: number) => size(value * 1024),\n toMb: (value: number) => size(value * 1048576),\n toGb: (value: number) => size(value * 1073741824),\n toRatio: (value: number) => percent(value),\n toPercent: (value: number) => percent(value / 100),\n};\n\nconst duration = (ms: number): Duration => ({ kind: \"duration\", ms });\nconst size = (bytes: number): Size => ({ kind: \"size\", bytes });\nconst percent = (ratio: number): Percent => ({ kind: \"percent\", ratio });\n","import type { Invoke } from \"../native.types.js\";\nimport { isTask, TASK_METHODS } from \"../task.js\";\nimport { LIST_GROUPING } from \"./list-grouping.js\";\nimport { LIST_METHODS } from \"./list-methods.js\";\nimport { LIST_SELECTION } from \"./list-selection.js\";\nimport { MAP_EXTRAS } from \"./map-extras.js\";\nimport { MAP_METHODS } from \"./map-methods.js\";\nimport { NUMBER_METHODS } from \"./number-methods.js\";\nimport { STRING_EXTRAS } from \"./string-extras.js\";\nimport { STRING_METHODS } from \"./string-methods.js\";\nimport { DURATION_METHODS, NUMBER_TO_UNIT, PERCENT_METHODS, SIZE_METHODS } from \"./unit-methods.js\";\n\n/** Distinguishes \"no such method\" from a method that legitimately returns undefined. */\nexport const NO_METHOD = Symbol(\"venn.no-method\");\n\nconst LIST_TABLE = { ...LIST_METHODS, ...LIST_SELECTION, ...LIST_GROUPING };\nconst STRING_TABLE = { ...STRING_METHODS, ...STRING_EXTRAS };\nconst MAP_TABLE = { ...MAP_METHODS, ...MAP_EXTRAS };\nconst NUMBER_TABLE = { ...NUMBER_METHODS, ...NUMBER_TO_UNIT };\n\n/** Every member name a value of this kind answers to. Read by the editor. */\nexport const MEMBER_NAMES: Readonly<Record<string, readonly string[]>> = {\n list: Object.keys(LIST_TABLE),\n string: Object.keys(STRING_TABLE),\n map: Object.keys(MAP_TABLE),\n number: Object.keys(NUMBER_TABLE),\n task: Object.keys(TASK_METHODS),\n duration: Object.keys(DURATION_METHODS),\n size: Object.keys(SIZE_METHODS),\n percent: Object.keys(PERCENT_METHODS),\n};\n\n/**\n * The built-in member of a native value: a property like `length` or a callable\n * like `map`. `NO_METHOD` when the type has no such member, so the caller can\n * fall back to a map's own data.\n */\nexport function builtinMember(receiver: unknown, member: string, invoke: Invoke): unknown {\n const table = tableFor(receiver);\n // These tables are ordinary objects, so a plain lookup would also reach what\n // every object inherits: `x.toString` would find `Object.prototype.toString`\n // and answer for a member the language never had. Only what a table declares\n // is a member.\n if (!table || !Object.hasOwn(table, member)) return NO_METHOD;\n const method = table[member];\n if (!method) return NO_METHOD;\n return (method as (r: unknown, i: Invoke) => unknown)(receiver, invoke);\n}\n\nconst UNIT_TABLES: Record<string, Record<string, unknown>> = {\n duration: DURATION_METHODS,\n size: SIZE_METHODS,\n percent: PERCENT_METHODS,\n};\n\nfunction tableFor(receiver: unknown): Record<string, unknown> | undefined {\n if (typeof receiver === \"string\") return STRING_TABLE;\n if (typeof receiver === \"number\") return NUMBER_TABLE;\n if (Array.isArray(receiver)) return LIST_TABLE;\n if (receiver === null || typeof receiver !== \"object\") return undefined;\n if (isTask(receiver)) return TASK_METHODS;\n // A unit value carries its kind, and its methods are the way back to a number.\n const kind = (receiver as { kind?: unknown }).kind;\n return (typeof kind === \"string\" ? UNIT_TABLES[kind] : undefined) ?? MAP_TABLE;\n}\n","import { isUnitValue } from \"../units/index.js\";\nimport { INVOKE } from \"./invoke.js\";\nimport { builtinMember, NO_METHOD } from \"./methods/index.js\";\nimport { nativeFn } from \"./native.types.js\";\nimport { isWaiting } from \"./pending.js\";\nimport { isTask } from \"./task.js\";\n\n/**\n * One member of a value: `xs.len`, `m.user`, `target.wrap`.\n *\n * A map's own data wins; a list or a string only ever has built-in members.\n * Lives here rather than in the compiler because the compiler is not the only\n * reader: a decorator body reaches a handle's verbs by the same rule, and two\n * spellings of \"what does `.x` mean\" would drift apart.\n *\n * @returns The member's value, undefined when there is none, or a promise when\n * the receiver has not arrived yet.\n */\nexport function memberValue(receiver: unknown, member: string): unknown {\n if (isWaiting(receiver)) return receiver.then((ready) => memberValue(ready, member));\n // A unit is not a map. Reading it as one would expose how it is stored, with\n // `300ms.kind` answering \"duration\", and shadow its own conversions.\n if (isData(receiver) && Object.hasOwn(receiver as object, member)) {\n const data = own(receiver, member);\n if (data !== undefined) return data;\n }\n const built = builtinMember(receiver, member, INVOKE);\n if (built !== NO_METHOD) return built;\n return isOwned(receiver) ? undefined : own(receiver, member);\n}\n\n/**\n * Whether the language, not the host, decides what this value answers to.\n *\n * A list and a string are the language's own, with a published member set and a\n * checker that knows it, so they must never fall through to the host: nothing\n * the runtime happens to store them as is offered by the editor or checked, and\n * it would stop working the day either value is held differently. A plugin's\n * handle is the opposite case, being a host object whose published verbs are\n * exactly what it answers to.\n */\nconst OWNED = new Set([\"string\", \"number\", \"boolean\", \"bigint\"]);\n\nfunction isOwned(receiver: unknown): boolean {\n return (\n receiver == null ||\n OWNED.has(typeof receiver) ||\n Array.isArray(receiver) ||\n isUnitValue(receiver) ||\n isTask(receiver) ||\n isPlainMap(receiver)\n );\n}\n\n/**\n * A map the language made, as against an object a plugin handed over.\n *\n * Both are objects, so the line is drawn where it can be: a map literal\n * inherits from nothing but `Object`, while a handle is built by the host and\n * carries its verbs on its own prototype. Only what a map itself holds is its\n * data; what every object in the runtime inherits is not.\n */\nfunction isPlainMap(receiver: unknown): boolean {\n if (typeof receiver !== \"object\" || receiver === null) return false;\n const proto = Object.getPrototypeOf(receiver);\n return proto === Object.prototype || proto === null;\n}\n\n/**\n * A property of a host value, callable if it is a method.\n *\n * This is the boundary a plugin's handle crosses to become a value in the\n * language. The wrapping is required: a bare host function is not a Venn\n * callable, and the receiver has to be bound or `api.close()` loses its `this`.\n */\nfunction own(receiver: unknown, member: string): unknown {\n const value = (receiver as Record<string, unknown>)[member];\n if (typeof value !== \"function\") return value;\n const method = value as (...args: unknown[]) => unknown;\n return nativeFn((values) => method.apply(receiver, [...values]));\n}\n\nfunction isData(receiver: unknown): boolean {\n return (\n receiver !== null &&\n typeof receiver === \"object\" &&\n !Array.isArray(receiver) &&\n !isUnitValue(receiver) &&\n !isTask(receiver)\n );\n}\n","import { memberValue } from \"../../expr/member-value.js\";\nimport { isWaiting, whenBothReady } from \"../../expr/pending.js\";\nimport type { Index, Member } from \"../../generated/ast.js\";\nimport type { Compile, Thunk } from \"../compile.types.js\";\n\n/** `x.member`, with the member name fixed by the source. */\nexport function compileMember(expr: Member, compile: Compile): Thunk {\n const receiver = compile(expr.receiver);\n const member = expr.member;\n return (env) => memberValue(receiver(env), member);\n}\n\n/**\n * `xs[i]`, reading straight through when neither side is still arriving.\n *\n * Indexing `null` gives undefined rather than throwing, so a missing path along\n * a chain reads as absent instead of stopping the flow.\n */\nexport function compileIndex(expr: Index, compile: Compile): Thunk {\n const receiver = compile(expr.receiver);\n const key = compile(expr.index);\n return (env) => {\n const target = receiver(env);\n const at = key(env);\n if (!isWaiting(target) && !isWaiting(at)) return elementAt(target, at);\n return whenBothReady(target, at, elementAt);\n };\n}\n\nfunction elementAt(target: unknown, at: unknown): unknown {\n return target == null ? undefined : (target as Record<string, unknown>)[at as string];\n}\n","/**\n * Expression compilation: a tree becomes a function of the environment.\n *\n * A program's tree is fixed once parsed, so every decision the source settles\n * (which operator, which literal value, which slot a name lives in, how a\n * string splits around its placeholders) is made once here instead of on every\n * visit.\n */\n\nimport type { Cell } from \"../expr/cell.types.js\";\nimport type { Closure } from \"../expr/closure.types.js\";\nimport type { EvalEnv } from \"../expr/eval-env.types.js\";\nimport type { Frame } from \"../expr/frame.js\";\nimport type { Expr, FnDecl } from \"../generated/ast.js\";\nimport type { Compile, Thunk } from \"./compile.types.js\";\nimport { freeSlot, type LexScope, rootScope } from \"./lex-scope.js\";\nimport {\n closureIn,\n compileBinary,\n compileCall,\n compileFnExpr,\n compileIndex,\n compileInstant,\n compileList,\n compileMap,\n compileMember,\n compileNumber,\n compileString,\n compileTernary,\n compileUnary,\n constant,\n constThunk,\n} from \"./nodes/index.js\";\n\nconst ROOT = rootScope();\n\n/**\n * Compile an expression into a function of the environment.\n *\n * Memoised per node, so asking twice for the same expression hands back the\n * same thunk.\n *\n * @returns A thunk: give it an environment and it produces the value.\n */\nexport function compileExpr(expr: Expr): Thunk {\n return compileIn(expr, ROOT);\n}\n\n/**\n * Build the function value for a top-level `fn name(…)`.\n *\n * The body is compiled against `env`, which is what lets a recursive\n * declaration reach its own name: the cell is handed out before the binding\n * that fills it exists.\n *\n * @returns The closure, ready to be bound under the declaration's name.\n */\nexport function closureOfDecl(decl: FnDecl, env: EvalEnv): Closure {\n return closureIn(decl, env, compileIn);\n}\n\nfunction compileIn(expr: Expr, scope: LexScope): Thunk {\n const known = scope.cache.get(expr);\n if (known) return known;\n const thunk = dispatch(expr, scope);\n scope.cache.set(expr, thunk);\n return thunk;\n}\n\nconst NOTHING: Thunk = () => undefined;\n\nfunction dispatch(expr: Expr, scope: LexScope): Thunk {\n switch (expr.$type) {\n case \"NumberLit\":\n return compileNumber(expr);\n case \"StringLit\":\n // A placeholder compiles in the scope that holds it, so `\"${i}\"` inside a\n // function reads `i` as that function's slot rather than asking for it by\n // name. Its parsed expression is shared by every literal with the same\n // text, which is safe only because the compiled form is cached per scope:\n // two scopes reach the same node and each keeps its own thunk for it.\n return compileString(expr, (inner) => compileIn(inner, scope));\n case \"InstantLit\":\n return compileInstant(expr);\n case \"BoolLit\":\n return constant(expr.value === \"true\");\n case \"NullLit\":\n return constant(null);\n case \"Ref\":\n return compileRef(expr.name, scope);\n case \"FnExpr\":\n // A function made here captures this environment to reach the names\n // around it, so there has to be one for it to capture.\n scope.dynamic = true;\n return compileFnExpr(expr, compileIn);\n default:\n return operation(expr, (inner) => compileIn(inner, scope));\n }\n}\n\nfunction operation(expr: Expr, compile: Compile): Thunk {\n switch (expr.$type) {\n case \"Member\":\n return compileMember(expr, compile);\n case \"FnExpr\":\n return compileFnExpr(expr, compileIn);\n case \"Call\":\n return compileCall(expr, compile);\n case \"Index\":\n return compileIndex(expr, compile);\n case \"Binary\":\n return compileBinary(expr, compile);\n case \"Unary\":\n return compileUnary(expr, compile);\n case \"Ternary\":\n return compileTernary(expr, compile);\n case \"ListLit\":\n return compileList(expr, compile);\n case \"MapLit\":\n return compileMap(expr, compile);\n default:\n // Not a node the grammar can produce: the only one left is the value a\n // decorator's `.setValue` put here.\n return constThunk(expr) ?? NOTHING;\n }\n}\n\n/**\n * Compile a name into the cheapest read available.\n *\n * A name the enclosing function binds is an index into the frame. Anything else\n * (a top-level binding, a namespace, the prelude) is a cell the closure\n * resolved when it was built, which is an index too.\n *\n * The lookup fallback stays for environments that hand out no cells: a function\n * nested inside another reads its parent's frame, and an expression compiled at\n * the root has no closure at all.\n */\nfunction compileRef(name: string, scope: LexScope): Thunk {\n const slot = scope.names.indexOf(name);\n // The one name a bare body binds is the value it was handed, unwrapped.\n if (slot === 0 && scope.bare) return (env) => env;\n if (slot !== -1) return slotThunk(slot);\n // One closure owns this body, so the cell can be held right here: no frame to\n // carry it, and no chain to walk.\n const own = scope.cellOf?.(name);\n if (own) return () => own.value;\n const up = freeSlot(scope, name);\n if (up === undefined) return (env) => env.lookup(name);\n return (env) => {\n const cells = (env as Frame).up;\n return cells === undefined ? env.lookup(name) : (cells[up] as Cell).value;\n };\n}\n\n/**\n * Reading one slot, written for the slot it reads.\n *\n * The first three are fields of the frame, so each gets a thunk naming that\n * field outright: one property load, and the same one every time this thunk\n * runs, which is what lets V8 settle the site.\n */\nfunction slotThunk(slot: number): Thunk {\n if (slot === 0) return (env) => (env as Frame).s0;\n if (slot === 1) return (env) => (env as Frame).s1;\n if (slot === 2) return (env) => (env as Frame).s2;\n const at = slot - 3;\n return (env) => ((env as Frame).rest as unknown[])[at];\n}\n","import type { AstNode } from \"langium\";\nimport type { TargetKind } from \"./handle.types.js\";\n\n/** Every kind a `deco` may name, in the order a diagnostic should list them. */\nexport const TARGET_KINDS: readonly TargetKind[] = [\n \"Fn\",\n \"Flow\",\n \"Step\",\n \"Binding\",\n \"Type\",\n \"Node\",\n];\n\n/**\n * The only place the two vocabularies meet.\n *\n * `Node` is absent on purpose: it is not one node type, it is the absence of a\n * restriction, so it maps to no `$type` and to every one.\n */\nconst BY_TYPE: Readonly<Record<string, TargetKind>> = {\n FnDecl: \"Fn\",\n FlowDecl: \"Flow\",\n StepDecl: \"Step\",\n LetStmt: \"Binding\",\n TypeDecl: \"Type\",\n};\n\n/** What kind of thing a node is, in the language's own words. */\nexport function kindOf(node: AstNode): TargetKind {\n return BY_TYPE[node.$type] ?? \"Node\";\n}\n\n/** Whether a written type name is one of the kinds. */\nexport function isTargetKind(name: string): name is TargetKind {\n return (TARGET_KINDS as readonly string[]).includes(name);\n}\n","import { compileExpr } from \"../compile/index.js\";\nimport type { Expr } from \"../generated/ast.js\";\nimport type { EvalEnv } from \"./eval-env.types.js\";\n\n/**\n * Evaluate a kernel expression against an injected environment.\n *\n * Compilation happens once per node and is remembered, so calling this in a\n * loop pays for the tree only on the first pass.\n *\n * @returns The value, or a promise for it when the expression reached something\n * that has not arrived yet.\n * @throws ProblemError When the expression fails: a unit mismatch, a value that\n * is not callable, or a placeholder that does not parse.\n */\nexport function evaluate(expr: Expr, env: EvalEnv): unknown {\n return compileExpr(expr)(env);\n}\n","const NAMESPACE = Symbol(\"venn.namespace\");\n\n/**\n * A plugin namespace as a value (`fmt`, `data`, `crypto`), so its verbs can be\n * called from any expression: `print(fmt.table(rows))`.\n *\n * Marked, because a name the user binds must still win over a namespace of the\n * same name, and a bare `data.faker.uuid` must still read as a call rather than\n * as the function itself.\n */\nexport function namespaceValue(members: Record<string, unknown>): Record<string, unknown> {\n return Object.assign(Object.create(null) as Record<string, unknown>, members, {\n [NAMESPACE]: true,\n });\n}\n\n/** Whether this value is a namespace rather than an ordinary map. */\nexport function isNamespaceValue(value: unknown): boolean {\n return typeof value === \"object\" && value !== null && NAMESPACE in value;\n}\n","import { isClosure } from \"./closure.js\";\nimport { invoke } from \"./invoke.js\";\nimport { isNativeFn, nativeFn } from \"./native.types.js\";\nimport { startTask } from \"./task.js\";\n\n/**\n * Render a value the way `print` and `str` do: a string as itself, anything\n * else as JSON. A value JSON cannot hold falls back to its plain text rather\n * than throwing, because printing must never be the thing that fails a flow.\n */\nexport function display(value: unknown): string {\n if (typeof value === \"string\") return value;\n if (value === null || value === undefined) return String(value);\n if (typeof value !== \"object\") return String(value);\n try {\n return JSON.stringify(value);\n } catch {\n return String(value);\n }\n}\n\n/**\n * The name of a value's type, as the language talks about it: \"null\", \"list\",\n * \"fn\", \"map\", \"bool\", \"string\", \"number\", or a unit's own kind.\n */\nexport function typeName(value: unknown): string {\n if (value === null || value === undefined) return \"null\";\n if (Array.isArray(value)) return \"list\";\n if (isClosure(value) || isNativeFn(value)) return \"fn\";\n const kind = (value as { kind?: unknown }).kind;\n if (typeof value === \"object\" && typeof kind === \"string\") return kind;\n if (typeof value === \"object\") return \"map\";\n return typeof value === \"boolean\" ? \"bool\" : typeof value;\n}\n\n/** `range(3)` → [0,1,2]; `range(1, 4)` → [1,2,3]; `range(0, 10, 2)` → [0,2,4,6,8]. */\nfunction range(args: readonly unknown[]): number[] {\n const [a, b, c] = args.map(Number);\n const from = args.length > 1 ? (a ?? 0) : 0;\n const to = args.length > 1 ? (b ?? 0) : (a ?? 0);\n const step = c && c !== 0 ? c : from <= to ? 1 : -1;\n const out: number[] = [];\n for (let n = from; step > 0 ? n < to : n > to; n += step) out.push(n);\n return out;\n}\n\n/**\n * The whole prelude of values: what has no receiver to hang off.\n *\n * `len(xs)`, `sum(xs)`, `keys(m)` and `round(x, 2)` are deliberately absent:\n * they read better as `xs.len`, `xs.sum`, `m.keys` and `x.round(2)`, and a\n * second spelling would only be a second way to say the same thing. Those names\n * are also exactly the ones a script wants to bind (`const sum = …`), and a\n * binding would silently shadow them.\n */\nexport const PRELUDE_VALUES: Readonly<Record<string, unknown>> = {\n // Builds a list out of nothing: there is no receiver to ask.\n range: nativeFn(range),\n // Works on `null`, which can carry no method of its own.\n str: nativeFn((args) => args.map(display).join(\" \")),\n typeOf: nativeFn((args) => typeName(args[0])),\n // `fmt.json(x, 2)` without the import: the everyday \"show me this\".\n pretty: nativeFn((args) => prettyJson(args[0])),\n // Start work without stopping for it. Everything else waits by itself, so\n // this is the only way to say \"carry on\"; `.wait` asks for it back.\n spawn: nativeFn((args) => startTask(() => invoke(args[0], []))),\n};\n\nfunction prettyJson(value: unknown): string {\n try {\n return JSON.stringify(value, null, 2) ?? String(value);\n } catch {\n return String(value);\n }\n}\n","import type { NodeMeta } from \"./expand.types.js\";\n\n/** Where a decorator's leavings live on the node. */\nconst META = \"$meta\";\n\n/**\n * What the decorators left on this node, or nothing.\n *\n * Metadata rather than a rewrite is how a decorator says something the grammar\n * has no word for. `@retry(2)` cannot be expressed as a tree of existing\n * statements, so it is expressed as a fact about one.\n */\nexport function metaOf(node: object): NodeMeta | undefined {\n return (node as { $meta?: NodeMeta }).$meta;\n}\n\n/** Read one key, typed by the caller who knows what it wrote. */\nexport function readMeta<T>(node: object, key: string): T | undefined {\n return metaOf(node)?.[key] as T | undefined;\n}\n\n/** Attach a fact to a node. Non-enumerable, so it never lands in a serialised AST. */\nexport function writeMeta(node: object, key: string, value: unknown): void {\n const existing = metaOf(node);\n if (existing) {\n existing[key] = value;\n return;\n }\n Object.defineProperty(node, META, { value: { [key]: value }, configurable: true });\n}\n","import { readMeta, writeMeta } from \"./node-meta.js\";\n\n/**\n * Where `.wrap`, `.before` and `.after` leave their closures.\n *\n * Prefixed, because `meta` is open to any key a decorator invents and a program\n * that writes `target.meta \"before\" x` must not be mistaken for one that wrote\n * `target.before(f)`.\n */\nexport const AROUND_KEYS = {\n wrap: \"deco.wrap\",\n before: \"deco.before\",\n after: \"deco.after\",\n} as const;\n\n/** The closures a `deco` asked to run around this declaration. */\nexport interface Decorations {\n readonly wrap: readonly unknown[];\n readonly before: readonly unknown[];\n readonly after: readonly unknown[];\n}\n\n/**\n * What the behavioural verbs left on this node, or nothing at all.\n *\n * The language has no syntax for \"around this body\", so `.wrap` cannot rewrite\n * the tree the way `.addParam` does. It records a fact about the declaration\n * and the scheduler honours it.\n */\nexport function readDecorations(node: object): Decorations | undefined {\n const wrap = readMeta<unknown[]>(node, AROUND_KEYS.wrap);\n const before = readMeta<unknown[]>(node, AROUND_KEYS.before);\n const after = readMeta<unknown[]>(node, AROUND_KEYS.after);\n if (!wrap && !before && !after) return undefined;\n return { wrap: wrap ?? [], before: before ?? [], after: after ?? [] };\n}\n\n/** Append one closure to a behavioural list, keeping the order they were written. */\nexport function addDecoration(node: object, key: string, fn: unknown): void {\n writeMeta(node, key, [...(readMeta<unknown[]>(node, key) ?? []), fn]);\n}\n","import { nativeFn } from \"../../expr/index.js\";\nimport { AROUND_KEYS, addDecoration } from \"../decorations.js\";\nimport type { Verb, VerbTable } from \"./handle.types.js\";\n\n/** Everything a function's call can be surrounded with. */\nexport const CALL_AROUND_VERBS: VerbTable = {\n props: {},\n calls: { wrap: around(AROUND_KEYS.wrap), before: before(), after: after() },\n};\n\n/**\n * A flow and a step have no `wrap`: there is no call to intercept and no return\n * to replace, only a body that runs. Offering it would be a verb that does\n * nothing, which is worse than not having it.\n */\nexport const BODY_AROUND_VERBS: VerbTable = {\n props: {},\n calls: { before: before(), after: after() },\n};\n\nfunction before(): Verb {\n return around(AROUND_KEYS.before);\n}\n\nfunction after(): Verb {\n return around(AROUND_KEYS.after);\n}\n\nfunction around(key: string): Verb {\n return (node) =>\n nativeFn((args) => {\n addDecoration(node, key, args[0]);\n return null;\n });\n}\n","import { constLit } from \"../../compile/index.js\";\nimport { evaluate, nativeFn } from \"../../expr/index.js\";\nimport type { LetStmt } from \"../../generated/ast.js\";\nimport type { VerbTable } from \"./handle.types.js\";\n\n/** Nothing is bound yet, so what a binding's value refers to is nothing either. */\nconst NOTHING = { lookup: () => undefined };\n\n/**\n * A `let` or `const`: what it was bound to, and binding it to something else.\n *\n * `.value` reads the expression as written, against an empty scope. Expansion\n * happens before any of the program's own names exist, so a binding whose value\n * depends on one answers with nothing rather than with a guess.\n */\nexport const BINDING_VERBS: VerbTable = {\n props: { value: (node) => evaluate((node as LetStmt).value, NOTHING) },\n calls: { setValue: (node) => nativeFn((args) => setValue(node as LetStmt, args[0])) },\n};\n\nfunction setValue(stmt: LetStmt, value: unknown): null {\n const written = constLit(value) as { $container?: object; $containerProperty?: string };\n written.$container = stmt;\n written.$containerProperty = \"value\";\n stmt.value = written as LetStmt[\"value\"];\n return null;\n}\n","import type { AstNode } from \"langium\";\n\n/**\n * Put `next` where `node` is, in its parent's list or in the field holding it.\n * Passing nothing takes the node out of the program entirely.\n *\n * The write goes straight into the parent's own array or field. That is the tree\n * the checker and the runtime read, not a copy of it, so a decorator's rewrite\n * is indistinguishable downstream from source the author wrote.\n */\nexport function swapNode(node: AstNode, next: AstNode | undefined): void {\n const parent = node.$container as Record<string, unknown> | undefined;\n const property = node.$containerProperty;\n if (!parent || !property) return;\n const held = parent[property];\n if (Array.isArray(held)) {\n swapInList(held, node, next);\n return;\n }\n parent[property] = next;\n}\n\nfunction swapInList(list: unknown[], node: AstNode, next: AstNode | undefined): void {\n const at = list.indexOf(node);\n if (at < 0) return;\n if (next) list[at] = next;\n else list.splice(at, 1);\n}\n","import type { AstNode } from \"langium\";\nimport { nativeFn } from \"../../expr/index.js\";\nimport { writeMeta } from \"../node-meta.js\";\nimport { swapNode } from \"../swap-node.js\";\nimport type { VerbTable } from \"./handle.types.js\";\n\n/**\n * What every kind answers to: what it is called, what it carries, and leaving.\n *\n * `meta` is how a decorator says something the grammar has no word for, the same\n * channel `@retry(2)` uses, so a `deco` written in the language reaches exactly\n * what a plugin's TypeScript decorator reaches.\n */\nexport const COMMON_VERBS: VerbTable = {\n props: { name: (node) => nameOf(node) },\n calls: {\n meta: (node) =>\n nativeFn((args) => {\n writeMeta(node, String(args[0]), args[1]);\n return null;\n }),\n remove: (node) =>\n nativeFn(() => {\n swapNode(node, undefined);\n return null;\n }),\n },\n};\n\n/**\n * A flow or a step has a title rather than a name, and answers with it.\n *\n * Empty for the things that have neither. `$type` would answer, but with a word\n * out of the compiler's own tree: the one vocabulary this whole surface exists\n * to keep out of the language.\n */\nfunction nameOf(node: AstNode): string {\n const named = node as { name?: string; title?: string };\n return named.name ?? named.title ?? \"\";\n}\n","import { nativeFn } from \"../../expr/index.js\";\nimport type { FnDecl, Param, ParamList } from \"../../generated/ast.js\";\nimport type { VerbTable } from \"./handle.types.js\";\n\n/**\n * A function's shape: the parameters it takes and the name it answers to.\n *\n * Every one of these edits the declaration itself, before it is compiled, so a\n * parameter added here is in scope for the body that was written without it.\n * That is what `@inject(\"who\")` depends on.\n */\nexport const FN_VERBS: VerbTable = {\n props: { params: (node) => names(node as FnDecl) },\n calls: {\n addParam: (node) => nativeFn((args) => addParam(node as FnDecl, String(args[0]))),\n removeParam: (node) => nativeFn((args) => removeParam(node as FnDecl, String(args[0]))),\n rename: (node) => nativeFn((args) => rename(node as FnDecl, String(args[0]))),\n },\n};\n\nfunction names(decl: FnDecl): string[] {\n return (decl.params?.params ?? []).map((param) => param.name);\n}\n\nfunction addParam(decl: FnDecl, name: string): null {\n const list = paramList(decl);\n if (!list.params.some((param) => param.name === name)) list.params.push(param(list, name));\n return null;\n}\n\nfunction removeParam(decl: FnDecl, name: string): null {\n const list = decl.params;\n if (!list) return null;\n list.params = list.params.filter((param) => param.name !== name);\n return null;\n}\n\nfunction rename(decl: FnDecl, name: string): null {\n decl.name = name;\n return null;\n}\n\n/** A function written `fn f()` has no list at all until something adds to it. */\nfunction paramList(decl: FnDecl): ParamList {\n if (decl.params) return decl.params;\n const list = node<ParamList>({ $type: \"ParamList\", params: [] }, decl, \"params\");\n decl.params = list;\n return list;\n}\n\nfunction param(list: ParamList, name: string): Param {\n return node<Param>({ $type: \"Param\", annotations: [], name }, list, \"params\");\n}\n\n/** A synthesized node, containered the way the parser would have containered it. */\nfunction node<T>(shape: object, container: object, property: string): T {\n return { ...shape, $container: container, $containerProperty: property } as T;\n}\n","import { buildProblem, CODES } from \"../../codes/index.js\";\nimport { ProblemError } from \"../../problem/index.js\";\nimport type { TargetKind } from \"./handle.types.js\";\n\n/** Filled in by the body runner, which knows which statement asked. */\nconst NO_SPAN = { uri: \"\", offset: 0, length: 0, line: 1, column: 1 };\n\n/**\n * The verb this kind does not have, answered with the ones it does.\n *\n * Never `undefined`, never a `TypeError`: a decorator that reaches for\n * `.addParam` on a flow has made a mistake the language can name, and naming it\n * beside the whole surface of that kind is the shortest path to the fix.\n */\nexport function missingVerb(args: {\n verb: string;\n kind: TargetKind;\n offered: Iterable<string>;\n}): ProblemError {\n const has = [...args.offered].join(\", \");\n return verbRefusal(`A ${args.kind} has no \\`${args.verb}\\` — it has ${has}.`);\n}\n\n/** A verb this target cannot honour, for a reason of its own. */\nexport function verbRefusal(title: string): ProblemError {\n return new ProblemError(buildProblem({ spec: CODES.VN2017_DECO_VERB, span: NO_SPAN, title }));\n}\n","import type { FlowDecl, StepDecl } from \"../../generated/ast.js\";\nimport type { VerbTable } from \"./handle.types.js\";\n\n/**\n * What a flow and a step have beyond the common surface: the sentence they are\n * known by. Read-only, because a title is what the reporter, the `--flow` filter\n * and the trace all key off, and renaming it mid-expansion would leave every one\n * of them pointing at a run nobody asked for.\n */\nexport const RUNNABLE_VERBS: VerbTable = {\n props: { title: (node) => (node as FlowDecl | StepDecl).title },\n calls: {},\n};\n","import { nativeFn } from \"../../expr/index.js\";\nimport type { FieldDecl, TypeBody, TypeDecl, TypeRef } from \"../../generated/ast.js\";\nimport type { VerbTable } from \"./handle.types.js\";\nimport { verbRefusal } from \"./missing-verb.js\";\n\n/** The fields of a `type { … }`, and the two ways to change the set. */\nexport const TYPE_VERBS: VerbTable = {\n props: { fields: (node) => (bodyOf(node as TypeDecl)?.fields ?? []).map((one) => one.name) },\n calls: {\n addField: (node) =>\n nativeFn((args) => addField(node as TypeDecl, String(args[0]), String(args[1] ?? \"string\"))),\n removeField: (node) => nativeFn((args) => removeField(node as TypeDecl, String(args[0]))),\n },\n};\n\nfunction bodyOf(decl: TypeDecl): TypeBody | undefined {\n return decl.body;\n}\n\n/** `type Id = string` has no fields to change, and says so rather than growing one. */\nfunction requireBody(decl: TypeDecl, verb: string): TypeBody {\n const body = bodyOf(decl);\n if (body) return body;\n throw verbRefusal(`\\`${decl.name}\\` is an alias, so \\`${verb}\\` has no fields to change.`);\n}\n\nfunction addField(decl: TypeDecl, name: string, type: string): null {\n const body = requireBody(decl, \"addField\");\n if (body.fields.some((field) => field.name === name)) return null;\n body.fields.push(field({ body, name, type }));\n return null;\n}\n\nfunction removeField(decl: TypeDecl, name: string): null {\n const body = requireBody(decl, \"removeField\");\n body.fields = body.fields.filter((one) => one.name !== name);\n return null;\n}\n\nfunction field(args: { body: TypeBody; name: string; type: string }): FieldDecl {\n return {\n $type: \"FieldDecl\",\n $container: args.body,\n $containerProperty: \"fields\",\n annotations: [],\n name: args.name,\n optional: false,\n fieldType: typeRef(args.type),\n } as unknown as FieldDecl;\n}\n\nfunction typeRef(name: string): TypeRef {\n const ref = { $type: \"TypeRef\", members: [] } as unknown as TypeRef;\n ref.members.push({ $type: \"NamedType\", $container: ref, name, args: [] } as unknown as never);\n return ref;\n}\n","import type { AstNode } from \"langium\";\nimport { BODY_AROUND_VERBS, CALL_AROUND_VERBS } from \"./around-verbs.js\";\nimport { BINDING_VERBS } from \"./binding-verbs.js\";\nimport { COMMON_VERBS } from \"./common-verbs.js\";\nimport { FN_VERBS } from \"./fn-verbs.js\";\nimport type { HandleSurface, TargetHandle, TargetKind, VerbTable } from \"./handle.types.js\";\nimport { missingVerb } from \"./missing-verb.js\";\nimport { RUNNABLE_VERBS } from \"./runnable-verbs.js\";\nimport { TYPE_VERBS } from \"./type-verbs.js\";\n\n/** What each kind offers, assembled from the slices it shares with the others. */\nconst SURFACE: Readonly<Record<TargetKind, readonly VerbTable[]>> = {\n Fn: [COMMON_VERBS, FN_VERBS, CALL_AROUND_VERBS],\n Flow: [COMMON_VERBS, RUNNABLE_VERBS, BODY_AROUND_VERBS],\n Step: [COMMON_VERBS, RUNNABLE_VERBS, BODY_AROUND_VERBS],\n Binding: [COMMON_VERBS, BINDING_VERBS],\n Type: [COMMON_VERBS, TYPE_VERBS],\n Node: [COMMON_VERBS],\n};\n\n/** Every verb any kind has, so a kind without one can say so instead of vanishing. */\nconst ALL_VERBS: readonly string[] = [\n ...new Set(Object.values(SURFACE).flatMap((tables) => tables.flatMap(namesOf))),\n];\n\n/**\n * The typed mutable handle a decorator holds: verbs over the real declaration.\n *\n * Built like the native members of a list or a string, as a table of names and a\n * value produced on read, because that is what it is: the built-in members of\n * one more kind of value, whose receiver happens to be a piece of the program\n * rather than a piece of its data.\n *\n * Every verb any kind has is installed. The ones this kind lacks throw a\n * `ProblemError` naming the surface it does offer, so a reach for the wrong verb\n * is refused rather than read as nothing.\n */\nexport function makeHandle(args: { node: AstNode; kind: TargetKind }): TargetHandle {\n const handle: TargetHandle = {};\n const offered = install(handle, args);\n for (const verb of ALL_VERBS) {\n if (!offered.has(verb)) refuse(handle, { verb, kind: args.kind, offered });\n }\n brand(handle, { kind: args.kind, offered: [...offered] });\n return handle;\n}\n\nconst HANDLE = Symbol(\"venn.handle\");\n\n/**\n * What this handle answers to, or nothing when the value is not one.\n *\n * A getter can only refuse a name some kind has; a name no kind has would still\n * read as nothing. The caller that reaches for one asks here instead, so\n * `target.wobble` is refused in the same sentence as `target.addParam`.\n */\nexport function handleSurface(value: unknown): HandleSurface | undefined {\n if (typeof value !== \"object\" || value === null) return undefined;\n return (value as { [HANDLE]?: HandleSurface })[HANDLE];\n}\n\nfunction brand(handle: TargetHandle, surface: HandleSurface): void {\n Object.defineProperty(handle, HANDLE, { value: surface });\n}\n\nfunction install(handle: TargetHandle, args: { node: AstNode; kind: TargetKind }): Set<string> {\n const offered = new Set<string>();\n for (const table of SURFACE[args.kind]) {\n for (const [verb, make] of entriesOf(table)) {\n offered.add(verb);\n define(handle, verb, () => make(args.node));\n }\n }\n return offered;\n}\n\nfunction refuse(\n handle: TargetHandle,\n args: { verb: string; kind: TargetKind; offered: Set<string> },\n): void {\n define(handle, args.verb, () => {\n throw missingVerb(args);\n });\n}\n\n/**\n * Non-enumerable on purpose: a handle is verbs, not data, so serialising one\n * must not run every getter, including the ones whose whole job is to refuse.\n */\nfunction define(handle: TargetHandle, verb: string, get: () => unknown): void {\n Object.defineProperty(handle, verb, { get, configurable: true });\n}\n\nfunction entriesOf(table: VerbTable): [string, (node: AstNode) => unknown][] {\n return [...Object.entries(table.props), ...Object.entries(table.calls)];\n}\n\nfunction namesOf(table: VerbTable): string[] {\n return [...Object.keys(table.props), ...Object.keys(table.calls)];\n}\n","import type { DecoDecl, Param } from \"../generated/ast.js\";\nimport { isTargetKind, type TargetKind } from \"./handles/index.js\";\n\n/** The parameter that *is* the target: the first one, always. */\nexport function decoTarget(decl: DecoDecl): Param | undefined {\n return decl.params?.params[0];\n}\n\n/**\n * The kinds a `deco` decorates, read off the type on its first parameter.\n *\n * The signature is the only statement of what a decorator is for; a separate\n * list of node names would drift from it. Empty means the signature never said\n * (no parameter, or one typed with something that is not a kind). That fault is\n * reported where the `deco` is declared, so a use site stays quiet about a\n * mistake it did not make.\n *\n * @returns the kinds the first parameter's type names, in written order.\n */\nexport function acceptedKinds(decl: DecoDecl): readonly TargetKind[] {\n const written = decoTarget(decl)?.paramType?.members ?? [];\n return written.map((member) => (member as { name?: string }).name ?? \"\").filter(isTargetKind);\n}\n","import type { AstNode } from \"langium\";\nimport type { Span } from \"../problem/index.js\";\n\n/** Where a node sits in its file, for a Problem that has to point at it. */\nexport function spanOf(node: AstNode, uri: string): Span {\n const cst = node.$cstNode as\n | { offset: number; length: number; range?: { start: { line: number; character: number } } }\n | undefined;\n const start = cst?.range?.start;\n return {\n uri,\n offset: cst?.offset ?? 0,\n length: cst?.length ?? 0,\n line: (start?.line ?? 0) + 1,\n column: (start?.character ?? 0) + 1,\n };\n}\n","import type { EvalEnv } from \"../../expr/index.js\";\nimport { PRELUDE_VALUES } from \"../../expr/index.js\";\n\n/**\n * What a decorator body can see: its own parameters, its own `let`s, and the\n * prelude.\n *\n * Nothing else, and deliberately so. The body runs before the program exists: no\n * flow has started and no plugin has been asked for anything, so a name it did\n * not bind itself cannot mean anything yet. The runner says exactly that instead\n * of quietly evaluating to nothing.\n */\nexport class DecoEnv implements EvalEnv {\n constructor(private readonly bindings: Record<string, unknown>) {}\n\n lookup(name: string): unknown {\n if (Object.hasOwn(this.bindings, name)) return this.bindings[name];\n return PRELUDE_VALUES[name];\n }\n\n bind(name: string, value: unknown): void {\n this.bindings[name] = value;\n }\n}\n","import type { AstNode } from \"langium\";\nimport { kindOf, TARGET_KINDS, type TargetKind } from \"./handles/index.js\";\n\n/** What each kind is called in a sentence someone reads. */\nconst KIND_WORDS: Readonly<Record<TargetKind, string>> = {\n Fn: \"a function\",\n Flow: \"a flow\",\n Step: \"a step\",\n Binding: \"a binding\",\n Type: \"a type\",\n Node: \"anything\",\n};\n\n/**\n * What a node is called in that same sentence.\n *\n * Wider than {@link KIND_WORDS} on purpose: a fragment and a group have no kind\n * of their own, but a message that cannot name what the author actually wrote\n * is a message that sends them looking for it.\n */\nconst NODE_WORDS: Readonly<Record<string, string>> = {\n FnDecl: \"a function\",\n FlowDecl: \"a flow\",\n StepDecl: \"a step\",\n GroupDecl: \"a group\",\n LetStmt: \"a binding\",\n TypeDecl: \"a type\",\n FragmentDecl: \"a fragment\",\n DecoDecl: \"a decorator\",\n FieldDecl: \"a field\",\n Param: \"a parameter\",\n ActionCall: \"a call\",\n};\n\n/** A list of alternatives, read the way it is spoken: \"a flow, a step or a group\". */\nfunction oneOf(words: readonly string[]): string {\n const all = [...words];\n const last = all.pop();\n return all.length === 0 ? (last ?? \"\") : `${all.join(\", \")} or ${last}`;\n}\n\n/** The kinds a signature allows, read as prose: \"a function or a flow\". */\nexport function kindWords(kinds: readonly TargetKind[]): string {\n return oneOf(kinds.map((kind) => KIND_WORDS[kind]));\n}\n\n/** Every kind, listed for an author who has to pick one. */\nexport function everyKindWritten(): string {\n return oneOf(TARGET_KINDS);\n}\n\n/**\n * What a node is called for someone reading a message.\n *\n * A plugin's decorator may name any node it is able to read, so an unlisted one\n * has its word derived rather than printed: `FlowDecl` is the compiler talking\n * to itself, and a word nobody ever typed has no business on a user's screen.\n */\nexport function nodeWord(type: string): string {\n return NODE_WORDS[type] ?? `a ${type.replace(/(Decl|Stmt|Expr|Lit)$/, \"\").toLowerCase()}`;\n}\n\n/** \"@memoize decorates a function, and this is a flow.\" */\nexport function wrongKindTitle(args: {\n name: string;\n kinds: readonly TargetKind[];\n node: AstNode;\n}): string {\n return `@${args.name} decorates ${kindWords(args.kinds)}, and this is ${nodeWord(args.node.$type)}.`;\n}\n\n/**\n * The same sentence for a plugin's decorator, whose reach is a list of node\n * types. It still reads as prose: what the author wrote is what they are told\n * about, and the list they never wrote stays out of it.\n */\nexport function wrongTargetTitle(args: {\n name: string;\n targets: readonly string[];\n node: AstNode;\n}): string {\n const allowed = oneOf([...new Set(args.targets.map(nodeWord))]);\n return `@${args.name} decorates ${allowed}, and this is ${nodeWord(args.node.$type)}.`;\n}\n\n/**\n * Why a `@name` does not belong on this node, if it does not.\n *\n * Nothing when the signature never said which kinds it takes: that is a fault\n * committed once, where the `deco` is written, and repeating it at every use\n * site would bury the one message that can be acted on.\n */\nexport function wrongKind(args: {\n name: string;\n kinds: readonly TargetKind[];\n node: AstNode;\n}): string | undefined {\n const { kinds, node } = args;\n if (kinds.length === 0 || kinds.includes(\"Node\") || kinds.includes(kindOf(node)))\n return undefined;\n return wrongKindTitle(args);\n}\n","import type { DecoDecl, Param, TypeRef } from \"../../generated/ast.js\";\nimport { acceptedKinds, decoTarget } from \"../accepted-kinds.js\";\nimport type { TargetKind } from \"../handles/index.js\";\nimport { everyKindWritten } from \"../wrong-kind.js\";\nimport type { SignatureResult } from \"./deco.types.js\";\n\n/**\n * Read a `deco`'s parameters as what they mean.\n *\n * The first parameter *is* the target and its type is what may carry the\n * decorator; the rest are the decorator's own arguments, filled by `@name(…)` in\n * order. Nobody writing a decorator ever names a node of the compiler's tree,\n * and what it decorates follows from the signature rather than from a list kept\n * beside it.\n *\n * @returns the signature, or the one-line reason it does not read.\n */\nexport function readSignature(decl: DecoDecl): SignatureResult {\n const target = decoTarget(decl);\n if (!target) return { ok: false, title: needsTarget(decl.name) };\n if (!target.paramType) return { ok: false, title: needsType(decl.name, target.name) };\n const kinds = acceptedKinds(decl);\n // A union may name several kinds; one word that is not a kind spoils it all.\n if (kinds.length !== target.paramType.members.length) {\n return { ok: false, title: notAKind(decl.name, target.paramType) };\n }\n return signature(target, kinds, decl.params?.params ?? []);\n}\n\nfunction signature(\n target: Param,\n kinds: readonly TargetKind[],\n params: readonly Param[],\n): SignatureResult {\n return {\n ok: true,\n signature: { target: target.name, kinds, args: params.slice(1).map((one) => one.name) },\n };\n}\n\nfunction written(type: TypeRef): string {\n return type.members.map((member) => (member as { name?: string }).name ?? \"?\").join(\" | \");\n}\n\nfunction needsTarget(name: string): string {\n return `\\`deco ${name}\\` needs a first parameter — the thing it decorates.`;\n}\n\nfunction needsType(name: string, target: string): string {\n const kinds = everyKindWritten();\n return `\\`deco ${name}\\` must say what it decorates: give \\`${target}\\` a type — ${kinds}.`;\n}\n\nfunction notAKind(name: string, type: TypeRef): string {\n const kinds = everyKindWritten();\n return `\\`deco ${name}\\` decorates \\`${written(type)}\\`, which is not a kind — say ${kinds}.`;\n}\n","import type { AstNode } from \"langium\";\nimport { callArgs } from \"../../ast/index.js\";\nimport { buildProblem, CODES } from \"../../codes/index.js\";\nimport { evaluate, invoke, memberValue } from \"../../expr/index.js\";\nimport type { ActionCall, Block, IfStmt, LetStmt, Statement } from \"../../generated/ast.js\";\nimport { type Problem, ProblemError } from \"../../problem/index.js\";\nimport { truthy } from \"../../value/index.js\";\nimport { handleSurface, missingVerb } from \"../handles/index.js\";\nimport { spanOf } from \"../node-span.js\";\nimport type { DecoBodyArgs } from \"./deco.types.js\";\n\n/**\n * Run a decorator's body, at expansion time, over the handle it was given.\n *\n * It understands `let`/`const`, `if`, and a call on something it can already\n * see. Nothing else, because nothing else exists yet: a call whose head it\n * cannot find is a plugin's verb, and saying so is more use than a lookup that\n * quietly yields nothing and a `TypeError` two lines later.\n *\n * Nothing is thrown. Every refusal reaches `args.reject` as a `Problem` pointing\n * at the statement that caused it.\n */\nexport function runDecoBody(args: DecoBodyArgs): void {\n runStmts(args.body.stmts, args);\n}\n\nfunction runStmts(stmts: readonly Statement[], args: DecoBodyArgs): void {\n for (const stmt of stmts) {\n try {\n dispatch(stmt, args);\n } catch (error) {\n args.reject(located(error, stmt, args.uri));\n }\n }\n}\n\nfunction dispatch(stmt: Statement, args: DecoBodyArgs): void {\n if (stmt.$type === \"LetStmt\") {\n bind(stmt as LetStmt, args);\n } else if (stmt.$type === \"ActionCall\") {\n callVerb(stmt as ActionCall, args);\n } else if (stmt.$type === \"IfStmt\") {\n branch(stmt as IfStmt, args);\n } else {\n throw refuse(UNSUPPORTED);\n }\n}\n\n/** `const cache = {}`. Trailing arguments would make it an action, which it cannot be. */\nfunction bind(stmt: LetStmt, args: DecoBodyArgs): void {\n if (stmt.args.length > 0 || stmt.opts) throw refuse(IMPURE_LET);\n args.env.bind(stmt.name, evaluate(stmt.value, args.env));\n}\n\n/** `target.wrap(f)`, `target.meta \"retry\" 3`: a verb on something already in hand. */\nfunction callVerb(stmt: ActionCall, args: DecoBodyArgs): void {\n const path = stmt.target.split(\".\");\n const root = args.env.lookup(path[0] as string);\n if (root === undefined) throw refuse(impure(stmt.target));\n const callee = path.slice(1).reduce<unknown>(reach, root);\n invoke(callee, values(stmt, args));\n}\n\n/** A handle answers only to its own verbs; anything else is refused by name. */\nfunction reach(held: unknown, name: string): unknown {\n const surface = handleSurface(held);\n if (surface && !surface.offered.includes(name)) {\n throw missingVerb({ verb: name, kind: surface.kind, offered: surface.offered });\n }\n return memberValue(held, name);\n}\n\nfunction values(stmt: ActionCall, args: DecoBodyArgs): unknown[] {\n const given = callArgs(stmt).map((arg) => evaluate(arg, args.env));\n if (stmt.opts) given.push(evaluate(stmt.opts, args.env));\n return given;\n}\n\nfunction branch(stmt: IfStmt, args: DecoBodyArgs): void {\n if (truthy(evaluate(stmt.cond, args.env))) {\n runStmts(stmt.then.stmts, args);\n return;\n }\n const other = stmt.otherwise;\n if (!other) return;\n // `else if` is another statement; a plain `else` is a block of them.\n if (other.$type === \"Block\") runStmts((other as Block).stmts, args);\n else dispatch(other as Statement, args);\n}\n\nconst IMPURE_LET =\n \"A decorator runs before the program exists, so this binding cannot call an action.\";\n\nconst UNSUPPORTED =\n \"A decorator body understands `let`, `const`, `if` and verbs on what it was given — this is none of them.\";\n\n/**\n * The one sentence for a verb a decorator cannot reach.\n *\n * Exported because the static pass notices the same thing without ever running\n * the body, and two wordings for one fact is how they start to disagree.\n */\nexport function impure(target: string): string {\n return `A decorator runs before the program exists, so it cannot call \\`${target}\\`.`;\n}\n\n/** Located later, by the statement that asked. */\nconst NO_SPAN = { uri: \"\", offset: 0, length: 0, line: 1, column: 1 };\n\nfunction refuse(title: string): ProblemError {\n return new ProblemError(buildProblem({ spec: CODES.VN2016_DECO_IMPURE, span: NO_SPAN, title }));\n}\n\n/** Whatever went wrong, pointed at the line of the body that asked for it. */\nfunction located(error: unknown, stmt: AstNode, uri: string): Problem {\n if (error instanceof ProblemError) return { ...error.problem, span: spanOf(stmt, uri) };\n const title = (error as { message?: string })?.message ?? String(error);\n return buildProblem({ spec: CODES.VN2016_DECO_IMPURE, span: spanOf(stmt, uri), title });\n}\n","import { buildProblem, CODES } from \"../../codes/index.js\";\nimport type { DecoDecl } from \"../../generated/ast.js\";\nimport type { Problem } from \"../../problem/index.js\";\nimport type { DecoratorDefinition, ExpandContext } from \"../expand.types.js\";\nimport { kindOf, makeHandle } from \"../handles/index.js\";\nimport { spanOf } from \"../node-span.js\";\nimport type { DecoSignature } from \"./deco.types.js\";\nimport { DecoEnv } from \"./deco-env.js\";\nimport { readSignature } from \"./read-signature.js\";\nimport { runDecoBody } from \"./run-body.js\";\n\n/** A `deco` and everything reporting about it needs. */\ninterface DecoArgs {\n decl: DecoDecl;\n uri: string;\n problems: Problem[];\n}\n\n/**\n * A `deco` written in the language, as a decorator the expansion phase applies.\n *\n * This is the very {@link DecoratorDefinition} a plugin's TypeScript\n * `defineDecorator` produces: one mechanism, two doors. What the signature says\n * it decorates becomes `accepts`, so the type error for `@memoize` on a flow\n * comes from how the author wrote the parameters rather than from a list kept by\n * hand beside them.\n *\n * @returns a definition that does nothing when the signature does not read. The\n * reason is pushed onto `args.problems` once, here, rather than at every use.\n */\nexport function decoDecorator(args: DecoArgs): DecoratorDefinition {\n const read = readSignature(args.decl);\n if (read.ok) return definition({ ...args, sig: read.signature });\n args.problems.push(signatureProblem(args, read.title));\n // Still resolvable, doing nothing: a fault committed once, where the `deco` is\n // written, must not be repeated at every use of it.\n return { name: args.decl.name, expand: () => {} };\n}\n\nfunction definition(args: DecoArgs & { sig: DecoSignature }): DecoratorDefinition {\n return {\n name: args.decl.name,\n accepts: args.sig.kinds,\n expand: (ctx) => apply({ ...args, ctx }),\n };\n}\n\nfunction apply(args: DecoArgs & { sig: DecoSignature; ctx: ExpandContext }): void {\n const handle = makeHandle({ node: args.ctx.node, kind: kindOf(args.ctx.node) });\n runDecoBody({\n body: args.decl.body,\n env: new DecoEnv(bindings(args.sig, handle, args.ctx.args)),\n uri: args.uri,\n reject: (problem) => args.problems.push(problem),\n });\n}\n\n/** The target under the name the body calls it by, then `@name(…)` in order. */\nfunction bindings(\n sig: DecoSignature,\n handle: unknown,\n given: readonly unknown[],\n): Record<string, unknown> {\n const bound: Record<string, unknown> = { [sig.target]: handle };\n sig.args.forEach((name, at) => {\n bound[name] = given[at];\n });\n return bound;\n}\n\nfunction signatureProblem(args: DecoArgs, title: string): Problem {\n return buildProblem({\n spec: CODES.VN2015_DECO_SIGNATURE,\n span: spanOf(args.decl, args.uri),\n title,\n });\n}\n","import type { Document } from \"../../generated/ast.js\";\nimport { isDecoDecl } from \"../../generated/ast.js\";\nimport type { Problem } from \"../../problem/index.js\";\nimport type { DecoratorDefinition, DecoratorSource } from \"../expand.types.js\";\nimport type { ImportedDeco } from \"./deco.types.js\";\nimport { decoDecorator } from \"./deco-decorator.js\";\n\n/** Every `deco` one document can reach, and the file it is being expanded for. */\nexport interface DocumentDecoArgs {\n document: Document;\n decorators: DecoratorSource;\n uri: string;\n problems: Problem[];\n /** The `pub deco`s this file's imports reach, by name. */\n imported?: ReadonlyMap<string, ImportedDeco>;\n}\n\n/**\n * The document's own `deco`s, then the ones it imported, layered over whatever\n * the host contributed.\n *\n * A local declaration wins against a plugin's and against a built-in of the same\n * name: the more local one is what the author is looking at. All of them arrive\n * as ordinary members of one {@link DecoratorSource}, so `@memoize` resolves\n * without expansion ever asking where a decorator came from.\n */\nexport function withDocumentDecos(args: DocumentDecoArgs): DecoratorSource {\n const own = ownDecos(args);\n const shared = sharedDecos(args);\n if (own.size === 0 && !shared) return args.decorators;\n return { get: (name) => own.get(name) ?? shared?.(name) ?? args.decorators.get(name) };\n}\n\n/** Built up front: a signature that does not read is reported where it is written. */\nfunction ownDecos(args: DocumentDecoArgs): Map<string, DecoratorDefinition> {\n const own = new Map<string, DecoratorDefinition>();\n for (const decl of args.document.decls) {\n if (isDecoDecl(decl)) own.set(decl.name, decoDecorator({ ...args, decl }));\n }\n return own;\n}\n\ntype Found = DecoratorDefinition | undefined;\n\n/**\n * Built on first use, and remembered.\n *\n * An imported file exports every `pub deco` it has, and this one may write none\n * of them: reading a signature nobody asked for would charge another file's\n * fault to this one, for a decorator that was never applied.\n */\nfunction sharedDecos(args: DocumentDecoArgs): ((name: string) => Found) | undefined {\n const imported = args.imported;\n if (!imported || imported.size === 0) return undefined;\n const built = new Map<string, Found>();\n return (name) => {\n if (built.has(name)) return built.get(name);\n const from = imported.get(name);\n // Its own uri, so a fault in it points at the line that wrote it.\n const made = from && decoDecorator({ ...args, decl: from.decl, uri: from.uri });\n built.set(name, made);\n return made;\n };\n}\n","import { invoke, nativeFn } from \"../expr/index.js\";\nimport { type Decorations, readDecorations } from \"./decorations.js\";\n\n/** A call, reduced to the one thing a middleware needs: values in, value out. */\ntype Call = (values: readonly unknown[]) => unknown;\n\n/**\n * The callable a decorated `fn` binds to: its own body with every `.wrap`,\n * `.before` and `.after` a `deco` asked for already around it.\n *\n * An untouched function is handed straight back, so nothing pays for a feature\n * it did not use.\n */\nexport function decorateCallable(node: object, base: unknown): unknown {\n const around = readDecorations(node);\n if (!around) return base;\n const chain = wrapChain(around.wrap, base);\n return nativeFn((values) => aroundCall({ chain, around, values }));\n}\n\nfunction aroundCall(args: {\n chain: Call;\n around: Decorations;\n values: readonly unknown[];\n}): unknown {\n for (const fn of args.around.before) invoke(fn, [args.values]);\n const result = args.chain(args.values);\n for (const fn of args.around.after) invoke(fn, [args.values, result]);\n return result;\n}\n\n/** The first-written wrap ends up outermost: it decides whether the rest runs. */\nfunction wrapChain(wraps: readonly unknown[], base: unknown): Call {\n let next: Call = (values) => invoke(base, values);\n for (let at = wraps.length - 1; at >= 0; at -= 1) next = oneWrap(wraps[at], next);\n return next;\n}\n\nfunction oneWrap(wrap: unknown, inner: Call): Call {\n const through = nativeFn((given) => inner(passedOn(given)));\n return (values) => invoke(wrap, [through, values]);\n}\n\n/** `call(args)` passes the list straight along; `call(a, b)` passes both. */\nfunction passedOn(given: readonly unknown[]): readonly unknown[] {\n const first = given[0];\n if (given.length === 1 && Array.isArray(first)) return first;\n return given;\n}\n","import type { AstNode } from \"langium\";\nimport { buildProblem } from \"../codes/index.js\";\nimport { evaluate } from \"../expr/index.js\";\nimport type { Annotation } from \"../generated/ast.js\";\nimport { isRef } from \"../generated/ast.js\";\nimport type { Problem } from \"../problem/index.js\";\nimport type { ExpandContext } from \"./expand.types.js\";\nimport { writeMeta } from \"./node-meta.js\";\nimport { spanOf } from \"./node-span.js\";\nimport { swapNode } from \"./swap-node.js\";\n\n/**\n * The handle one decorator gets on one node.\n *\n * `replace` and `remove` write straight into the parent's own array or field.\n * That is the tree the checker and the runtime read, not a copy of it, so a\n * decorator's rewrite is indistinguishable downstream from source the author\n * wrote by hand.\n */\nexport function makeContext(args: {\n node: AstNode;\n annotation: Annotation;\n uri?: string;\n problems: Problem[];\n}): ExpandContext {\n const { node, annotation } = args;\n return {\n node,\n parent: node.$container,\n args: evaluatedArgs(annotation),\n // The expressions as written, for a decorator that needs the tree and not\n // the value: a macro reads its argument, it does not compute it.\n written: (annotation.args?.args ?? []).map((arg) => arg.value),\n replace: (next) => swapNode(node, next),\n remove: () => swapNode(node, undefined),\n meta: (key, value) => writeMeta(node, key, value),\n reject: (rejection) => args.problems.push(problemOf({ ...args, ...rejection })),\n };\n}\n\n/**\n * A decorator's arguments are evaluated once, here, against nothing.\n *\n * They are written before the program runs and cannot depend on it: `@retry(2)`\n * is part of the shape of the program, not of its execution. That is also why a\n * bare name inside one is a *word* and not a variable. `@tags(smoke)` and\n * `@scope(worker)` name a tag and a lifetime, and nothing exists yet for them to\n * refer to.\n */\nfunction evaluatedArgs(annotation: Annotation): unknown[] {\n const nothing = { lookup: () => undefined };\n return (annotation.args?.args ?? []).map((arg) =>\n isRef(arg.value) ? arg.value.name : evaluate(arg.value, nothing),\n );\n}\n\n/** A decorator names its own code, so a plugin can refuse a program in its own terms. */\nfunction problemOf(args: {\n annotation: Annotation;\n uri?: string;\n code: string;\n title: string;\n}): Problem {\n return buildProblem({\n spec: { code: args.code, severity: \"error\" },\n span: spanOf(args.annotation, args.uri ?? \"memory://inline.vn\"),\n title: args.title,\n });\n}\n","import type { AstNode } from \"langium\";\nimport { walkAst } from \"../ast/index.js\";\nimport { buildProblem, CODES } from \"../codes/index.js\";\nimport type { Annotation, Document } from \"../generated/ast.js\";\nimport type { Problem } from \"../problem/index.js\";\nimport type { ImportedDeco } from \"./deco/index.js\";\nimport { withDocumentDecos } from \"./deco/index.js\";\nimport type { DecoratorDefinition, DecoratorSource, ExpandResult } from \"./expand.types.js\";\nimport { makeContext } from \"./make-context.js\";\nimport { spanOf } from \"./node-span.js\";\nimport { wrongKind, wrongTargetTitle } from \"./wrong-kind.js\";\n\n/** What one decorated node needs for its decorators to run. */\ninterface Site {\n node: AstNode & { annotations: Annotation[] };\n decorators: DecoratorSource;\n uri: string;\n problems: Problem[];\n}\n\n/**\n * Run every decorator the program wrote, before anything else reads the program.\n *\n * This is the one place a `@name` means anything. The kernel does not know what\n * `@retry` is; it knows that a name written with an `@` is looked up, handed the\n * node it sits on, and allowed to rewrite it. Built-in decorators come through\n * here too, so there is no shorter path for them.\n *\n * Applied innermost first, so a decorator that rewrites a body finds a body its\n * own decorators have already finished with.\n *\n * A `deco` the document declares, or one imported from a file that wrote `pub`,\n * joins the same source the built-ins live in before any of them run. Nothing\n * below here can tell whether `@memoize` was written in TypeScript, in this\n * file, or in the one next to it.\n *\n * @returns the problems raised. The document itself is rewritten in place.\n */\nexport function expand(args: {\n document: Document;\n decorators: DecoratorSource;\n uri?: string;\n /** The `pub deco`s this file's imports reach, by name. */\n imported?: ReadonlyMap<string, ImportedDeco>;\n}): ExpandResult {\n const problems: Problem[] = [];\n const uri = args.uri ?? \"memory://inline.vn\";\n const decorators = withDocumentDecos({ ...args, uri, problems });\n const sites = walkAst(args.document).filter(decorated);\n for (const node of sites.reverse()) {\n applyAll({ node, decorators, uri, problems });\n }\n return { problems };\n}\n\nfunction decorated(node: AstNode): node is AstNode & { annotations: Annotation[] } {\n return ((node as { annotations?: Annotation[] }).annotations ?? []).length > 0;\n}\n\nfunction applyAll(site: Site): void {\n // A copy: a decorator is allowed to rewrite the list it is standing in.\n for (const annotation of [...site.node.annotations]) applyOne(site, annotation);\n}\n\nfunction applyOne(site: Site, annotation: Annotation): void {\n const found = site.decorators.get(annotation.name);\n if (!found) {\n refuse(site, annotation, unknownTitle(annotation), CODES.VN2013_UNKNOWN_DECORATOR.code);\n return;\n }\n const misplaced = wrongPlace(found, site.node, annotation);\n if (misplaced) {\n refuse(site, annotation, misplaced, CODES.VN2014_DECORATOR_TARGET.code);\n return;\n }\n found.expand(\n makeContext({ node: site.node, annotation, uri: site.uri, problems: site.problems }),\n );\n}\n\n/**\n * Why a decorator does not belong here, if it does not.\n *\n * A `deco` says what it decorates by typing its first parameter, so the answer\n * is phrased in the words the author used. A plugin's decorator still names node\n * types, because it is handed the raw node and nothing shorter describes what it\n * is able to read.\n */\nfunction wrongPlace(\n found: DecoratorDefinition,\n node: AstNode,\n annotation: Annotation,\n): string | undefined {\n const name = annotation.name;\n if (found.accepts) return wrongKind({ name, kinds: found.accepts, node });\n if (!found.targets || found.targets.includes(node.$type)) return undefined;\n return wrongTargetTitle({ name, targets: found.targets, node });\n}\n\nfunction unknownTitle(annotation: Annotation): string {\n return `No decorator is named \"@${annotation.name}\".`;\n}\n\nfunction refuse(site: Site, annotation: Annotation, title: string, code: string): void {\n site.problems.push(\n buildProblem({ spec: { code, severity: \"error\" }, span: spanOf(annotation, site.uri), title }),\n );\n}\n","/** How to format a `.vn` file. Mirrors the `[format]` table of `venn.toml`. */\nexport interface FormatOptions {\n /** Spaces per indent level. Ignored when {@link useTabs} is on. */\n indentWidth: number;\n useTabs: boolean;\n /** Move every `use` above every `import`. */\n organizeHeader: boolean;\n /** Sort each header group alphabetically. */\n sortHeader: boolean;\n}\n\n/** What the formatter does when `venn.toml` says nothing. */\nexport const DEFAULT_FORMAT: FormatOptions = {\n indentWidth: 2,\n useTabs: false,\n organizeHeader: true,\n sortHeader: false,\n};\n","interface Entry {\n kind: \"use\" | \"import\";\n comments: string[];\n line: string;\n}\n\ninterface Header {\n head: string[];\n entries: Entry[];\n floating: string[];\n rest: string[];\n}\n\n/**\n * Put every `use` above every `import`. A comment sitting directly on top of a\n * line travels with it; a comment separated by a blank line is left where the\n * header begins, so nothing is silently re-attached to the wrong statement.\n */\nexport function organizeHeader(lines: readonly string[], sort: boolean): string[] {\n const header = split(lines);\n if (header.entries.length === 0) return [...lines];\n const head = header.head.length > 0 ? [...header.head, \"\"] : [];\n const uses = group(header.entries, \"use\", sort);\n const imports = group(header.entries, \"import\", sort);\n return [...head, ...uses, ...imports, ...header.floating, ...header.rest];\n}\n\nfunction split(lines: readonly string[]): Header {\n const header: Header = { head: [], entries: [], floating: [], rest: [] };\n let pending: string[] = [];\n let index = 0;\n for (; index < lines.length; index++) {\n const line = (lines[index] ?? \"\").trim();\n const kind = kindOf(line);\n if (kind) {\n header.entries.push({ kind, comments: pending, line });\n pending = [];\n } else if (/^module\\s/.test(line)) {\n header.head.push(...pending, line);\n pending = [];\n } else if (line.startsWith(\"#\")) pending.push(line);\n else if (line === \"\") pending = park(header, pending);\n else break;\n }\n header.rest = [...pending, ...lines.slice(index)];\n return header;\n}\n\n// A comment block cut off by a blank line belongs to nobody: keep it in place.\nfunction park(header: Header, pending: string[]): string[] {\n if (pending.length > 0)\n (header.entries.length === 0 ? header.head : header.floating).push(...pending);\n return [];\n}\n\nfunction group(entries: readonly Entry[], kind: Entry[\"kind\"], sort: boolean): string[] {\n const picked = entries.filter((entry) => entry.kind === kind);\n const ordered = sort ? [...picked].sort((a, b) => a.line.localeCompare(b.line)) : picked;\n if (ordered.length === 0) return [];\n return [...ordered.flatMap((entry) => [...entry.comments, entry.line]), \"\"];\n}\n\nfunction kindOf(line: string): Entry[\"kind\"] | undefined {\n if (/^use\\s/.test(line)) return \"use\";\n return /^(pub\\s+)?import\\s/.test(line) ? \"import\" : undefined;\n}\n","const OPEN = /[{[(]/g;\nconst CLOSE = /[}\\])]/g;\n\n/**\n * Re-indent by bracket depth. Venn statements are newline terminated, so this\n * only ever rewrites the leading whitespace of a line. It never joins or splits\n * lines, which makes it idempotent by construction.\n *\n * @param unit The string for one indent level, either spaces or a tab.\n */\nexport function reindent(lines: readonly string[], unit: string): string[] {\n const out: string[] = [];\n let depth = 0;\n for (const line of lines) {\n const stripped = stripLiterals(line).trim();\n const level = Math.max(0, depth - leadingClosers(stripped));\n const trimmed = line.trim();\n out.push(trimmed === \"\" ? \"\" : unit.repeat(level) + trimmed);\n depth = Math.max(0, depth + count(stripped, OPEN) - count(stripped, CLOSE));\n }\n return out;\n}\n\n// Brackets inside strings or comments must not move the depth.\nfunction stripLiterals(line: string): string {\n return line.replace(/\"(\\\\.|[^\"\\\\])*\"/g, '\"\"').replace(/#.*$/, \"\");\n}\n\nfunction leadingClosers(stripped: string): number {\n return /^[}\\])]*/.exec(stripped)?.[0].length ?? 0;\n}\n\nfunction count(text: string, pattern: RegExp): number {\n return text.match(pattern)?.length ?? 0;\n}\n","import { DEFAULT_FORMAT, type FormatOptions } from \"./format.types.js\";\nimport { organizeHeader } from \"./organize-header.js\";\nimport { reindent } from \"./reindent.js\";\n\n/**\n * Format a `.vn` source: group the header, then re-indent. Line-oriented by\n * design, so it never joins or splits lines. That makes it idempotent, and a\n * one-line block stays on one line.\n */\nexport function formatText(source: string, options?: Partial<FormatOptions>): string {\n const settings = { ...DEFAULT_FORMAT, ...options };\n const eol = source.includes(\"\\r\\n\") ? \"\\r\\n\" : \"\\n\";\n const lines = source.split(/\\r?\\n/);\n const organized = settings.organizeHeader\n ? organizeHeader(lines, settings.sortHeader)\n : [...lines];\n return reindent(organized, unitOf(settings)).join(eol);\n}\n\nfunction unitOf(options: FormatOptions): string {\n return options.useTabs ? \"\\t\" : \" \".repeat(Math.max(1, options.indentWidth));\n}\n","import type { FormatOptions } from \"./format.types.js\";\n\n/** The shape of the `[format]` table, loose enough for a parsed TOML record. */\nexport interface FormatTable {\n indent?: unknown;\n tabs?: unknown;\n organize?: unknown;\n sort?: unknown;\n}\n\n/**\n * Map the raw `[format]` table of `venn.toml` onto formatter options. Keys the\n * project did not set are dropped, so the defaults survive the merge.\n */\nexport function formatOptionsFrom(settings: FormatTable | undefined): Partial<FormatOptions> {\n const table: FormatTable = settings ?? {};\n return prune({\n indentWidth: numberOf(table.indent),\n useTabs: booleanOf(table.tabs),\n organizeHeader: booleanOf(table.organize),\n sortHeader: booleanOf(table.sort),\n });\n}\n\nfunction prune(options: Partial<FormatOptions>): Partial<FormatOptions> {\n const out: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(options)) {\n if (value !== undefined) out[key] = value;\n }\n return out as Partial<FormatOptions>;\n}\n\nfunction numberOf(value: unknown): number | undefined {\n const parsed = Number(value);\n return value === undefined || Number.isNaN(parsed) ? undefined : parsed;\n}\n\nfunction booleanOf(value: unknown): boolean | undefined {\n return value === undefined ? undefined : value === true || value === \"true\";\n}\n","import type { Block, Document, ExpectStmt, FlowDecl, Statement } from \"../generated/ast.js\";\nimport {\n isActionCall,\n isExpectStmt,\n isFlowDecl,\n isForEachStmt,\n isGroupDecl,\n isIfStmt,\n isParallelStmt,\n isRaceStmt,\n isRepeatStmt,\n isStepDecl,\n isWhileStmt,\n} from \"../generated/ast.js\";\nimport type { Graph, GraphNode } from \"./graph.types.js\";\n\n/** Derive the node graph (§22) from a parsed document — a pure AST transform. */\nexport function toGraph(doc: Document): Graph {\n const graph: Graph = { nodes: [], edges: [] };\n doc.decls.filter(isFlowDecl).forEach((flow, index) => {\n addFlow(graph, flow, `flow-${index}`);\n });\n return graph;\n}\n\nfunction addFlow(graph: Graph, flow: FlowDecl, id: string): void {\n graph.nodes.push({ id, kind: \"flow\", label: flow.title });\n walkBlock(graph, flow.body, id);\n}\n\nfunction walkBlock(graph: Graph, block: Block, parent: string): void {\n let previous: string | undefined;\n block.stmts.forEach((stmt, index) => {\n const nodeId = addStatement(graph, stmt, `${parent}/n${index}`, parent);\n if (nodeId && previous) graph.edges.push({ from: previous, to: nodeId });\n if (nodeId) previous = nodeId;\n });\n}\n\nfunction addStatement(\n graph: Graph,\n stmt: Statement,\n id: string,\n parent: string,\n): string | undefined {\n const container = containerOf(stmt);\n if (container) return addContainer({ graph, id, parent, ...container });\n if (isActionCall(stmt)) return addNode(graph, { id, kind: \"action\", label: stmt.target, parent });\n if (isExpectStmt(stmt))\n return addNode(graph, { id, kind: \"expect\", label: exprText(stmt), parent });\n return undefined;\n}\n\nfunction containerOf(stmt: Statement): { kind: string; label: string; body: Block } | undefined {\n if (isStepDecl(stmt)) return { kind: \"step\", label: stmt.title, body: stmt.body };\n if (isGroupDecl(stmt)) return { kind: \"group\", label: stmt.title, body: stmt.body };\n if (isForEachStmt(stmt))\n return { kind: \"forEach\", label: `forEach ${stmt.item}`, body: stmt.body };\n if (isRepeatStmt(stmt)) return { kind: \"repeat\", label: \"repeat\", body: stmt.body };\n if (isWhileStmt(stmt)) return { kind: \"while\", label: \"while\", body: stmt.body };\n if (isParallelStmt(stmt)) return { kind: \"parallel\", label: \"parallel\", body: stmt.body };\n if (isRaceStmt(stmt)) return { kind: \"race\", label: \"race\", body: stmt.body };\n if (isIfStmt(stmt)) return { kind: \"if\", label: \"if\", body: stmt.then };\n return undefined;\n}\n\nfunction addContainer(args: {\n graph: Graph;\n id: string;\n parent: string;\n kind: string;\n label: string;\n body: Block;\n}): string {\n addNode(args.graph, { id: args.id, kind: args.kind, label: args.label, parent: args.parent });\n walkBlock(args.graph, args.body, args.id);\n return args.id;\n}\n\nfunction addNode(graph: Graph, node: GraphNode): string {\n graph.nodes.push(node);\n return node.id;\n}\n\nfunction exprText(stmt: ExpectStmt): string {\n return (stmt as { $cstNode?: { text?: string } }).$cstNode?.text ?? \"expect\";\n}\n","/** What a specifier written in an `import` names. */\nexport type SpecifierKind = \"relative\" | \"alias\" | \"package\";\n\n/**\n * Which of the three a specifier is.\n *\n * The rule is Node's, so there is no `npm:` prefix and nothing new to learn:\n * `./util.vn` is a file beside this one, `#shared/auth.vn` goes through\n * `[paths]`, and a bare `zod` is an installed package. The shape of what is\n * written already says which it is.\n */\nexport function specifierKind(spec: string): SpecifierKind {\n if (spec.startsWith(\".\") || spec.startsWith(\"/\")) return \"relative\";\n if (spec.startsWith(\"#\")) return \"alias\";\n return \"package\";\n}\n\n/** Whether the specifier names an installed package rather than a file. */\nexport function isPackageSpecifier(spec: string): boolean {\n return specifierKind(spec) === \"package\";\n}\n","/** What a built-in type is, and how it reads when written. */\nexport interface BuiltinType {\n /** One line, in the reader's terms rather than the compiler's. */\n doc: string;\n /** How it is written where a type goes. */\n example: string;\n}\n\n/**\n * The types the language brings with it, described once.\n *\n * These are the words a reader meets first, so the hover and the completion list\n * read from here. A built-in that cannot explain itself is a built-in nobody\n * discovers.\n */\nexport const BUILTIN_TYPES: Readonly<Record<string, BuiltinType>> = {\n string: {\n // biome-ignore lint/suspicious/noTemplateCurlyInString: Venn's own interpolation, quoted for a reader.\n doc: \"Text. Interpolates with `${…}` and carries the string methods.\",\n example: \"name: string\",\n },\n number: {\n doc: \"A number, whole or not. There is no separate integer type.\",\n example: \"age: number\",\n },\n bool: {\n doc: \"`true` or `false`, and nothing else — no truthiness, no coercion.\",\n example: \"active: bool\",\n },\n null: { doc: \"The absence of a value. Written `null`.\", example: \"found: string | null\" },\n void: { doc: \"What a verb answers with when it answers nothing.\", example: \"-> void\" },\n dynamic: {\n doc: \"A value whose shape nothing can know — a parsed response, a JSON field. Name a type and annotate a binding to give it one.\",\n example: \"const price: Price = res.json\",\n },\n list: { doc: \"Many of one thing, in order.\", example: \"tags: list<string>\" },\n map: { doc: \"Keys not known ahead of time, values all alike.\", example: \"headers: map<string>\" },\n duration: {\n doc: \"A length of time: `500ms`, `2s`, `1m`. Arithmetic keeps the unit.\",\n example: \"timeout: duration\",\n },\n size: {\n doc: \"A size in bytes: `4kb`, `2mb`. Arithmetic keeps the unit.\",\n example: \"limit: size\",\n },\n percent: {\n doc: \"A proportion: `5%`, `99.9%`. Reads back as `.ratio` or `.percent`.\",\n example: \"rate: percent\",\n },\n instant: {\n doc: \"A moment in time, written as an ISO date: `2026-07-27T12:00:00Z`.\",\n example: \"at: instant\",\n },\n never: {\n doc: \"What a verb that always fails answers with. No value has this type.\",\n example: \"-> never\",\n },\n};\n\n/** Whether a name is one of the language's own types. */\nexport function isBuiltinType(name: string): boolean {\n return name in BUILTIN_TYPES;\n}\n","/**\n * A static type. `dynamic` is the escape hatch for the result of a plugin\n * action, an HTTP response, `json`: anything the checker cannot know. It unifies\n * with everything and never produces an error, so the effectful world places no\n * annotation burden on the pure one.\n */\nexport type Type =\n | PrimType\n | LiteralType\n | ListType\n | RecordType\n | FnType\n | UnionType\n | OpaqueType\n | DynamicType\n | TypeVar;\n\nexport type PrimName =\n | \"number\"\n | \"string\"\n | \"bool\"\n | \"null\"\n | \"void\"\n | \"duration\"\n | \"size\"\n | \"percent\"\n | \"instant\";\n\nexport interface PrimType {\n readonly kind: \"prim\";\n readonly name: PrimName;\n}\n\n/** One value, standing for itself: `\"GET\"`, `200`, `true`. */\nexport interface LiteralType {\n readonly kind: \"literal\";\n readonly value: string | number | boolean;\n}\n\nexport interface ListType {\n readonly kind: \"list\";\n readonly element: Type;\n}\n\n/** One of several. What makes `\"GET\" | \"POST\"` more than a string. */\nexport interface UnionType {\n readonly kind: \"union\";\n readonly members: readonly Type[];\n}\n\n/**\n * A handle with a name and no visible inside: a server, a browser, a connection.\n *\n * This is the border with the world outside. Whatever a JavaScript class really\n * is, it arrives here as a name its own namespace's verbs understand and nothing\n * else can open, which keeps the object graph of another language out of this\n * one.\n */\nexport interface OpaqueType {\n readonly kind: \"opaque\";\n readonly name: string;\n /** What it publishes. Absent means a name and nothing more. */\n readonly members?: ReadonlyMap<string, Type>;\n}\n\n/** A map/object with known fields. `open` records tolerate extra fields. */\nexport interface RecordType {\n readonly kind: \"record\";\n readonly fields: ReadonlyMap<string, Type>;\n readonly open: boolean;\n /**\n * What a key nobody listed holds: `Record<string, string>` written as a type.\n * Without it an open record answers `dynamic` for everything it did not name,\n * which is right for a loose map and wrong for `headers`.\n */\n readonly rest?: Type;\n}\n\n/** A function: what it takes, what it gives back, and how strictly it is called. */\nexport interface FnType {\n readonly kind: \"fn\";\n readonly params: readonly Type[];\n readonly result: Type;\n /** Takes any number of arguments, as `str(a, b, c)` and `range(1, 4)` do. Its\n * params describe the shape it accepts, not a count to enforce. */\n readonly variadic?: boolean;\n /** Params from this index on are handed over but may be ignored: `map` offers\n * the index to a callback that is free to take only the item. */\n readonly ignorableFrom?: number;\n}\n\nexport interface DynamicType {\n readonly kind: \"dynamic\";\n}\n\n/** A unification variable. `ref` is filled in as inference solves it. */\nexport interface TypeVar {\n readonly kind: \"var\";\n readonly id: number;\n ref: Type | undefined;\n}\n\n/** The one `dynamic`. Shared, since it carries no state to keep apart. */\nexport const DYNAMIC: DynamicType = { kind: \"dynamic\" };\n\n/** One of the language's primitive types, by name. */\nexport function prim(name: PrimName): PrimType {\n return { kind: \"prim\", name };\n}\n\nexport const NUMBER: PrimType = prim(\"number\");\nexport const STRING: PrimType = prim(\"string\");\nexport const BOOL: PrimType = prim(\"bool\");\nexport const NULL: PrimType = prim(\"null\");\nexport const VOID: PrimType = prim(\"void\");\n\nexport function list(element: Type): ListType {\n return { kind: \"list\", element };\n}\n\nexport function fn(params: readonly Type[], result: Type): FnType {\n return { kind: \"fn\", params, result };\n}\n\n/** A function of any arity, e.g. `str(…)`: only its result is fixed. */\nexport function variadic(params: readonly Type[], result: Type): FnType {\n return { kind: \"fn\", params, result, variadic: true };\n}\n\n/**\n * A callback that is handed `params` but need only take the first `takes` of\n * them. `list.map` passes the index alongside the item, and `p => p.age` is\n * still a perfectly good argument to it.\n */\nexport function callback(params: readonly Type[], result: Type, takes: number): FnType {\n return { kind: \"fn\", params, result, ignorableFrom: takes };\n}\n\nexport function record(fields: ReadonlyMap<string, Type>, open = false, rest?: Type): RecordType {\n return rest ? { kind: \"record\", fields, open, rest } : { kind: \"record\", fields, open };\n}\n\n/** Keys unknown, values all alike: `map<string>`. */\nexport function mapOf(value: Type): RecordType {\n return record(new Map(), true, value);\n}\n\n/** One value standing for itself, as `\"GET\"` does where a type is written. */\nexport function literal(value: string | number | boolean): LiteralType {\n return { kind: \"literal\", value };\n}\n\n/** A named handle, with the surface it publishes, or a bare name without one. */\nexport function opaque(name: string, members?: ReadonlyMap<string, Type>): OpaqueType {\n return members ? { kind: \"opaque\", name, members } : { kind: \"opaque\", name };\n}\n\n/** A union of one is that one: `string | string` helps nobody read anything. */\nexport function union(members: readonly Type[]): Type {\n const flat = members.flatMap((m) => (m.kind === \"union\" ? m.members : [m]));\n return flat.length === 1 ? (flat[0] as Type) : { kind: \"union\", members: flat };\n}\n\n/** Which primitive a literal is one of: `\"GET\"` is a string, and unifies as one. */\nexport function baseOf(value: LiteralType[\"value\"]): PrimName {\n if (typeof value === \"number\") return \"number\";\n return typeof value === \"boolean\" ? \"bool\" : \"string\";\n}\n","import type {\n FnType,\n ListType,\n LiteralType,\n RecordType,\n Type,\n TypeVar,\n UnionType,\n} from \"./type.types.js\";\nimport { baseOf, DYNAMIC } from \"./type.types.js\";\n\n/** Follow solved variables to the type they stand for. */\nexport function prune(type: Type): Type {\n if (type.kind === \"var\" && type.ref) {\n const resolved = prune(type.ref);\n type.ref = resolved;\n return resolved;\n }\n return type;\n}\n\n/**\n * Make two types equal, solving variables along the way.\n *\n * `dynamic` unifies with anything without constraining it. That is the escape\n * hatch keeping the effectful world from forcing annotations.\n *\n * @returns true when they were made equal. Variables solved before a later step\n * failed stay solved, so a false answer is not a rollback.\n */\nexport function unify(left: Type, right: Type): boolean {\n const a = prune(left);\n const b = prune(right);\n if (a === b) return true;\n if (a.kind === \"dynamic\" || b.kind === \"dynamic\") return true;\n if (a.kind === \"var\") return bind(a, b);\n if (b.kind === \"var\") return bind(b, a);\n if (a.kind === \"union\" || b.kind === \"union\") return unifyUnion(a, b);\n if (a.kind === \"literal\" || b.kind === \"literal\") return unifyLiteral(a, b);\n if (a.kind === \"opaque\" && b.kind === \"opaque\") return a.name === b.name;\n if (a.kind === \"prim\" && b.kind === \"prim\") return a.name === b.name;\n if (a.kind === \"list\" && b.kind === \"list\") return unify(a.element, b.element);\n if (a.kind === \"fn\" && b.kind === \"fn\") return unifyFn(a, b);\n if (a.kind === \"record\" && b.kind === \"record\") return unifyRecord(a, b);\n return false;\n}\n\n/** `\"GET\"` is a string wherever a string is wanted, and itself where it is not. */\nfunction unifyLiteral(a: Type, b: Type): boolean {\n if (a.kind === \"literal\" && b.kind === \"literal\") return a.value === b.value;\n const lit: LiteralType = a.kind === \"literal\" ? a : (b as LiteralType);\n const other = a.kind === \"literal\" ? b : a;\n return other.kind === \"prim\" && other.name === baseOf(lit.value);\n}\n\n/**\n * A union is satisfied by any one of its members.\n *\n * Membership is decided by {@link matches}, which never binds a variable: trying\n * a member and rolling back would leave half-solved variables behind, and a\n * checker that guesses wrong is worse than one that stays quiet.\n */\nfunction unifyUnion(a: Type, b: Type): boolean {\n const [set, other] = a.kind === \"union\" ? [a, b] : [b as UnionType, a];\n if (other.kind === \"union\") {\n return other.members.every((m) => set.members.some((option) => matches(option, m)));\n }\n return set.members.some((option) => matches(option, other));\n}\n\n/**\n * Could these be the same, without deciding anything?\n *\n * Used to pick a union member. Anything unknown, a variable or `dynamic`, counts\n * as compatible, so a union never turns an open question into an error.\n */\nfunction matches(left: Type, right: Type): boolean {\n const a = prune(left);\n const b = prune(right);\n if (a.kind === \"dynamic\" || b.kind === \"dynamic\") return true;\n if (a.kind === \"var\" || b.kind === \"var\") return true;\n if (a.kind === \"union\") return a.members.some((m) => matches(m, b));\n if (b.kind === \"union\") return b.members.some((m) => matches(a, m));\n return matchesConcrete(a, b);\n}\n\nfunction matchesConcrete(a: Type, b: Type): boolean {\n if (a.kind === \"literal\" || b.kind === \"literal\") return unifyLiteral(a, b);\n if (a.kind === \"list\" && b.kind === \"list\") return matches(a.element, b.element);\n if (a.kind === \"opaque\" && b.kind === \"opaque\") return a.name === b.name;\n if (a.kind === \"prim\" && b.kind === \"prim\") return a.name === b.name;\n // Shape is left to real unification; here it is enough that the family agrees.\n return a.kind === b.kind && (a.kind === \"record\" || a.kind === \"fn\");\n}\n\n/** Bind a variable to a type, refusing the infinite type `t = list<t>`. */\nfunction bind(variable: TypeVar, type: Type): boolean {\n if (occurs(variable, type)) return false;\n variable.ref = type;\n return true;\n}\n\nfunction occurs(variable: TypeVar, type: Type): boolean {\n const t = prune(type);\n if (t === variable) return true;\n if (t.kind === \"list\") return occurs(variable, t.element);\n if (t.kind === \"union\") return t.members.some((m) => occurs(variable, m));\n if (t.kind === \"fn\")\n return t.params.some((p) => occurs(variable, p)) || occurs(variable, t.result);\n if (t.kind === \"record\")\n return (\n [...t.fields.values()].some((f) => occurs(variable, f)) ||\n (t.rest !== undefined && occurs(variable, t.rest))\n );\n return false;\n}\n\nfunction unifyFn(a: FnType, b: FnType): boolean {\n // A variadic function accepts any argument list; only its result must agree.\n if (a.variadic || b.variadic) return unify(a.result, b.result);\n const shared = sharedArity(a, b);\n if (shared === undefined) return false;\n for (let at = 0; at < shared; at += 1) {\n if (!unify(a.params[at] as Type, b.params[at] as Type)) return false;\n }\n return unify(a.result, b.result);\n}\n\n/**\n * How many parameters the two sides must agree on. Normally all of them, but a\n * callback offered more than it takes agrees on the ones it took, which is how\n * `people.map(p => p.age)` type-checks against a `map` that also passes an index.\n */\nfunction sharedArity(a: FnType, b: FnType): number | undefined {\n if (a.params.length === b.params.length) return a.params.length;\n const [shorter, longer] = a.params.length < b.params.length ? [a, b] : [b, a];\n const ignorable = longer.ignorableFrom;\n if (ignorable === undefined || shorter.params.length < ignorable) return undefined;\n return shorter.params.length;\n}\n\n/**\n * Records unify field by field. An open record (a map used loosely) tolerates\n * fields the other side lacks; a closed one requires the same shape, except for\n * fields that may be absent.\n */\nfunction unifyRecord(a: RecordType, b: RecordType): boolean {\n const open = a.open || b.open;\n if (a.rest && b.rest && !unify(a.rest, b.rest)) return false;\n for (const [name, type] of a.fields) {\n const other = b.fields.get(name);\n if (other) {\n if (!unify(type, other)) return false;\n } else if (!open && !omittable(type)) {\n return false;\n }\n }\n return open || everyPresent(b, a);\n}\n\n/**\n * May this field simply not be there?\n *\n * `nickname?: string` is read as `string | null`, a value that may be nothing.\n * Absent and null are the same thing to a reader of the map, so a record that\n * left it out still satisfies one that allows it.\n */\nfunction omittable(type: Type): boolean {\n const t = prune(type);\n if (t.kind === \"prim\") return t.name === \"null\";\n return t.kind === \"union\" && t.members.some(omittable);\n}\n\nfunction everyPresent(from: RecordType, into: RecordType): boolean {\n for (const [name, type] of from.fields) {\n if (!into.fields.has(name) && !omittable(type)) return false;\n }\n return true;\n}\n\n/**\n * A field's type on a record. A key nobody listed is whatever the record says\n * its other keys hold, or `dynamic` when it says nothing, which is a loose map.\n */\nexport function fieldType(record: RecordType, name: string): Type | undefined {\n const known = record.fields.get(name);\n if (known) return known;\n if (!record.open) return undefined;\n return record.rest ?? DYNAMIC;\n}\n\nexport type { ListType };\n","import type { TypeContext } from \"./context.js\";\nimport {\n BOOL,\n baseOf,\n callback,\n DYNAMIC,\n type FnType,\n fn,\n list,\n NUMBER,\n prim,\n type RecordType,\n STRING,\n type Type,\n type TypeVar,\n type UnionType,\n union,\n} from \"./type.types.js\";\nimport { prune } from \"./unify.js\";\n\n/**\n * The type of a built-in member: a property such as `length`, or a generic\n * method such as `map`.\n *\n * These are where generics earn their keep. `list<T>.map` is\n * `fn(fn(T, number) -> U) -> list<U>`, with a fresh `U` per use.\n *\n * @returns undefined when the receiver's type has no such member, so the caller\n * can fall back to a record field or to `dynamic`.\n */\nexport function memberType(receiver: Type, name: string, ctx: TypeContext): Type | undefined {\n const t = prune(receiver);\n if (t.kind === \"list\") return listMember(t.element, name, ctx);\n if (t.kind === \"literal\") return memberType(prim(baseOf(t.value)), name, ctx);\n if (t.kind === \"union\") return unionMember(t, name, ctx);\n if (t.kind === \"prim\" && t.name === \"string\") return stringMember(name);\n if (t.kind === \"prim\" && t.name === \"number\") return numberMember(name);\n if (t.kind === \"record\") return recordMember(t, name);\n if (t.kind === \"prim\") return unitMember(t.name, name);\n // A handle answers to what it published, and to nothing else: its inside is\n // none of the reader's business, which is what makes it opaque.\n if (t.kind === \"opaque\") return t.members?.get(name);\n return undefined;\n}\n\n/**\n * A member of a union is a member of every branch, or of none.\n *\n * Offering what only one branch has would be a lie the moment the value is the\n * other one.\n */\nfunction unionMember(type: UnionType, name: string, ctx: TypeContext): Type | undefined {\n const found = type.members.map((member) => memberType(member, name, ctx));\n if (found.some((member) => member === undefined)) return undefined;\n return union(found as Type[]);\n}\n\nconst DURATION: Type = { kind: \"prim\", name: \"duration\" };\nconst SIZE: Type = { kind: \"prim\", name: \"size\" };\nconst PERCENT: Type = { kind: \"prim\", name: \"percent\" };\n\n/**\n * Reading a unit back as a plain number, in whichever unit you want it. The unit\n * exists to keep `300ms + 2mb` from type-checking; once you are printing or\n * comparing against raw data, these are the way across.\n */\nconst UNIT_MEMBERS: Record<string, Record<string, Type>> = {\n duration: { ms: NUMBER, seconds: NUMBER, minutes: NUMBER, hours: NUMBER },\n size: { bytes: NUMBER, kb: NUMBER, mb: NUMBER, gb: NUMBER },\n percent: { ratio: NUMBER, percent: NUMBER, of: fn([NUMBER], NUMBER) },\n};\n\nfunction unitMember(unit: string, name: string): Type | undefined {\n return UNIT_MEMBERS[unit]?.[name];\n}\n\nfunction listMember(element: Type, name: string, ctx: TypeContext): Type | undefined {\n const u = (): TypeVar => ctx.fresh();\n const self = list(element);\n /** Every list callback is handed the index too; `p => p.age` may ignore it. */\n const over = (result: Type): FnType => callback([element, NUMBER], result, 1);\n const predicate = over(BOOL);\n const table: Record<string, () => Type> = {\n len: () => NUMBER,\n first: () => element,\n last: () => element,\n reverse: () => self,\n flatten: () => list(DYNAMIC),\n isEmpty: () => BOOL,\n sum: () => NUMBER,\n average: () => NUMBER,\n min: () => NUMBER,\n max: () => NUMBER,\n toMap: () => DYNAMIC,\n // Selecting keeps the element type; only the shape of the result changes.\n take: () => fn([NUMBER], self),\n drop: () => fn([NUMBER], self),\n takeLast: () => fn([NUMBER], self),\n dropLast: () => fn([NUMBER], self),\n takeWhile: () => fn([predicate], self),\n dropWhile: () => fn([predicate], self),\n distinct: () => self,\n distinctBy: () => fn([over(u())], self),\n sortBy: () => fn([over(u())], self),\n minBy: () => fn([over(NUMBER)], element),\n maxBy: () => fn([over(NUMBER)], element),\n sumBy: () => fn([over(NUMBER)], NUMBER),\n flatMap: () => flatMapType(over, u()),\n // Grouping changes the shape: a list becomes a map, or a list of lists.\n groupBy: () => fn([over(DYNAMIC)], DYNAMIC),\n countBy: () => fn([over(DYNAMIC)], DYNAMIC),\n keyBy: () => fn([over(DYNAMIC)], DYNAMIC),\n partition: () => fn([predicate], list(self)),\n chunk: () => fn([NUMBER], list(self)),\n windows: () => fn([NUMBER], list(self)),\n pairwise: () => list(self),\n zip: () => fn([list(DYNAMIC)], list(list(DYNAMIC))),\n unzip: () => list(list(DYNAMIC)),\n map: () => mapType(over, u()),\n filter: () => fn([predicate], list(element)),\n find: () => fn([predicate], element),\n some: () => fn([predicate], BOOL),\n every: () => fn([predicate], BOOL),\n forEach: () => fn([over(DYNAMIC)], NULL_VOID),\n reduce: () => reduceType(element, u(), NUMBER),\n contains: () => fn([element], BOOL),\n indexOf: () => fn([element], NUMBER),\n join: () => fn([STRING], STRING),\n sort: () => fn([fn([element, element], NUMBER)], list(element)),\n slice: () => fn([NUMBER, NUMBER], list(element)),\n concat: () => fn([list(element)], list(element)),\n push: () => fn([element], list(element)),\n };\n return table[name]?.();\n}\n\nconst NULL_VOID = { kind: \"prim\", name: \"null\" } as const;\n\n/** The callback shape a list method hands its element to. */\ntype Over = (result: Type) => FnType;\n\nfunction mapType(over: Over, into: Type): Type {\n return fn([over(into)], list(into));\n}\n\nfunction flatMapType(over: Over, into: Type): Type {\n return fn([over(list(into))], list(into));\n}\n\n/** `reduce` hands over the running total, the item, and the index. */\nfunction reduceType(element: Type, acc: Type, index: Type): Type {\n return fn([callback([acc, element, index], acc, 2), acc], acc);\n}\n\nfunction stringMember(name: string): Type | undefined {\n const table: Record<string, Type> = {\n len: NUMBER,\n upper: STRING,\n lower: STRING,\n trim: STRING,\n reverse: STRING,\n toNumber: NUMBER,\n split: fn([STRING], list(STRING)),\n replace: fn([STRING, STRING], STRING),\n contains: fn([STRING], BOOL),\n startsWith: fn([STRING], BOOL),\n endsWith: fn([STRING], BOOL),\n slice: fn([NUMBER, NUMBER], STRING),\n repeat: fn([NUMBER], STRING),\n padStart: fn([NUMBER, STRING], STRING),\n padEnd: fn([NUMBER, STRING], STRING),\n indexOf: fn([STRING], NUMBER),\n words: list(STRING),\n lines: list(STRING),\n chars: list(STRING),\n capitalize: STRING,\n title: STRING,\n slugify: STRING,\n isEmpty: BOOL,\n isBlank: BOOL,\n trimStart: STRING,\n trimEnd: STRING,\n count: fn([STRING], NUMBER),\n matches: fn([STRING], list(STRING)),\n test: fn([STRING], BOOL),\n before: fn([STRING], STRING),\n after: fn([STRING], STRING),\n ensureStart: fn([STRING], STRING),\n ensureEnd: fn([STRING], STRING),\n };\n return table[name];\n}\n\nfunction numberMember(name: string): Type | undefined {\n const table: Record<string, Type> = {\n abs: NUMBER,\n floor: NUMBER,\n ceil: NUMBER,\n sign: NUMBER,\n sqrt: NUMBER,\n isEven: BOOL,\n isOdd: BOOL,\n round: fn([NUMBER], NUMBER),\n toFixed: fn([NUMBER], STRING),\n clamp: fn([NUMBER, NUMBER], NUMBER),\n pow: fn([NUMBER], NUMBER),\n times: list(NUMBER),\n toString: STRING,\n };\n return table[name] ?? TO_UNIT[name];\n}\n\n/**\n * Reading a plain number as a unit, the way back from {@link UNIT_MEMBERS}. For\n * every `X` a unit answers to, a number answers to `toX`.\n */\nconst TO_UNIT: Record<string, Type> = {\n toMs: DURATION,\n toSeconds: DURATION,\n toMinutes: DURATION,\n toHours: DURATION,\n toBytes: SIZE,\n toKb: SIZE,\n toMb: SIZE,\n toGb: SIZE,\n toRatio: PERCENT,\n toPercent: PERCENT,\n};\n\nfunction recordMember(receiver: RecordType, name: string): Type | undefined {\n const table: Record<string, Type> = {\n keys: list(STRING),\n values: list(DYNAMIC),\n entries: list(DYNAMIC),\n len: NUMBER,\n has: fn([STRING], BOOL),\n get: fn([STRING], DYNAMIC),\n merge: fn([DYNAMIC], DYNAMIC),\n mergeDeep: fn([DYNAMIC], DYNAMIC),\n // A map's callbacks are handed the key alongside the value, or the other\n // way round for `mapKeys`. Taking the second one is optional.\n mapValues: fn([callback([DYNAMIC, STRING], DYNAMIC, 1)], DYNAMIC),\n mapKeys: fn([callback([STRING, DYNAMIC], STRING, 1)], DYNAMIC),\n filterValues: fn([callback([DYNAMIC, STRING], BOOL, 1)], DYNAMIC),\n pick: fn([STRING], DYNAMIC),\n omit: fn([STRING], DYNAMIC),\n invert: DYNAMIC,\n isEmpty: BOOL,\n getPath: fn([STRING], DYNAMIC),\n hasPath: fn([STRING], BOOL),\n };\n return receiver.fields.has(name) ? undefined : table[name];\n}\n\n/**\n * A member as the language reads it: the built-in when there is one, otherwise\n * the field the map carries.\n *\n * {@link memberType} alone stops at built-ins so inference can report an unknown\n * field. Tooling wants the answer, not the distinction.\n */\nexport function resolveMember(receiver: Type, name: string, ctx: TypeContext): Type | undefined {\n const built = memberType(receiver, name, ctx);\n if (built) return built;\n const t = prune(receiver);\n return t.kind === \"record\" ? t.fields.get(name) : undefined;\n}\n","import type { TypeContext } from \"./context.js\";\nimport type { Type } from \"./type.types.js\";\nimport { prune } from \"./unify.js\";\n\n/**\n * A type scheme: a type universally quantified over some variables. This is what\n * makes generics real. `fn id(x) => x` becomes `∀t. t -> t`, and every call\n * instantiates `t` afresh, so `id(1)` and `id(\"a\")` both check.\n */\nexport interface Scheme {\n readonly quantified: readonly number[];\n readonly type: Type;\n}\n\n/** A non-generic scheme: a plain type with nothing quantified. */\nexport function mono(type: Type): Scheme {\n return { quantified: [], type };\n}\n\n/** Collect the ids of the unsolved variables reachable from a type. */\nexport function freeVars(type: Type, into: Set<number> = new Set()): Set<number> {\n const t = prune(type);\n if (t.kind === \"var\") into.add(t.id);\n else if (t.kind === \"list\") freeVars(t.element, into);\n else if (t.kind === \"fn\") {\n for (const param of t.params) freeVars(param, into);\n freeVars(t.result, into);\n } else if (t.kind === \"record\") {\n for (const field of t.fields.values()) freeVars(field, into);\n }\n return into;\n}\n\n/**\n * Generalise a type over the variables free in it but not in the environment.\n * Those become the scheme's type parameters.\n */\nexport function generalize(type: Type, envFree: ReadonlySet<number>): Scheme {\n const quantified = [...freeVars(type)].filter((id) => !envFree.has(id));\n return { quantified, type };\n}\n\n/** Instantiate a scheme with fresh variables for each quantified parameter. */\nexport function instantiate(scheme: Scheme, ctx: TypeContext): Type {\n if (scheme.quantified.length === 0) return scheme.type;\n const fresh = new Map(scheme.quantified.map((id) => [id, ctx.fresh() as Type]));\n return substitute(scheme.type, fresh);\n}\n\nfunction substitute(type: Type, mapping: ReadonlyMap<number, Type>): Type {\n const t = prune(type);\n switch (t.kind) {\n case \"var\":\n return mapping.get(t.id) ?? t;\n case \"list\":\n return { kind: \"list\", element: substitute(t.element, mapping) };\n case \"fn\":\n return {\n kind: \"fn\",\n params: t.params.map((param) => substitute(param, mapping)),\n result: substitute(t.result, mapping),\n };\n case \"record\":\n return { kind: \"record\", open: t.open, fields: substituteFields(t.fields, mapping) };\n default:\n return t;\n }\n}\n\nfunction substituteFields(\n fields: ReadonlyMap<string, Type>,\n mapping: ReadonlyMap<number, Type>,\n): Map<string, Type> {\n return new Map([...fields].map(([name, field]) => [name, substitute(field, mapping)]));\n}\n","import type { RecordType, Type } from \"./type.types.js\";\nimport { prune } from \"./unify.js\";\n\nconst LETTERS = \"abcdefghijklmnopqrstuvwxyz\";\n\n/** Render one type for a hover or a diagnostic, naming variables `a`, `b`, … */\nexport function showType(type: Type): string {\n return render(type, new Map());\n}\n\n/**\n * Several types that belong together, named as one.\n *\n * Rendering them one at a time restarts the alphabet each time, so the two\n * unrelated parameters of `fn (nome, idade)` would both come back as `a`. That\n * says they are the same type, which is the opposite of what is known.\n */\nexport function showTypes(types: readonly Type[]): string[] {\n const names = new Map<number, string>();\n return types.map((type) => render(type, names));\n}\n\nfunction render(type: Type, names: Map<number, string>): string {\n const t = prune(type);\n switch (t.kind) {\n case \"prim\":\n return t.name;\n case \"dynamic\":\n return \"dynamic\";\n case \"var\":\n return nameOf(t.id, names);\n case \"list\":\n return `list<${render(t.element, names)}>`;\n case \"fn\":\n return `fn(${t.params.map((p) => render(p, names)).join(\", \")}) -> ${render(t.result, names)}`;\n case \"record\":\n return renderRecord(t, names);\n case \"literal\":\n return typeof t.value === \"string\" ? `\"${t.value}\"` : String(t.value);\n case \"union\":\n return t.members.map((m) => render(m, names)).join(\" | \");\n case \"opaque\":\n return t.name;\n }\n}\n\n/** Named keys read as a shape; unnamed ones read as the map they are. */\nfunction renderRecord(type: RecordType, names: Map<number, string>): string {\n const rest = type.rest ? `map<${render(type.rest, names)}>` : undefined;\n if (type.fields.size === 0) return rest ?? \"{}\";\n const body = [...type.fields]\n .map(([name, field]) => `${name}: ${render(field, names)}`)\n .join(\", \");\n return `{ ${body}${rest ? `, …: ${render(type.rest as Type, names)}` : \"\"} }`;\n}\n\nfunction nameOf(id: number, names: Map<number, string>): string {\n const existing = names.get(id);\n if (existing) return existing;\n const index = names.size;\n const name = index < LETTERS.length ? (LETTERS[index] as string) : `t${index}`;\n names.set(id, name);\n return name;\n}\n","import type { SingleType, TypeRef } from \"../generated/ast.js\";\nimport { isNamedType } from \"../generated/ast.js\";\nimport type { TypeCatalog } from \"./catalog.types.js\";\nimport type { TypeContext } from \"./context.js\";\nimport type { NamedTypes } from \"./named-types.js\";\nimport { DYNAMIC, fn, list, literal, prim, type Type, union } from \"./type.types.js\";\n\nconst PRIMS = new Set([\"number\", \"string\", \"bool\", \"null\", \"void\"]);\n\n/** Everything resolving a written annotation may need to look something up. */\nexport interface RefScope {\n ctx: TypeContext;\n named: NamedTypes;\n /** Where a qualified name like `http.Request` is found. */\n catalog?: TypeCatalog;\n}\n\n/**\n * Read a written annotation (`list<number>`, `User`, `http.Request`,\n * `\"GET\" | \"POST\"`) into a type. An unknown name stays `dynamic`, so an\n * annotation never adds friction: being wrong about a name must not be worse\n * than saying nothing.\n */\nexport function typeRefToType(args: RefScope & { ref: TypeRef | undefined }): Type {\n if (!args.ref) return args.ctx.fresh();\n const members = args.ref.members.map((single) => singleToType({ ...args, single }));\n if (members.length === 0) return DYNAMIC;\n return union(members as Type[]);\n}\n\nfunction singleToType(args: RefScope & { single: SingleType }): Type {\n const { single } = args;\n // A `SingleType` that is not a name is a written-out literal such as `\"GET\"`,\n // and it means that one value. Widening it to `string` would enforce nothing.\n if (!isNamedType(single)) return literalOf(single);\n const name = single.name;\n const generic = genericType(name, single, args);\n if (generic) return generic;\n if (PRIMS.has(name)) return prim(name as \"number\");\n return args.named.get(name) ?? args.catalog?.typeOf(name) ?? DYNAMIC;\n}\n\n/** `\"GET\"` written as a type. The quotes are the grammar's, not the value's. */\nfunction literalOf(single: SingleType): Type {\n const written = (single as { value?: string }).value ?? \"\";\n return literal(written.replace(/^[\"']|[\"']$/g, \"\"));\n}\n\nfunction genericType(\n name: string,\n single: SingleType & { args?: TypeRef[] },\n args: RefScope,\n): Type | undefined {\n // `ref` last, deliberately: the scope threaded down here still carries the\n // *outer* annotation, and spreading it afterwards would hand each argument its\n // own parent, leaving `list<number>` reading itself forever.\n const params = (single.args ?? []).map((ref) => typeRefToType({ ...args, ref }));\n if (name === \"list\") return list(params[0] ?? DYNAMIC);\n if (name === \"fn\") return fn(params.slice(0, -1), params[params.length - 1] ?? DYNAMIC);\n if (name === \"map\") return DYNAMIC;\n return undefined;\n}\n","import { combine, isUnitValue, type Numeric, parseNumber } from \"../units/index.js\";\nimport { BOOL, NUMBER, prim, type Type } from \"./type.types.js\";\n\n/** One value of each kind, to ask `combine` what an operator does with them. */\nconst SAMPLES: Record<string, Numeric> = {\n number: 1,\n duration: { kind: \"duration\", ms: 1 },\n size: { kind: \"size\", bytes: 1 },\n percent: { kind: \"percent\", ratio: 1 },\n};\n\n/** The type a NUMBER lexeme has: `200` is a number, `300ms` a duration, `2mb` a size. */\nexport function literalType(raw: string): Type {\n const value = parseNumber(raw);\n return typeof value === \"number\" ? NUMBER : prim(value.kind);\n}\n\n/** What an operator produces, or that its operands cannot be combined. */\nexport type UnitOutcome = { ok: true; type: Type } | { ok: false };\n\n/**\n * The type `left op right` produces, decided by the very `combine` the evaluator\n * uses, handed one value of each kind rather than the real ones.\n *\n * Reusing it is the point. Unit compatibility is a single rule (`300ms + 1s`\n * yes, `300ms + 2mb` no), and writing it a second time for the checker would be\n * two rules that agree only until one of them changes.\n *\n * @returns undefined when either side is not a concrete number or unit: a type\n * variable still to be solved, `dynamic`, a string. Those keep the ordinary\n * path, which is what lets `fn double(x) => x * 2` learn that `x` is a number.\n */\nexport function combinedType(op: string, left: Type, right: Type): UnitOutcome | undefined {\n const a = sampleOf(left);\n const b = sampleOf(right);\n if (a === undefined || b === undefined) return undefined;\n const result = combine({ op, left: a, right: b });\n return result.ok ? { ok: true, type: typeOfValue(result.value) } : { ok: false };\n}\n\nfunction sampleOf(type: Type): Numeric | undefined {\n return type.kind === \"prim\" ? SAMPLES[type.name] : undefined;\n}\n\nfunction typeOfValue(value: Numeric | boolean): Type {\n if (typeof value === \"boolean\") return BOOL;\n if (isUnitValue(value)) return prim(value.kind);\n return NUMBER;\n}\n","import type { AstNode } from \"langium\";\nimport { dottedPath } from \"../ast/index.js\";\nimport type {\n Binary,\n Call,\n DecoDecl,\n Expr,\n FnBody,\n Index,\n ListLit,\n MapLit,\n Member,\n Param,\n ParamList,\n StringLit,\n Ternary,\n TypeRef,\n Unary,\n} from \"../generated/ast.js\";\nimport { scanInterpolations } from \"../interpolation/index.js\";\nimport { parseExpression } from \"../parse/parse-expression.js\";\nimport { callType } from \"./action-signature.js\";\nimport { memberType } from \"./builtins.js\";\nimport type { TypeCatalog } from \"./catalog.types.js\";\nimport type { TypeContext } from \"./context.js\";\nimport type { NamedTypes } from \"./named-types.js\";\nimport { instantiate, mono } from \"./scheme.js\";\nimport type { ParamSeeds } from \"./seed-params.js\";\nimport type { ValueSeeds } from \"./seed-values.js\";\nimport { showType } from \"./show.js\";\nimport { BOOL, DYNAMIC, fn, list, NULL, NUMBER, record, STRING, type Type } from \"./type.types.js\";\nimport type { TypeEnv } from \"./type-env.js\";\nimport { typeRefToType } from \"./type-ref.js\";\nimport { fieldType, prune, unify } from \"./unify.js\";\nimport { combinedType, literalType } from \"./unit-types.js\";\n\n/** One `${…}`: what it parsed to, and whether the source had to be repaired. */\nexport interface Slot {\n expr: Expr | undefined;\n guess: boolean;\n}\n\n/** Everything inference threads through: fresh vars, diagnostics, named types. */\nexport interface Infer {\n ctx: TypeContext;\n named: NamedTypes;\n /** What the loaded plugins contribute. Absent means \"the file stands alone\". */\n catalog?: TypeCatalog;\n /** What the callers said a named `fn` takes, found by the first pass. */\n seeds?: ParamSeeds;\n /** What the file's own top-level values hold, so a `fn` body can read them. */\n values?: ValueSeeds;\n /** The types of the names this file imported, from the files it named. */\n imports?: ReadonlyMap<string, Type>;\n /** True during that first pass: keep functions monomorphic so calls reach them. */\n seeding?: boolean;\n /** Every expression's inferred type, for hover. Omit it to save the work. */\n types?: Map<AstNode, Type>;\n /** Per string literal, the expression parsed from each of its ${…} slots. */\n slots?: Map<AstNode, (Expr | undefined)[]>;\n /** Shared across the checker's passes, so a `${…}` is parsed once per document. */\n parsed?: Map<AstNode, Slot[]>;\n /** The `deco`s reachable here, local and imported, by the name an `@` writes. */\n decos?: ReadonlyMap<string, DecoDecl>;\n}\n\n/** Infer an expression's type, recording it for hover and reporting mismatches. */\nexport function inferExpr(expr: Expr, env: TypeEnv, infer: Infer): Type {\n const type = inferKind(expr, env, infer);\n infer.types?.set(expr, type);\n return type;\n}\n\nfunction inferKind(expr: Expr, env: TypeEnv, infer: Infer): Type {\n switch (expr.$type) {\n case \"NumberLit\":\n return literalType(expr.raw);\n case \"StringLit\":\n return inferString(expr, env, infer);\n case \"BoolLit\":\n return BOOL;\n case \"NullLit\":\n return NULL;\n case \"InstantLit\":\n return { kind: \"prim\", name: \"instant\" };\n case \"Ref\":\n return inferRef(expr.name, env, infer);\n case \"Member\":\n return inferMember(expr, env, infer);\n case \"Call\":\n return inferCall(expr, env, infer);\n case \"Index\":\n return inferIndex(expr, env, infer);\n case \"Binary\":\n return inferBinary(expr, env, infer);\n case \"Unary\":\n return inferUnary(expr, env, infer);\n case \"Ternary\":\n return inferTernary(expr, env, infer);\n case \"ListLit\":\n return inferList(expr, env, infer);\n case \"MapLit\":\n return inferMap(expr, env, infer);\n case \"FnExpr\":\n return inferFn({ params: expr.params, body: expr.body, returns: expr.returns }, env, infer);\n default:\n return DYNAMIC;\n }\n}\n\n/** A name the checker does not know types as `dynamic`; it never resolves names. */\nfunction inferRef(name: string, env: TypeEnv, infer: Infer): Type {\n const scheme = env.lookup(name);\n return scheme ? instantiate(scheme, infer.ctx) : DYNAMIC;\n}\n\n/**\n * A string is text, but each `${…}` inside it is code. It is parsed apart from\n * the document, so the parsed expressions are kept: they are the only handle the\n * editor has on nodes that inference typed but the document's tree lacks.\n */\nfunction inferString(expr: StringLit, env: TypeEnv, infer: Infer): Type {\n const slots = parsedSlots(expr, infer);\n for (const slot of slots) {\n if (slot.expr) inferExpr(contain(slot.expr, expr), env, slot.guess ? quiet(infer) : infer);\n }\n if (slots.length > 0)\n infer.slots?.set(\n expr,\n slots.map((slot) => slot.expr),\n );\n return STRING;\n}\n\n/**\n * The expressions inside one string, parsed once per document.\n *\n * Parsing a `${…}` means running the parser again, and a file may hold hundreds\n * of them; inference walks the document more than once, and the editor walks it\n * on every keystroke. Keyed by the string's own node, so two strings that happen\n * to read alike never share: the parsed expression is told which string contains\n * it, and a shared one would point at the wrong place.\n */\nfunction parsedSlots(expr: StringLit, infer: Infer): Slot[] {\n const known = infer.parsed?.get(expr);\n if (known) return known;\n const text = expr.$cstNode?.text ?? expr.value;\n const slots = scanInterpolations(text).map((slot) => slotExpr(slot.source));\n infer.parsed?.set(expr, slots);\n return slots;\n}\n\n/** A dot with no name after it yet: what half-typed member access looks like. */\nconst UNFINISHED = /\\.(?![A-Za-z_])/g;\n\n/**\n * The expression a placeholder holds.\n *\n * Half-typed code such as `xs.map(fn (p) => p.` does not parse, and that is\n * precisely when the editor is asked what `p` is. So one repair is attempted:\n * drop the member access still being written.\n */\nfunction slotExpr(source: string): Slot {\n const whole = parseExpression(source);\n if (whole) return { expr: whole, guess: false };\n // A space, not nothing: every other character keeps the offset the editor\n // will look it up by.\n const repaired = source.replace(UNFINISHED, \" \");\n return { expr: repaired === source ? undefined : parseExpression(repaired), guess: true };\n}\n\n/** Infer without accusing: a repaired expression is a guess, not what was written. */\nfunction quiet(infer: Infer): Infer {\n return { ...infer, ctx: { ...infer.ctx, mismatches: [] } };\n}\n\n/**\n * Say in the tree what the source already says: the expression is written\n * inside the string. With a container, looking a name up from inside `${…}`\n * walks out into the scope the string sits in.\n */\nfunction contain(child: Expr, parent: StringLit): Expr {\n Object.defineProperty(child, \"$container\", { value: parent, configurable: true });\n return child;\n}\n\nfunction inferMember(expr: Member, env: TypeEnv, infer: Infer): Type {\n const receiver = prune(inferExpr(expr.receiver, env, infer));\n if (receiver.kind === \"dynamic\") return DYNAMIC;\n const built = memberType(receiver, expr.member, infer.ctx);\n if (built) return built;\n if (receiver.kind === \"record\") return recordField(receiver, expr, infer);\n return unknownMember(receiver, expr, infer);\n}\n\n/**\n * The kinds whose members are all known: a string, a list, a handle, a literal.\n *\n * There is no shape one of these could turn out to have later, so answering\n * `dynamic` for a member it does not carry is not caution but a wrong answer.\n * Anything still open, `dynamic` above all, is left alone.\n */\nconst CLOSED_MEMBERS = new Set([\"list\", \"prim\", \"opaque\", \"literal\"]);\n\nfunction unknownMember(receiver: Type, expr: Member, infer: Infer): Type {\n if (!CLOSED_MEMBERS.has(receiver.kind)) return DYNAMIC;\n infer.ctx.mismatches.push({\n node: expr,\n expected: receiver,\n actual: DYNAMIC,\n note: `has no member \"${expr.member}\"`,\n });\n return DYNAMIC;\n}\n\nfunction recordField(\n receiver: Extract<Type, { kind: \"record\" }>,\n expr: Member,\n infer: Infer,\n): Type {\n const found = fieldType(receiver, expr.member);\n if (found) return found;\n infer.ctx.mismatches.push({\n node: expr,\n expected: receiver,\n actual: DYNAMIC,\n note: `has no field \"${expr.member}\"`,\n });\n return DYNAMIC;\n}\n\n/**\n * A call, whichever of the two the language spells.\n *\n * `http.get(\"url\")` and `http.get \"url\"` are the same call and carry the same\n * type. The bracketed form is tried as a verb first, since reading it as an\n * ordinary call on whatever `http.get` evaluates to would answer `dynamic` for\n * every verb written in the form most people reach for.\n */\nfunction inferCall(expr: Call, env: TypeEnv, infer: Infer): Type {\n const verb = verbCall(expr, env, infer);\n if (verb) return verb;\n const callee = prune(inferExpr(expr.callee, env, infer));\n const args = (expr.args?.args ?? []).map((arg) => inferExpr(arg.value, env, infer));\n if (callee.kind === \"dynamic\") return DYNAMIC;\n const result = infer.ctx.fresh();\n expect(infer, expr, callee, fn(args, result));\n return result;\n}\n\n/** What a plugin verb gives back, when the callee names one. */\nfunction verbCall(expr: Call, env: TypeEnv, infer: Infer): Type | undefined {\n const target = dottedPath(expr.callee);\n if (!target || !infer.catalog?.signatureOf(target)) return undefined;\n const args = (expr.args?.args ?? []).map((arg) => arg.value);\n return callType({ target, args }, env, infer);\n}\n\nfunction inferIndex(expr: Index, env: TypeEnv, infer: Infer): Type {\n const receiver = prune(inferExpr(expr.receiver, env, infer));\n inferExpr(expr.index, env, infer);\n if (receiver.kind === \"list\") return receiver.element;\n return DYNAMIC;\n}\n\nconst ARITHMETIC = new Set([\"+\", \"-\", \"*\", \"/\", \"%\"]);\nconst COMPARISON = new Set([\"<\", \">\", \"<=\", \">=\"]);\n\nfunction inferBinary(expr: Binary, env: TypeEnv, infer: Infer): Type {\n const op = expr.operator;\n const left = inferExpr(expr.left, env, infer);\n const right = inferExpr(expr.right, env, infer);\n if (ARITHMETIC.has(op) || COMPARISON.has(op)) return arithmetic({ infer, expr, op, left, right });\n if (op === \"&&\" || op === \"||\") return BOOL;\n if (op === \"??\") return unify(left, right) ? left : DYNAMIC;\n return BOOL;\n}\n\n/**\n * Arithmetic and comparison, unit-aware.\n *\n * When both sides are known (`300ms` and `1s`, or `2mb` and `5`) the unit rule\n * decides, and a mismatch is a compile error rather than something the run finds\n * out later. When either side is still an unsolved variable this falls back to\n * plain numbers, which is what teaches `fn double(x) => x * 2` that `x` is one.\n */\nfunction arithmetic(args: {\n infer: Infer;\n expr: Binary;\n op: string;\n left: Type;\n right: Type;\n}): Type {\n const { infer, expr, op, left, right } = args;\n const combined = combinedType(op, prune(left), prune(right));\n if (!combined) return numeric(infer, expr, left, right, COMPARISON.has(op));\n if (combined.ok) return combined.type;\n mismatched(infer, expr, prune(left), prune(right), op);\n return DYNAMIC;\n}\n\nfunction mismatched(infer: Infer, node: AstNode, left: Type, right: Type, op: string): void {\n infer.ctx.mismatches.push({\n node,\n expected: left,\n actual: right,\n unit: true,\n // The sentence the evaluator raises, so a mismatch reads the same whether\n // the checker or the run finds it.\n note: `Cannot combine ${showType(left)} with ${showType(right)} using \"${op}\".`,\n });\n}\n\nfunction numeric(infer: Infer, node: AstNode, left: Type, right: Type, compare = false): Type {\n expect(infer, node, left, NUMBER);\n expect(infer, node, right, NUMBER);\n return compare ? BOOL : NUMBER;\n}\n\nfunction inferUnary(expr: Unary, env: TypeEnv, infer: Infer): Type {\n const operand = inferExpr(expr.operand, env, infer);\n if (expr.operator === \"!\") return BOOL;\n expect(infer, expr, operand, NUMBER);\n return NUMBER;\n}\n\nfunction inferTernary(expr: Ternary, env: TypeEnv, infer: Infer): Type {\n inferExpr(expr.condition, env, infer);\n const then = inferExpr(expr.then, env, infer);\n const otherwise = inferExpr(expr.otherwise, env, infer);\n return unify(then, otherwise) ? then : DYNAMIC;\n}\n\nfunction inferList(expr: ListLit, env: TypeEnv, infer: Infer): Type {\n const element = infer.ctx.fresh() as Type;\n for (const item of expr.items) expect(infer, item, inferExpr(item, env, infer), element);\n return list(element);\n}\n\nfunction inferMap(expr: MapLit, env: TypeEnv, infer: Infer): Type {\n const fields = new Map<string, Type>();\n for (const entry of expr.entries) fields.set(entry.key, inferExpr(entry.value, env, infer));\n return record(fields);\n}\n\n/**\n * What a parameter is: what it was annotated with, what the callers said, or an\n * open question for the body to answer.\n */\nfunction paramType(param: Param, infer: Infer): Type {\n if (param.paramType) {\n const { ctx, named, catalog } = infer;\n return typeRefToType({ ref: param.paramType, ctx, named, catalog });\n }\n return infer.seeds?.get(param) ?? infer.ctx.fresh();\n}\n\n/** Infer a function type: params, body, and an inferred (or annotated) result. */\nexport function inferFn(\n decl: { params?: ParamList; body: FnBody; returns?: TypeRef },\n env: TypeEnv,\n infer: Infer,\n): Type {\n const params = (decl.params?.params ?? []).map((param) => ({\n node: param,\n name: param.name,\n type: paramType(param, infer),\n }));\n let body = env;\n for (const param of params) body = body.with(param.name, mono(param.type));\n const result = inferBody(decl.body, body, infer);\n // Record each parameter once the body has constrained it, so hover and\n // completion know what `p` is inside `xs.filter(fn (p) => …)`.\n for (const param of params) infer.types?.set(param.node, param.type);\n if (decl.returns)\n expect(\n infer,\n decl.body,\n result,\n typeRefToType({\n ref: decl.returns,\n ctx: infer.ctx,\n named: infer.named,\n catalog: infer.catalog,\n }),\n );\n return fn(\n params.map((param) => param.type),\n result,\n );\n}\n\n/**\n * A body's locals, then the expression it ends with.\n *\n * That last expression may be missing. A half-written `fn` is the normal state\n * of a file being edited, and it is exactly then that the editor asks what\n * things are, so missing means unknown rather than broken.\n */\nfunction inferBody(body: FnBody, env: TypeEnv, infer: Infer): Type {\n let scope = env;\n for (const local of body.locals) {\n if (!local.value) continue;\n scope = scope.with(local.name, mono(inferExpr(local.value, scope, infer)));\n }\n return body.result ? inferExpr(body.result, scope, infer) : DYNAMIC;\n}\n\n/** Unify `actual` with `expected`, recording a mismatch on the node if it fails. */\nexport function expect(infer: Infer, node: AstNode, actual: Type, expected: Type): void {\n if (!unify(actual, expected)) report(infer, node, expected, actual);\n}\n\nfunction report(infer: Infer, node: AstNode, expected: Type, actual: Type, _note?: string): void {\n infer.ctx.mismatches.push({ node, expected, actual });\n}\n","import { splitCall } from \"../ast/index.js\";\nimport type { Expr, MapLit } from \"../generated/ast.js\";\nimport type { Infer } from \"./infer.js\";\nimport { inferExpr } from \"./infer.js\";\nimport type { FnType, Type } from \"./type.types.js\";\nimport { DYNAMIC } from \"./type.types.js\";\nimport type { TypeEnv } from \"./type-env.js\";\nimport { unify } from \"./unify.js\";\n\n/** A verb call, however it was written: bound to a name, or standing alone. */\nexport interface CallSite {\n target: string;\n args: readonly Expr[];\n opts?: MapLit;\n}\n\n/**\n * What a verb gives back, and what it makes of the arguments on the way.\n *\n * This is where a typed world meets an untyped one. With no signature the result\n * is `dynamic` and nothing is checked, because the language has to keep working\n * with plugins that never say a word about types. With one, the arguments are\n * unified against it, which is how `http.on api req => …` learns that `req` is a\n * request without anyone writing it down.\n */\nexport function callType(site: CallSite, env: TypeEnv, infer: Infer): Type {\n const signature = infer.catalog?.signatureOf(site.target);\n // The trailing `{ … }` is the options in both spellings, so it is told apart\n // here too. Otherwise `http.get(url, { … })` would line the map up against the\n // URL's parameter and the checker would disagree with the runtime.\n const split = splitCall(site.args, signature?.params.length ?? 0);\n const args = split.args.map((arg) => inferExpr(arg, env, infer));\n const opts = site.opts ?? split.opts;\n if (opts) inferExpr(opts, env, infer);\n if (!signature) return DYNAMIC;\n applyParams(signature, args);\n return signature.result;\n}\n\n/**\n * Line the arguments up with the parameters, quietly.\n *\n * A mismatch here is not reported: the options map, the trailing arguments and\n * the shorthands mean a verb can be called in more shapes than one signature\n * describes. The purpose is to *inform* the argument types, a callback's\n * parameters above all, not to police the call.\n */\nfunction applyParams(signature: FnType, args: readonly Type[]): void {\n const width = Math.min(signature.params.length, args.length);\n for (let at = 0; at < width; at += 1) {\n unify(args[at] as Type, signature.params[at] as Type);\n }\n}\n","import { callArgs } from \"../ast/index.js\";\nimport type { Block, Expr, FragmentDecl, Statement } from \"../generated/ast.js\";\nimport * as ast from \"../generated/ast.js\";\nimport { callType } from \"./action-signature.js\";\nimport { expect, type Infer, inferExpr } from \"./infer.js\";\nimport { mono } from \"./scheme.js\";\nimport { DYNAMIC, type Type } from \"./type.types.js\";\nimport type { TypeEnv } from \"./type-env.js\";\nimport { typeRefToType } from \"./type-ref.js\";\nimport { prune } from \"./unify.js\";\n\n/** Walk a statement, inferring the expressions it contains under `env`. */\nexport function checkStatement(node: Statement, env: TypeEnv, infer: Infer): TypeEnv {\n if (ast.isLetStmt(node)) return bindLet(node, env, infer);\n if (ast.isExpectStmt(node)) return expectStmt(node, env, infer);\n if (ast.isActionCall(node)) return actionArgs(node, env, infer);\n if (ast.isRunStmt(node)) return runArgs(node, env, infer);\n if (ast.isIfStmt(node)) return ifStmt(node, env, infer);\n if (ast.isForEachStmt(node)) return forEach(node, env, infer);\n if (ast.isWhileStmt(node)) return blockAfterCond(node.cond, node.body, env, infer);\n if (ast.isRepeatStmt(node)) return repeat(node, env, infer);\n if (ast.isTryStmt(node)) return tryStmt(node, env, infer);\n if (ast.isReturnStmt(node)) return maybeInfer(node.value, env, infer);\n if (ast.isStepDecl(node) || ast.isGroupDecl(node)) return nested(node.body, env, infer);\n if (ast.isParallelStmt(node) || ast.isRaceStmt(node)) return nested(node.body, env, infer);\n if (ast.isLifecycleDecl(node)) return nested(node.body, env, infer);\n return env;\n}\n\n/** Check a nested block, then keep the outer scope: its bindings do not escape. */\nfunction nested(block: Block, env: TypeEnv, infer: Infer): TypeEnv {\n checkBlock(block, env, infer);\n return env;\n}\n\n/** A `let`/`const` binds its inferred type; the binding is visible from here on. */\nfunction bindLet(node: ast.LetStmt, env: TypeEnv, infer: Infer): TypeEnv {\n const type = isCall(node) ? boundCall(node, env, infer) : inferExpr(node.value, env, infer);\n const declared = declaredTypeOf(node, infer);\n // An annotation the checker parses and never reads is worse than no\n // annotation: the author believes something is being enforced.\n if (declared) expect(infer, node.value, type, declared);\n // Record it on the declaration too, so a hover on the name knows the type.\n infer.types?.set(node, declared ?? type);\n return env.with(node.name, mono(declared ?? type));\n}\n\nfunction declaredTypeOf(node: ast.LetStmt, infer: Infer): Type | undefined {\n if (!node.declaredType) return undefined;\n const { ctx, named, catalog } = infer;\n return typeRefToType({ ref: node.declaredType, ctx, named, catalog });\n}\n\n/** Trailing arguments or an options map are what make a binding a verb call. */\nfunction isCall(node: ast.LetStmt): boolean {\n return node.args.length > 0 || node.opts !== undefined;\n}\n\nfunction boundCall(node: ast.LetStmt, env: TypeEnv, infer: Infer): Type {\n return callType({ target: targetOf(node.value), args: node.args, opts: node.opts }, env, infer);\n}\n\n/** The dotted name a call was written with, such as `http.serve`. */\nfunction targetOf(value: Expr): string {\n return (value as { $cstNode?: { text?: string } }).$cstNode?.text?.trim() ?? \"\";\n}\n\nfunction expectStmt(node: ast.ExpectStmt, env: TypeEnv, infer: Infer): TypeEnv {\n if (node.subject) inferExpr(node.subject, env, infer);\n for (const check of node.checks) inferExpr(check, env, infer);\n return env;\n}\n\n/**\n * A verb written as a statement, in either spelling.\n *\n * `callArgs` because the arguments live in different places on the node: bare\n * ones hang off the statement, bracketed ones sit in the call. Reading only the\n * first makes `http.on(api, route)` look like a call with no arguments, and then\n * nothing tells `route` what it is handed.\n */\nfunction actionArgs(node: ast.ActionCall, env: TypeEnv, infer: Infer): TypeEnv {\n callType({ target: node.target, args: callArgs(node), opts: node.opts }, env, infer);\n return env;\n}\n\nfunction runArgs(node: ast.RunStmt, env: TypeEnv, infer: Infer): TypeEnv {\n for (const arg of node.args?.args ?? []) inferExpr(arg.value, env, infer);\n return node.bind ? env.with(node.bind, mono(DYNAMIC)) : env;\n}\n\nfunction ifStmt(node: ast.IfStmt, env: TypeEnv, infer: Infer): TypeEnv {\n inferExpr(node.cond, env, infer);\n checkBlockOrIf(node.then, env, infer);\n if (node.otherwise) checkBlockOrIf(node.otherwise, env, infer);\n return env;\n}\n\nfunction checkBlockOrIf(node: Block | ast.IfStmt, env: TypeEnv, infer: Infer): void {\n if (ast.isIfStmt(node)) ifStmt(node, env, infer);\n else checkBlock(node, env, infer);\n}\n\n/** `forEach item in source`: the item's type is the source's element type. */\nfunction forEach(node: ast.ForEachStmt, env: TypeEnv, infer: Infer): TypeEnv {\n const source = prune(inferExpr(node.source, env, infer));\n const item: Type = source.kind === \"list\" ? source.element : DYNAMIC;\n checkBlock(node.body, env.with(node.item, mono(item)), infer);\n return env;\n}\n\nfunction repeat(node: ast.RepeatStmt, env: TypeEnv, infer: Infer): TypeEnv {\n inferExpr(node.count, env, infer);\n const inner = node.index ? env.with(node.index, mono({ kind: \"prim\", name: \"number\" })) : env;\n checkBlock(node.body, inner, infer);\n return env;\n}\n\nfunction tryStmt(node: ast.TryStmt, env: TypeEnv, infer: Infer): TypeEnv {\n checkBlock(node.body, env, infer);\n if (node.handler) {\n const scope = node.error ? env.with(node.error, mono(DYNAMIC)) : env;\n checkBlock(node.handler, scope, infer);\n }\n if (node.finalizer) checkBlock(node.finalizer, env, infer);\n return env;\n}\n\nfunction blockAfterCond(cond: Expr, body: Block, env: TypeEnv, infer: Infer): TypeEnv {\n inferExpr(cond, env, infer);\n checkBlock(body, env, infer);\n return env;\n}\n\nfunction maybeInfer(expr: Expr | undefined, env: TypeEnv, infer: Infer): TypeEnv {\n if (expr) inferExpr(expr, env, infer);\n return env;\n}\n\n/** A block opens its own scope; bindings inside it do not escape. */\nexport function checkBlock(block: Block, env: TypeEnv, infer: Infer): void {\n let scope = env;\n for (const stmt of block.stmts) scope = checkStatement(stmt, scope, infer);\n}\n\n/** A fragment's params are in scope throughout its body. */\nexport function checkFragment(decl: FragmentDecl, env: TypeEnv, infer: Infer): void {\n let scope = env;\n for (const param of decl.params?.params ?? []) scope = scope.with(param.name, mono(DYNAMIC));\n checkBlock(decl.body, scope, infer);\n}\n","import { freeVars, type Scheme } from \"./scheme.js\";\n\n/**\n * The names in scope during inference, mapped to their type schemes. Chained, so\n * a function body sees the outer scope. Names it does not know resolve to\n * `dynamic` at the use site: the type checker only ever settles type\n * consistency, never name resolution, which is the runtime's static check.\n */\nexport interface TypeEnv {\n lookup(name: string): Scheme | undefined;\n with(name: string, scheme: Scheme): TypeEnv;\n /** Ids of the variables free across every binding: what must not generalise. */\n freeVars(): Set<number>;\n}\n\nexport function emptyEnv(): TypeEnv {\n return envOf(new Map(), undefined);\n}\n\nfunction envOf(bindings: Map<string, Scheme>, parent: TypeEnv | undefined): TypeEnv {\n return {\n lookup: (name) => bindings.get(name) ?? parent?.lookup(name),\n with(name, scheme) {\n return envOf(new Map([[name, scheme]]), this);\n },\n freeVars() {\n const free = parent ? parent.freeVars() : new Set<number>();\n for (const scheme of bindings.values()) collect(scheme, free);\n return free;\n },\n };\n}\n\n/** A binding's contribution to the environment's free variables: the ones it did\n * not quantify. */\nfunction collect(scheme: Scheme, into: Set<number>): void {\n const quantified = new Set(scheme.quantified);\n for (const id of freeVars(scheme.type)) if (!quantified.has(id)) into.add(id);\n}\n\n/** Extend an environment with several bindings at once. */\nexport function withAll(env: TypeEnv, bindings: Iterable<[string, Scheme]>): TypeEnv {\n let next = env;\n for (const [name, scheme] of bindings) next = next.with(name, scheme);\n return next;\n}\n","import { walkAst } from \"../ast/index.js\";\nimport { buildProblem, CODES } from \"../codes/index.js\";\nimport { acceptedKinds, readSignature, spanOf, wrongKind } from \"../expand/index.js\";\nimport type { Annotation, DecoDecl, Document, Expr, Param } from \"../generated/ast.js\";\nimport { isAnnotation, isDecoDecl } from \"../generated/ast.js\";\nimport type { Problem } from \"../problem/index.js\";\nimport { checkBlock } from \"./check-stmts.js\";\nimport { expect, type Infer, inferExpr } from \"./infer.js\";\nimport { mono } from \"./scheme.js\";\nimport { DYNAMIC, type Type } from \"./type.types.js\";\nimport { emptyEnv, type TypeEnv } from \"./type-env.js\";\nimport { typeRefToType } from \"./type-ref.js\";\n\n/**\n * A `deco`'s body, checked the way a `fn`'s is.\n *\n * The kind on the first parameter is a real type, so the body holds a typed\n * handle: hovering `target` says `Fn`, completing `target.` offers what an `Fn`\n * offers, and the checker knows what `target.params` is without anyone teaching\n * it a second vocabulary.\n */\nexport function checkDecoBody(decl: DecoDecl, env: TypeEnv, infer: Infer): void {\n let scope = env;\n for (const param of decl.params?.params ?? []) {\n const type = decoParamType(param, infer);\n infer.types?.set(param, type);\n scope = scope.with(param.name, mono(type));\n }\n checkBlock(decl.body, scope, infer);\n}\n\n/**\n * What a `deco`'s parameter is.\n *\n * An unwritten one stays `dynamic` rather than an open question: a decorator's\n * arguments arrive from every `@name(…)` in the file, and letting the first use\n * decide for all of them would turn the second into an error nobody made.\n */\nfunction decoParamType(param: Param, infer: Infer): Type {\n if (!param.paramType) return DYNAMIC;\n const { ctx, named, catalog } = infer;\n return typeRefToType({ ref: param.paramType, ctx, named, catalog });\n}\n\n/**\n * What a document's `deco`s answer for statically: a signature that reads, and\n * arguments that match it.\n *\n * The signature is read with the very reader expansion uses, so the sentence\n * `venn check` prints is the sentence a run prints. Expansion does not happen\n * here (the checker looks at the program as written), which is why the signature\n * is read twice, and read the same.\n */\nexport function checkDecos(args: { document: Document; infer: Infer; uri: string }): Problem[] {\n const problems: Problem[] = [];\n for (const decl of args.document.decls.filter(isDecoDecl)) {\n const read = readSignature(decl);\n if (!read.ok) problems.push(signatureProblem(decl, read.title, args.uri));\n }\n return [...problems, ...checkUses({ ...args, declared: args.infer.decos ?? new Map() })];\n}\n\n/**\n * Every `deco` a use site in this file could name, local or imported, keyed by\n * the name an `@` writes. Only the ones whose signature reads, since a use of a\n * broken one has nothing to be checked against.\n *\n * An imported one contributes no VN2015 of its own: that is the other file's\n * fault, reported when the other file is checked, and a span into a document\n * this run never opened would point nowhere.\n */\nexport function decosInReach(args: {\n document: Document;\n imported?: ReadonlyMap<string, { readonly decl: DecoDecl }>;\n}): Map<string, DecoDecl> {\n const found = new Map<string, DecoDecl>();\n for (const [name, from] of args.imported ?? []) {\n if (readSignature(from.decl).ok) found.set(name, from.decl);\n }\n for (const decl of args.document.decls.filter(isDecoDecl)) {\n if (readSignature(decl).ok) found.set(decl.name, decl);\n }\n return found;\n}\n\nfunction signatureProblem(decl: DecoDecl, title: string, uri: string): Problem {\n return buildProblem({ spec: CODES.VN2015_DECO_SIGNATURE, span: spanOf(decl, uri), title });\n}\n\n/** Everything a use site needs to be checked against the `deco` it names. */\ninterface Uses {\n document: Document;\n infer: Infer;\n uri: string;\n declared: ReadonlyMap<string, DecoDecl>;\n}\n\nfunction checkUses(args: Uses): Problem[] {\n if (args.declared.size === 0) return [];\n const problems: Problem[] = [];\n for (const node of walkAst(args.document)) {\n if (isAnnotation(node)) problems.push(...checkUse(node, args));\n }\n return problems;\n}\n\n/**\n * `@retry(3)` against `deco retry(target: Flow, times: number)`: is it on\n * something it decorates, and were it given what it asks for.\n */\nfunction checkUse(annotation: Annotation, args: Uses): Problem[] {\n const decl = args.declared.get(annotation.name);\n if (!decl) return [];\n const wrong = misplaced(annotation, decl, args.uri);\n return wrong ? [wrong] : checkArgs(annotation, decl, args);\n}\n\n/**\n * The very refusal expansion would make, made while the file is still open.\n *\n * A run reaches it too, and with the same sentence, because both ask\n * {@link wrongKind}. `venn check` never expands, so this is the only place the\n * type error a signature exists to produce reaches an editor.\n */\nfunction misplaced(annotation: Annotation, decl: DecoDecl, uri: string): Problem | undefined {\n const node = annotation.$container;\n const title = node && wrongKind({ name: annotation.name, kinds: acceptedKinds(decl), node });\n if (!title) return undefined;\n const spec = CODES.VN2014_DECORATOR_TARGET;\n return buildProblem({ spec, span: spanOf(annotation, uri), title });\n}\n\n/**\n * The arguments are read against an empty scope on purpose: they are part of the\n * shape of the program and not of its execution, so nothing exists yet for a\n * name inside one to refer to. That is the same reason a bare word there is a\n * word and not a variable.\n */\nfunction checkArgs(annotation: Annotation, decl: DecoDecl, args: Uses): Problem[] {\n const params = (decl.params?.params ?? []).slice(1);\n const given = annotation.args?.args ?? [];\n if (given.length !== params.length) {\n return [arityProblem({ annotation, params, given, uri: args.uri })];\n }\n for (const [at, arg] of given.entries()) checkArg(arg.value, params[at], args.infer);\n return [];\n}\n\nfunction checkArg(value: Expr, param: Param | undefined, infer: Infer): void {\n if (!param) return;\n expect(infer, value, inferExpr(value, emptyEnv(), infer), decoParamType(param, infer));\n}\n\nfunction arityProblem(args: {\n annotation: Annotation;\n params: readonly Param[];\n given: readonly unknown[];\n uri: string;\n}): Problem {\n const title = arityTitle(args.annotation.name, args.params.length, args.given.length);\n return buildProblem({\n spec: CODES.VN3017_DECO_ARGUMENTS,\n span: spanOf(args.annotation, args.uri),\n title,\n });\n}\n\nfunction arityTitle(name: string, want: number, got: number): string {\n return `@${name} takes ${wanted(want)}, and was given ${got === 0 ? \"none\" : got}.`;\n}\n\nfunction wanted(count: number): string {\n return count === 0 ? \"no arguments\" : `${count} argument${count === 1 ? \"\" : \"s\"}`;\n}\n","import type { AstNode } from \"langium\";\nimport type { Type, TypeVar } from \"./type.types.js\";\n\n/**\n * Per-run inference state: a fresh-variable source and the list of type\n * mismatches found. Held in a context (not a module global) so two checks never\n * share variable ids or leak diagnostics into each other.\n */\nexport interface TypeContext {\n fresh(): TypeVar;\n mismatches: TypeMismatch[];\n}\n\n/** One place where two types could not be made equal, at a source node. */\nexport interface TypeMismatch {\n node: AstNode;\n expected: Type;\n actual: Type;\n note?: string;\n /** A unit clash rather than a plain type clash: VN3012 instead of VN3010. */\n unit?: boolean;\n}\n\n/** A fresh inference context: variable ids from zero, no mismatches recorded. */\nexport function createContext(): TypeContext {\n let next = 0;\n return {\n fresh: () => ({ kind: \"var\", id: next++, ref: undefined }),\n mismatches: [],\n };\n}\n","import type { FnSpec, RecordSpec, TypeSpec } from \"@venn-lang/types\";\nimport {\n DYNAMIC,\n fn,\n list,\n literal,\n mapOf,\n NULL,\n opaque,\n prim,\n record,\n type Type,\n union,\n} from \"./type.types.js\";\n\n/** How a `ref` finds what it points at. Returning undefined is fine: the\n * reference degrades to `dynamic` rather than failing. */\nexport type ResolveRef = (name: string) => Type | undefined;\n\n/**\n * Read the published form of a type into the checker's own.\n *\n * The wire format is plain data with no inference variables; the checker's type\n * is a live thing that unification writes into. Keeping them apart is what lets\n * a signature be written by hand, generated from a `.d.ts`, or shipped as JSON\n * without any of them reaching into the compiler.\n */\nexport function specToType(spec: TypeSpec, resolve: ResolveRef): Type {\n switch (spec.kind) {\n case \"prim\":\n return prim(spec.name);\n case \"literal\":\n return literal(spec.value);\n case \"list\":\n return list(specToType(spec.element, resolve));\n case \"map\":\n return mapOf(specToType(spec.value, resolve));\n default:\n return compound(spec, resolve);\n }\n}\n\nfunction compound(spec: TypeSpec, resolve: ResolveRef): Type {\n switch (spec.kind) {\n case \"record\":\n return recordType(spec, resolve);\n case \"fn\":\n return fnType(spec, resolve);\n case \"union\":\n return union(spec.members.map((member) => specToType(member, resolve)));\n case \"opaque\":\n return opaque(spec.name, opaqueMembers(spec.members, resolve));\n case \"ref\":\n return resolve(spec.name) ?? DYNAMIC;\n default:\n return DYNAMIC;\n }\n}\n\n/** An optional field is one that may not be there: `T | null`, said plainly. */\nfunction recordType(spec: RecordSpec, resolve: ResolveRef): Type {\n const optional = new Set(spec.optional ?? []);\n const fields = new Map<string, Type>();\n for (const [name, field] of Object.entries(spec.fields)) {\n const type = specToType(field, resolve);\n fields.set(name, optional.has(name) ? union([type, NULL]) : type);\n }\n return record(fields, spec.open ?? false);\n}\n\n/** What a handle publishes, read into the checker's own types. */\nfunction opaqueMembers(\n members: Readonly<Record<string, TypeSpec>> | undefined,\n resolve: ResolveRef,\n): ReadonlyMap<string, Type> | undefined {\n if (!members) return undefined;\n const into = new Map<string, Type>();\n for (const [name, spec] of Object.entries(members)) into.set(name, specToType(spec, resolve));\n return into;\n}\n\nfunction fnType(spec: FnSpec, resolve: ResolveRef): Type {\n const params = spec.params.map((param) => specToType(param, resolve));\n const result = specToType(spec.result, resolve);\n return spec.takes === undefined\n ? fn(params, result)\n : { kind: \"fn\", params, result, ignorableFrom: spec.takes };\n}\n","import { type TypeSpec, t } from \"@venn-lang/types\";\nimport { TARGET_KINDS, type TargetKind } from \"../expand/index.js\";\nimport { specToType } from \"./spec-to-type.js\";\nimport type { Type } from \"./type.types.js\";\n\n/** A verb that changes the declaration and answers nothing. */\nconst NOTHING = t.null;\n\n/** A function left behind to run around the real thing, for effect. */\nconst AROUND = t.callback([t.dynamic], t.dynamic, 0);\n\n/** `wrap` is handed the call itself and its arguments, and decides. */\nconst MIDDLEWARE = t.callback([t.dynamic, t.dynamic], t.dynamic, 1);\n\n/** What every handle answers, whatever declaration it is holding. */\nconst COMMON: Readonly<Record<string, TypeSpec>> = {\n name: t.string,\n meta: t.fn([t.string, t.dynamic], NOTHING),\n remove: t.fn([], NOTHING),\n};\n\n/** A flow and a step are one handle: a title, and a way around the body. */\nconst RUNNABLE: Readonly<Record<string, TypeSpec>> = {\n ...COMMON,\n title: t.string,\n before: t.fn([AROUND], NOTHING),\n after: t.fn([AROUND], NOTHING),\n};\n\n/**\n * The kinds, published as types.\n *\n * Written as data, the same data `http.Request` is written as, so the checker,\n * the hover and the completion list read one description of what a target\n * offers. This is the static twin of the verb tables in\n * `expand/handles/make-handle.ts`: whatever a kind has there it has here, and\n * `kind-types.test.ts` fails the day they stop agreeing.\n */\nexport const KIND_SPECS: Readonly<Record<TargetKind, TypeSpec>> = {\n Fn: t.record({\n ...COMMON,\n params: t.list(t.string),\n addParam: t.fn([t.string], NOTHING),\n removeParam: t.fn([t.string], NOTHING),\n rename: t.fn([t.string], NOTHING),\n wrap: t.fn([MIDDLEWARE], NOTHING),\n before: t.fn([AROUND], NOTHING),\n after: t.fn([AROUND], NOTHING),\n }),\n Flow: t.record(RUNNABLE),\n Step: t.record(RUNNABLE),\n Binding: t.record({ ...COMMON, value: t.dynamic, setValue: t.fn([t.dynamic], NOTHING) }),\n Type: t.record({\n ...COMMON,\n fields: t.list(t.string),\n addField: t.fn([t.string, t.dynamic], NOTHING),\n removeField: t.fn([t.string], NOTHING),\n }),\n Node: t.record(COMMON),\n};\n\n/**\n * The same kinds as the checker's own types, built once.\n *\n * Safe to share across files and across edits: a handle's surface is fixed, so\n * none of these holds an inference variable for a later document to write into.\n */\nexport const KIND_TYPES: ReadonlyMap<string, Type> = build();\n\nfunction build(): Map<string, Type> {\n const table = new Map<string, Type>();\n for (const kind of TARGET_KINDS) {\n table.set(\n kind,\n specToType(KIND_SPECS[kind], (name) => table.get(name)),\n );\n }\n return table;\n}\n","import type { Document, TypeDecl } from \"../generated/ast.js\";\nimport { isTypeDecl } from \"../generated/ast.js\";\nimport type { TypeCatalog } from \"./catalog.types.js\";\nimport type { TypeContext } from \"./context.js\";\nimport { KIND_TYPES } from \"./kind-types.js\";\nimport { NULL, record, type Type, union } from \"./type.types.js\";\nimport { typeRefToType } from \"./type-ref.js\";\n\n/** The named types a document declares, such as `type User { … }`, by name. */\nexport interface NamedTypes {\n get(name: string): Type | undefined;\n}\n\n/**\n * Collect every `type` declaration into resolvable record types. A shared table\n * lets one type reference another declared later; an unknown name stays\n * `dynamic`, so annotations never add friction.\n *\n * The decorator kinds are in the table before the file is read: `Fn`, `Flow`\n * and the rest are types like any other, so `deco memoize(target: Fn)` needs no\n * special path to hover, complete and check. A file that declares a type of its\n * own by one of those names wins, because they are a stdlib, not reserved words.\n */\nexport function collectNamedTypes(\n doc: Document,\n ctx: TypeContext,\n catalog?: TypeCatalog,\n): NamedTypes {\n const table = new Map<string, Type>(KIND_TYPES);\n const named: NamedTypes = { get: (name) => table.get(name) };\n for (const decl of doc.decls.filter(isTypeDecl)) {\n table.set(decl.name, declaredType({ decl, ctx, named, catalog }));\n }\n return named;\n}\n\n/** A `type` is either a shape of its own or another name for one. */\nfunction declaredType(args: Scope & { decl: TypeDecl }): Type {\n if (args.decl.alias) return typeRefToType({ ...args, ref: args.decl.alias });\n return recordOf(args);\n}\n\ninterface Scope {\n ctx: TypeContext;\n named: NamedTypes;\n catalog?: TypeCatalog;\n}\n\n/** A record of the declared fields. An optional one reads as `T | null`. */\nfunction recordOf(args: Scope & { decl: TypeDecl }): Type {\n const fields = new Map<string, Type>();\n for (const field of args.decl.body?.fields ?? []) {\n const type = typeRefToType({ ...args, ref: field.fieldType });\n fields.set(field.name, field.optional ? union([type, NULL]) : type);\n }\n return record(fields);\n}\n","import { DYNAMIC, list, NUMBER, STRING, type Type, variadic } from \"./type.types.js\";\n\n/** One argument of a prelude verb, named so the editor can point at it. */\nexport interface PreludeArg {\n name: string;\n type: string;\n doc?: string;\n optional?: boolean;\n}\n\n/** What the editor needs to describe a prelude name: its type, and what it is for. */\nexport interface PreludeSpec {\n /** How it reads when written out. Shown as the hover's signature. */\n signature: string;\n doc: string;\n example?: string;\n type: Type;\n /**\n * The arguments, one by one. `signature` above is a whole line meant to be\n * read; these are meant to be pointed at, one at a time, as each is typed.\n */\n args?: readonly PreludeArg[];\n}\n\n/**\n * The prelude, described once: the checker reads the types, the editor reads\n * the prose. Two tables would drift; this one cannot.\n */\nexport const PRELUDE_SPECS: Readonly<Record<string, PreludeSpec>> = {\n spawn: {\n signature: \"spawn(fn () -> T) -> task\",\n doc: \"Start work without waiting for it. Everything else waits by itself, so this is how to carry on — ask for the value later with `.wait`.\",\n example: \"let job = spawn(fn () => http.get(url))\\nlet page = job.wait\",\n type: variadic([DYNAMIC], DYNAMIC),\n args: [\n {\n name: \"work\",\n type: \"fn () -> T\",\n doc: \"What to start. It runs on its own; ask for the answer later.\",\n },\n ],\n },\n print: {\n signature: \"print(…) -> null\",\n doc: \"Write to standard output, followed by a newline. A map or list shows as JSON.\",\n args: [\n {\n name: \"values\",\n type: \"…\",\n doc: \"Anything, as many as you like. Spaced apart on one line.\",\n },\n ],\n example: 'print \"hello\" 42\\nprint pretty(user)',\n type: variadic([DYNAMIC], { kind: \"prim\", name: \"null\" }),\n },\n log: {\n signature: \"log(…) -> null\",\n doc: \"Record a message in the event stream — what a reporter and a test see, not stdout.\",\n example: 'log \"retrying\" attempt',\n args: [\n {\n name: \"values\",\n type: \"…\",\n doc: \"Anything, as many as you like. Goes to the event stream, not stdout.\",\n },\n ],\n type: variadic([DYNAMIC], { kind: \"prim\", name: \"null\" }),\n },\n range: {\n signature: \"range(from?, to, step?) -> list<number>\",\n doc: \"A list of numbers, counting up or down. The end is exclusive.\",\n example:\n \"range(3) # [0, 1, 2]\\nrange(1, 4) # [1, 2, 3]\\nrange(0, 10, 2) # [0, 2, 4, 6, 8]\",\n args: [\n {\n name: \"from\",\n type: \"number\",\n doc: \"Where to start. Omit it and counting starts at 0.\",\n optional: true,\n },\n { name: \"to\", type: \"number\", doc: \"Where to stop, exclusive.\" },\n { name: \"step\", type: \"number\", doc: \"How far apart. Negative counts down.\", optional: true },\n ],\n type: variadic([NUMBER], list(NUMBER)),\n },\n str: {\n signature: \"str(…) -> string\",\n doc: \"Every argument as text, spaced. Works on `null`, which has no methods of its own.\",\n example: 'str(\"total:\", 42, true) # \"total: 42 true\"',\n args: [{ name: \"values\", type: \"…\", doc: \"Anything, as many as you like.\" }],\n type: variadic([DYNAMIC], STRING),\n },\n typeOf: {\n signature: \"typeOf(value) -> string\",\n doc: \"The name of a value's type: `list`, `map`, `string`, `number`, `bool`, `fn`, `null`.\",\n example: 'typeOf([1, 2]) # \"list\"',\n args: [{ name: \"value\", type: \"dynamic\", doc: \"Whatever you want the name of.\" }],\n type: variadic([DYNAMIC], STRING),\n },\n pretty: {\n signature: \"pretty(value) -> string\",\n doc: \"Indented JSON — `fmt.json(x, 2)` without the import.\",\n args: [{ name: \"value\", type: \"dynamic\", doc: \"What to render.\" }],\n example: \"print pretty(user)\",\n type: variadic([DYNAMIC], STRING),\n },\n wait: {\n signature: \"wait(duration) -> null\",\n doc: \"Pause for a duration.\",\n args: [{ name: \"duration\", type: \"duration\", doc: \"How long: `500ms`, `2s`, `1m`.\" }],\n example: \"wait 500ms\",\n type: variadic([DYNAMIC], { kind: \"prim\", name: \"null\" }),\n },\n skip: {\n signature: \"skip(reason) -> null\",\n doc: \"Skip the rest of the current flow.\",\n args: [\n {\n name: \"reason\",\n type: \"string\",\n doc: \"Why — it is reported alongside the skip.\",\n optional: true,\n },\n ],\n type: variadic([DYNAMIC], { kind: \"prim\", name: \"null\" }),\n },\n fail: {\n signature: \"fail(message) -> never\",\n doc: \"Fail the current step with a message.\",\n args: [{ name: \"message\", type: \"string\", doc: \"What went wrong, in the reader's terms.\" }],\n type: variadic([DYNAMIC], { kind: \"prim\", name: \"null\" }),\n },\n exit: {\n signature: \"exit(code) -> never\",\n doc: \"End the program with an exit code.\",\n args: [\n {\n name: \"code\",\n type: \"number\",\n doc: \"0 means success. Anything else does not.\",\n optional: true,\n },\n ],\n example: \"exit 1\",\n type: variadic([NUMBER], { kind: \"prim\", name: \"null\" }),\n },\n};\n\n/** Whether a bare name is part of the prelude: no `use` needed, always in scope. */\nexport function isPrelude(name: string): boolean {\n return name in PRELUDE_SPECS;\n}\n","import { walkAst } from \"../ast/index.js\";\nimport { decoTarget } from \"../expand/index.js\";\nimport type { DecoDecl, Document, FnDecl } from \"../generated/ast.js\";\nimport * as ast from \"../generated/ast.js\";\n\n/**\n * The verbs that change what a call to a function looks like.\n *\n * `rename` is absent: it moves the name rather than the shape, and the checker\n * has no better answer for the new name than it had for the old one.\n */\nconst RESHAPING: readonly string[] = [\"addParam\", \"removeParam\", \"wrap\"];\n\n/**\n * The functions a `deco` gives a different shape to.\n *\n * The checker reads the program as written, before expansion has run, so a\n * function that `@inject(\"who\")` gave a parameter to still looks like the one\n * the author typed and every call passing that parameter looks wrong. It is not:\n * the program runs. Inference cannot know the new shape without expanding, so\n * for these it says `dynamic` and stops pinning a signature that is about to\n * change, rather than rejecting a program that works.\n *\n * Narrow on purpose: only a function actually carrying a decorator that\n * actually reshapes. Everything else keeps every check it had.\n */\nexport function reshapedFns(args: {\n document: Document;\n decos: ReadonlyMap<string, DecoDecl>;\n}): ReadonlySet<FnDecl> {\n const found = new Set<FnDecl>();\n const names = reshapingNames(args.decos);\n if (names.size === 0) return found;\n for (const decl of args.document.decls) {\n if (ast.isFnDecl(decl) && decl.annotations.some((one) => names.has(one.name))) found.add(decl);\n }\n return found;\n}\n\n/** The decorators in reach whose body changes the shape of what it is applied to. */\nfunction reshapingNames(decos: ReadonlyMap<string, DecoDecl>): Set<string> {\n const names = new Set<string>();\n for (const [name, decl] of decos) {\n if (reshapes(decl)) names.add(name);\n }\n return names;\n}\n\n/**\n * Whether the body reaches for one of those verbs on its target, anywhere.\n * Inside an `if` counts, because the checker cannot know which way it goes.\n */\nfunction reshapes(decl: DecoDecl): boolean {\n const target = decoTarget(decl)?.name;\n if (!target) return false;\n const verbs = RESHAPING.map((verb) => `${target}.${verb}`);\n return walkAst(decl.body).some((node) => ast.isActionCall(node) && verbs.includes(node.target));\n}\n","import { list, type RecordType, record, type Type, union } from \"./type.types.js\";\nimport { prune } from \"./unify.js\";\n\n/**\n * The same type with every variable resolved, or nothing if any is still open.\n *\n * A type solved during one pass carries variables belonging to that pass's\n * context; handing one to the next pass would smuggle in a variable nobody owns.\n * Only a fully settled type crosses, so `undefined` here is an answer rather\n * than a failure.\n */\nexport function solidify(type: Type): Type | undefined {\n const t = prune(type);\n switch (t.kind) {\n case \"var\":\n return undefined;\n case \"list\":\n return map1(solidify(t.element), list);\n case \"union\":\n return all(t.members)?.length ? union(all(t.members) as Type[]) : undefined;\n case \"record\":\n return solidRecord(t);\n case \"fn\":\n return solidFn(t.params, t.result, t);\n default:\n return t;\n }\n}\n\nfunction map1(inner: Type | undefined, wrap: (type: Type) => Type): Type | undefined {\n return inner ? wrap(inner) : undefined;\n}\n\nfunction all(types: readonly Type[]): Type[] | undefined {\n const solid = types.map(solidify);\n return solid.some((type) => type === undefined) ? undefined : (solid as Type[]);\n}\n\nfunction solidRecord(type: RecordType): Type | undefined {\n const out = new Map<string, Type>();\n for (const [name, field] of type.fields) {\n const solid = solidify(field);\n if (!solid) return undefined;\n out.set(name, solid);\n }\n const rest = type.rest ? solidify(type.rest) : undefined;\n if (type.rest && !rest) return undefined;\n return record(out, type.open, rest);\n}\n\nfunction solidFn(\n params: readonly Type[],\n result: Type,\n shape: { variadic?: boolean; ignorableFrom?: number },\n): Type | undefined {\n const solidParams = all(params);\n const solidResult = solidify(result);\n if (!solidParams || !solidResult) return undefined;\n return { kind: \"fn\", params: solidParams, result: solidResult, ...shape };\n}\n","import type { AstNode } from \"langium\";\nimport type { DecoDecl, Document, Param } from \"../generated/ast.js\";\nimport * as ast from \"../generated/ast.js\";\nimport type { TypeCatalog } from \"./catalog.types.js\";\nimport { createContext } from \"./context.js\";\nimport type { Infer, Slot } from \"./infer.js\";\nimport { collectNamedTypes } from \"./named-types.js\";\nimport { solidify } from \"./solidify.js\";\nimport type { Type } from \"./type.types.js\";\n\n/** What the call sites turned out to say about each unwritten parameter. */\nexport type ParamSeeds = ReadonlyMap<AstNode, Type>;\n\n/** How the checker's two passes are wired, without either importing the other. */\nexport type SeedRun = (document: Document, infer: Infer) => void;\n\n/**\n * A first pass, in silence: what the callers say the named functions take.\n *\n * A `fn` declared at the top of a file is not written where it is called, so on\n * its own it knows nothing about its parameters. The file does say, though:\n * every call is a statement of what goes in. This pass keeps the functions\n * monomorphic so those calls reach the declaration, reads off whatever got\n * decided, and throws the rest away. The real pass then starts from the answers.\n *\n * Nothing is carried over from a file that did not type-check cleanly: a\n * conflict means the first caller won by accident, and a guess made that way\n * would turn into an error the author never made.\n */\nexport function seedParams(args: {\n document: Document;\n catalog?: TypeCatalog;\n /** Carried through so this pass draws the same line around a reshaped `fn`;\n * without it one such function's calls would look like a conflict and every\n * seed in the file would be dropped. */\n decos?: ReadonlyMap<string, DecoDecl>;\n parsed?: Map<AstNode, Slot[]>;\n run: SeedRun;\n}): ParamSeeds {\n const wanted = unwritten(args.document);\n if (wanted.length === 0) return new Map();\n const ctx = createContext();\n const infer: Infer = {\n ctx,\n named: collectNamedTypes(args.document, ctx, args.catalog),\n catalog: args.catalog,\n decos: args.decos,\n parsed: args.parsed,\n types: new Map(),\n seeding: true,\n };\n args.run(args.document, infer);\n return ctx.mismatches.length > 0 ? new Map() : settled(wanted, infer);\n}\n\n/** Every parameter of a top-level `fn` that carries no annotation. */\nfunction unwritten(document: Document): Param[] {\n return document.decls\n .filter(ast.isFnDecl)\n .flatMap((decl) => decl.params?.params ?? [])\n .filter((param) => !param.paramType);\n}\n\nfunction settled(params: readonly Param[], infer: Infer): ParamSeeds {\n const seeds = new Map<AstNode, Type>();\n for (const param of params) {\n const found = infer.types?.get(param);\n const solid = found && solidify(found);\n if (solid) seeds.set(param, solid);\n }\n return seeds;\n}\n","import type { AstNode } from \"langium\";\nimport type { DecoDecl, Document, LetStmt } from \"../generated/ast.js\";\nimport * as ast from \"../generated/ast.js\";\nimport type { TypeCatalog } from \"./catalog.types.js\";\nimport { createContext } from \"./context.js\";\nimport type { Infer, Slot } from \"./infer.js\";\nimport { collectNamedTypes } from \"./named-types.js\";\nimport type { SeedRun } from \"./seed-params.js\";\nimport { solidify } from \"./solidify.js\";\nimport type { Type } from \"./type.types.js\";\n\n/** What the file's own top-level values turned out to be, by the name they carry. */\nexport type ValueSeeds = ReadonlyMap<string, Type>;\n\n/**\n * A first pass, in silence: what the file's top-level `const`s and `let`s hold.\n *\n * A named `fn` is checked before those bindings exist, because generalising it\n * is what lets two callers use it at two types, and a binding written above it\n * may call it. So the file's values cannot simply be bound first. A function\n * body is still free to read them, since it runs later when they are all there,\n * and this pass is what gives those reads a type.\n *\n * Unlike the parameter seeds, a conflict elsewhere does not throw the answers\n * away. A value's type is written in the file, not guessed from a caller, and a\n * half-typed line somewhere else is the normal state of a file being edited:\n * exactly when the help is worth most.\n */\nexport function seedValues(args: {\n document: Document;\n catalog?: TypeCatalog;\n decos?: ReadonlyMap<string, DecoDecl>;\n parsed?: Map<AstNode, Slot[]>;\n run: SeedRun;\n}): ValueSeeds {\n const values = topLevelValues(args.document);\n if (values.length === 0 || !args.document.decls.some(ast.isFnDecl)) return new Map();\n const ctx = createContext();\n const infer: Infer = {\n ctx,\n named: collectNamedTypes(args.document, ctx, args.catalog),\n catalog: args.catalog,\n decos: args.decos,\n parsed: args.parsed,\n types: new Map(),\n seeding: true,\n };\n args.run(args.document, infer);\n return settled(values, infer);\n}\n\nfunction topLevelValues(document: Document): LetStmt[] {\n return document.decls.filter(ast.isLetStmt);\n}\n\nfunction settled(values: readonly LetStmt[], infer: Infer): ValueSeeds {\n const seeds = new Map<string, Type>();\n for (const decl of values) {\n const found = infer.types?.get(decl);\n const solid = found && solidify(found);\n if (solid) seeds.set(decl.name, solid);\n }\n return seeds;\n}\n","import type { AstNode } from \"langium\";\nimport { buildProblem, CODES } from \"../codes/index.js\";\nimport type { ImportedDeco } from \"../expand/index.js\";\nimport type { Declaration, Document, Expr, FnDecl } from \"../generated/ast.js\";\nimport * as ast from \"../generated/ast.js\";\nimport type { Problem, Span } from \"../problem/index.js\";\nimport type { TypeCatalog } from \"./catalog.types.js\";\nimport { checkDecoBody, checkDecos, decosInReach } from \"./check-deco.js\";\nimport { checkBlock, checkFragment, checkStatement } from \"./check-stmts.js\";\nimport { createContext, type TypeContext, type TypeMismatch } from \"./context.js\";\nimport { type Infer, inferFn, type Slot } from \"./infer.js\";\nimport { collectNamedTypes } from \"./named-types.js\";\nimport { PRELUDE_SPECS } from \"./prelude-types.js\";\nimport { reshapedFns } from \"./reshaped-fns.js\";\nimport { generalize, mono } from \"./scheme.js\";\nimport { seedParams } from \"./seed-params.js\";\nimport { seedValues } from \"./seed-values.js\";\nimport { showType } from \"./show.js\";\nimport { DYNAMIC, type Type } from \"./type.types.js\";\nimport { emptyEnv, type TypeEnv } from \"./type-env.js\";\nimport { prune, unify } from \"./unify.js\";\n\n/** What one check of a document produced. */\nexport interface CheckTypesResult {\n problems: Problem[];\n /** Every expression's inferred type, keyed by node, for hover. */\n types: Map<object, Type>;\n /** Per string literal, the expression parsed from each of its ${…} slots. */\n slots: Map<object, (Expr | undefined)[]>;\n}\n\n/** What the checker may be told about the world outside the file. */\nexport interface CheckTypesOptions {\n uri?: string;\n /** The types and signatures the loaded plugins contribute. */\n catalog?: TypeCatalog;\n /** The `pub deco`s this file's imports reach. Without them an imported\n * `@name` is a name the checker knows nothing about, and says nothing about. */\n decos?: ReadonlyMap<string, ImportedDeco>;\n /** What the names this file imports turned out to be, from the files it names. */\n imports?: ReadonlyMap<string, Type>;\n}\n\n/**\n * Infer and check the types across a document.\n *\n * Errors are raised only where a type is actually known. Anything touching\n * `dynamic`, such as a plugin that published no signature or an HTTP response,\n * is left alone, so the checker helps without ever blocking.\n *\n * @returns the problems found, plus the inferred type of every expression and\n * the expressions parsed out of each `${…}`, both of which the editor reads.\n */\nexport function checkTypes(document: Document, options: CheckTypesOptions = {}): CheckTypesResult {\n const uri = options.uri ?? \"memory://inline.vn\";\n const ctx = createContext();\n // Shared with the seeding pass: parsing every `${…}` twice is the one part of\n // a second walk that would actually cost something.\n const parsed = new Map<AstNode, Slot[]>();\n const decos = decosInReach({ document, imported: options.decos });\n const shared = { document, catalog: options.catalog, decos, parsed, run: pass };\n const values = seedValues(shared);\n const seeds = seedParams(shared);\n const infer: Infer = {\n ctx,\n named: collectNamedTypes(document, ctx, options.catalog),\n catalog: options.catalog,\n decos,\n seeds,\n values,\n parsed,\n imports: options.imports,\n types: new Map(),\n slots: new Map(),\n };\n pass(document, infer);\n // After the pass, so a decorator's arguments are read once, and before the\n // mismatches are turned into problems, since that is where they land.\n const deco = checkDecos({ document, infer, uri });\n return {\n problems: [...ctx.mismatches.map((m) => problem(m, uri)), ...deco],\n types: infer.types ?? new Map(),\n slots: infer.slots ?? new Map(),\n };\n}\n\n/** One walk of the whole document: top-level bindings, then everything that runs. */\nfunction pass(document: Document, infer: Infer): void {\n walk(document, topLevelEnv(document, infer), infer);\n}\n\n/**\n * Hoist functions and bind top-level values, so the whole file sees them.\n *\n * Generalising is what makes a helper reusable at more than one type, and also\n * what stops a call site from ever reaching the declaration, since each use gets\n * its own copy. The seeding pass therefore skips it: that pass exists precisely\n * to let the callers speak.\n */\nfunction topLevelEnv(document: Document, infer: Infer): TypeEnv {\n const fns = document.decls.filter(ast.isFnDecl);\n // A decorator may hand this function a shape nobody here can read; its body is\n // still checked, but its signature is not the one callers will meet.\n const reshaped = reshapedFns({ document, decos: infer.decos ?? new Map() });\n const outer = withImports(preludeEnv(), infer);\n let env = withSeededValues(hoist({ fns, reshaped, ctx: infer.ctx, env: outer }), infer);\n for (const decl of fns) {\n const inferred = inferFn(decl, env, infer);\n if (!reshaped.has(decl)) unify(env.lookup(decl.name)?.type ?? placeholder(infer), inferred);\n }\n if (!infer.seeding) env = generalizeFns(fns, env, infer);\n return bindValues(document, env, infer);\n}\n\n/**\n * What the file's values hold, put in reach of the function bodies about to be\n * checked. The real binding still happens below, in source order and with the\n * annotations read; this only stops a body from meeting a name it cannot know.\n */\nfunction withSeededValues(env: TypeEnv, infer: Infer): TypeEnv {\n let next = env;\n for (const [name, type] of infer.values ?? []) next = next.with(name, mono(type));\n return next;\n}\n\n/**\n * The names this file imported, each with the type its own module gave it.\n *\n * Generalised over everything free in them, for two reasons: a generic helper\n * stays generic across the file boundary, and the variables belonging to the\n * pass that inferred them are replaced with fresh ones here rather than being\n * unified with anything in this file.\n */\nfunction withImports(env: TypeEnv, infer: Infer): TypeEnv {\n let next = env;\n for (const [name, type] of infer.imports ?? []) next = next.with(name, generalize(type, EMPTY));\n return next;\n}\n\nconst EMPTY: ReadonlySet<number> = new Set();\n\n/** The prelude is in scope everywhere, so inference knows what its verbs return. */\nfunction preludeEnv(): TypeEnv {\n let env = emptyEnv();\n for (const [name, spec] of Object.entries(PRELUDE_SPECS)) env = env.with(name, mono(spec.type));\n return env;\n}\n\nfunction hoist(args: {\n fns: readonly FnDecl[];\n reshaped: ReadonlySet<FnDecl>;\n ctx: TypeContext;\n env: TypeEnv;\n}): TypeEnv {\n let next = args.env;\n for (const decl of args.fns) {\n next = next.with(decl.name, mono(args.reshaped.has(decl) ? DYNAMIC : args.ctx.fresh()));\n }\n return next;\n}\n\nfunction generalizeFns(fns: readonly FnDecl[], env: TypeEnv, infer: Infer): TypeEnv {\n let next = env;\n for (const decl of fns) {\n const type = env.lookup(decl.name)?.type;\n if (!type) continue;\n // The declaration carries its own type, so hovering the name shows it.\n infer.types?.set(decl, prune(type));\n next = next.with(decl.name, generalize(prune(type), new Set()));\n }\n return next;\n}\n\nfunction bindValues(document: Document, env: TypeEnv, infer: Infer): TypeEnv {\n let next = env;\n for (const decl of document.decls) {\n if (ast.isLetStmt(decl)) next = checkStatement(decl, next, infer);\n }\n return next;\n}\n\n/** Check the executable parts: flows, fragments, and top-level statements. */\nfunction walk(document: Document, env: TypeEnv, infer: Infer): void {\n for (const decl of document.decls) checkDeclaration(decl, env, infer);\n}\n\nfunction checkDeclaration(decl: Declaration, env: TypeEnv, infer: Infer): void {\n if (ast.isFlowDecl(decl)) checkBlock(decl.body, env, infer);\n else if (ast.isFragmentDecl(decl)) checkFragment(decl, env, infer);\n else if (ast.isDecoDecl(decl)) checkDecoBody(decl, env, infer);\n else if (!ast.isFnDecl(decl) && !ast.isLetStmt(decl) && isExecutable(decl)) {\n checkStatement(decl as never, env, infer);\n }\n}\n\nfunction isExecutable(decl: Declaration): boolean {\n return !(ast.isTypeDecl(decl) || ast.isConfigDecl(decl) || ast.isMatrixDecl(decl));\n}\n\nfunction placeholder(infer: Infer): Type {\n return infer.ctx.fresh();\n}\n\nfunction problem(mismatch: TypeMismatch, uri: string): Problem {\n const title = titleOf(mismatch);\n return buildProblem({\n spec: mismatch.unit ? CODES.VN3012_UNIT_MISMATCH : CODES.VN3010_TYPE_MISMATCH,\n span: spanOf(mismatch.node, uri),\n title,\n });\n}\n\n/** A unit clash already reads as a sentence; anything else is a type mismatch. */\nfunction titleOf(mismatch: TypeMismatch): string {\n if (mismatch.unit) return mismatch.note ?? \"These values cannot be combined.\";\n if (mismatch.note) return `Type ${showType(mismatch.expected)} ${mismatch.note}.`;\n return `Type mismatch: expected ${showType(mismatch.expected)}, found ${showType(mismatch.actual)}.`;\n}\n\nfunction spanOf(node: { $cstNode?: unknown }, uri: string): Span {\n const cst = node.$cstNode as\n | { offset: number; length: number; range?: { start: { line: number; character: number } } }\n | undefined;\n const start = cst?.range?.start;\n return {\n uri,\n offset: cst?.offset ?? 0,\n length: cst?.length ?? 0,\n line: (start?.line ?? 0) + 1,\n column: (start?.character ?? 0) + 1,\n };\n}\n","import type { TypeSpec } from \"@venn-lang/types\";\nimport type { Document } from \"../generated/ast.js\";\nimport * as ast from \"../generated/ast.js\";\nimport { isPackageSpecifier } from \"../module/index.js\";\nimport type { TypeCatalog } from \"./catalog.types.js\";\nimport { checkTypes } from \"./check-types.js\";\nimport { type ResolveRef, specToType } from \"./spec-to-type.js\";\nimport { record, type Type } from \"./type.types.js\";\n\n/** What the names a file imported turned out to be, ready to bind in its env. */\nexport type ImportedTypes = ReadonlyMap<string, Type>;\n\nexport interface ImportedTypesArgs {\n document: Document;\n uri: string;\n /** Every module the import graph reached, already parsed, by resolved URI. */\n modules: ReadonlyMap<string, Document>;\n /** How a specifier written in one file names another. */\n resolve: (from: string, spec: string) => string;\n catalog?: TypeCatalog;\n /**\n * What each installed package publishes, derived from its `.d.ts`.\n *\n * Keyed by the specifier as written, because that is what the import says.\n * Absent for a host that has not derived any, which is every run in an editor\n * that has not installed anything yet.\n */\n packages?: ReadonlyMap<string, Record<string, TypeSpec>>;\n}\n\n/**\n * The types of the names a document imports, worked out from the files it names.\n *\n * Each module is checked on its own, with *its* imports resolved first, so a\n * `pub fn` that calls another file has the signature it really has. That is what\n * lets `triplo(\"texto\")` be refused against a `fn(number) -> number` declared\n * one file away.\n *\n * @returns a type per imported name. A name whose module publishes nothing for\n * it is simply absent, and the checker treats it as `dynamic`.\n */\nexport function importedTypes(args: ImportedTypesArgs): ImportedTypes {\n const state: State = {\n modules: args.modules,\n resolve: args.resolve,\n catalog: args.catalog,\n packages: args.packages,\n done: new Map(),\n busy: new Set([args.uri]),\n };\n return bindingsOf({ document: args.document, uri: args.uri, state });\n}\n\ninterface State {\n modules: ReadonlyMap<string, Document>;\n resolve: (from: string, spec: string) => string;\n catalog?: TypeCatalog;\n packages?: ReadonlyMap<string, Record<string, TypeSpec>>;\n done: Map<string, Map<string, Type>>;\n busy: Set<string>;\n}\n\n/** What each name a document imports binds to, following `import { … }` and `* as`. */\nfunction bindingsOf(args: { document: Document; uri: string; state: State }): Map<string, Type> {\n const out = new Map<string, Type>();\n for (const decl of args.document.imports) {\n if (!ast.isValueImport(decl)) continue;\n const published = isPackageSpecifier(decl.path)\n ? packageTypes(decl.path, args.state)\n : publishedBy(args.state.resolve(args.uri, decl.path), args.state);\n if (decl.wildcard) out.set(decl.wildcard, record(published));\n else for (const name of decl.names) take(out, published, name);\n }\n return out;\n}\n\nfunction take(out: Map<string, Type>, published: ReadonlyMap<string, Type>, name: string): void {\n const found = published.get(name);\n if (found) out.set(name, found);\n}\n\n/**\n * What an installed package publishes, as this language's types.\n *\n * Derived elsewhere, by whoever can read a `.d.ts`, and handed over already\n * converted, so the checker stays a checker and never learns what npm is.\n */\nfunction packageTypes(spec: string, state: State): ReadonlyMap<string, Type> {\n const found = state.packages?.get(spec);\n if (!found) return new Map();\n // A package's types name nothing of this language's, so a reference in one is\n // a name from a `.d.ts` that did not survive the conversion: `dynamic`.\n const unknown: ResolveRef = () => undefined;\n return new Map(Object.entries(found).map(([name, one]) => [name, specToType(one, unknown)]));\n}\n\n/**\n * The types a module publishes, checked once.\n *\n * A module already being checked answers with nothing rather than looping: two\n * files that call each other cannot both be inferred from the other, and the\n * honest answer for the second is that its signature is not yet known. Whatever\n * it declared outright is still read on its own next time round.\n */\nfunction publishedBy(uri: string, state: State): ReadonlyMap<string, Type> {\n const cached = state.done.get(uri);\n if (cached) return cached;\n const module = state.modules.get(uri);\n if (!module || state.busy.has(uri)) return new Map();\n state.busy.add(uri);\n const out = exportedTypes(module, uri, state);\n state.busy.delete(uri);\n state.done.set(uri, out);\n return out;\n}\n\nfunction exportedTypes(module: Document, uri: string, state: State): Map<string, Type> {\n const imports = bindingsOf({ document: module, uri, state });\n const checked = checkTypes(module, { uri, catalog: state.catalog, imports });\n const out = new Map<string, Type>();\n for (const decl of module.decls) {\n if (!ast.isFnDecl(decl) || !decl.export) continue;\n const found = checked.types.get(decl);\n if (found) out.set(decl.name, found);\n }\n return out;\n}\n","import type { Type } from \"./type.types.js\";\nimport { prune } from \"./unify.js\";\n\n/** What a built-in member does, and how it reads. */\nexport interface MemberDoc {\n doc: string;\n example?: string;\n}\n\nconst LIST: Record<string, MemberDoc> = {\n len: { doc: \"How many items it holds.\", example: \"[1, 2, 3].len # 3\" },\n first: { doc: \"The first item, or null when empty.\" },\n last: { doc: \"The last item, or null when empty.\" },\n isEmpty: { doc: \"True when there is nothing in it.\" },\n map: {\n doc: \"A new list, each item passed through the function.\",\n example: \"[1, 2].map(fn (x) => x * 2) # [2, 4]\",\n },\n filter: { doc: \"Only the items the function keeps.\", example: \"xs.filter(fn (x) => x > 2)\" },\n reduce: {\n doc: \"Fold the list into one value, from a starting one.\",\n example: \"xs.reduce(fn (total, x) => total + x, 0)\",\n },\n forEach: { doc: \"Run the function once per item, for its effect.\" },\n find: { doc: \"The first item the function accepts, or null.\" },\n some: { doc: \"True when the function accepts any item.\" },\n every: { doc: \"True when the function accepts all of them.\" },\n contains: { doc: \"True when the item is in the list.\" },\n indexOf: { doc: \"Where the item sits, or -1.\" },\n join: { doc: \"The items as one string, separated.\", example: \"['a', 'b'].join('-') # \\\"a-b\\\"\" },\n reverse: { doc: \"The same items, back to front.\" },\n flatten: { doc: \"One level of nesting removed.\" },\n sort: { doc: \"Sorted by a comparator. For a key, `sortBy` reads better.\" },\n slice: { doc: \"The items between two positions.\" },\n concat: { doc: \"This list followed by another.\" },\n push: { doc: \"A new list with the item appended — the original is untouched.\" },\n sum: { doc: \"The numbers added up.\" },\n average: { doc: \"The mean of the numbers, or 0 when empty.\" },\n min: { doc: \"The smallest number.\" },\n max: { doc: \"The largest number.\" },\n toMap: { doc: \"Entry pairs turned into a map.\", example: \"[['a', 1]].toMap # { a: 1 }\" },\n take: { doc: \"The first n items.\" },\n drop: { doc: \"Everything after the first n.\" },\n takeLast: { doc: \"The last n items.\" },\n dropLast: { doc: \"Everything but the last n.\" },\n takeWhile: { doc: \"Items from the start, while the function accepts them.\" },\n dropWhile: { doc: \"Skip the accepted run, keep the rest.\" },\n distinct: { doc: \"Duplicates removed, first occurrence kept.\" },\n distinctBy: { doc: \"Duplicates removed by a derived key.\" },\n sortBy: { doc: \"Sorted by a derived key.\", example: \"people.sortBy(fn (p) => p.age)\" },\n minBy: { doc: \"The item with the smallest score.\" },\n maxBy: { doc: \"The item with the largest score.\", example: \"people.maxBy(fn (p) => p.age)\" },\n sumBy: { doc: \"The scores added up.\" },\n flatMap: { doc: \"Map, then flatten one level.\" },\n groupBy: {\n doc: \"A map from key to the items sharing it.\",\n example: \"people.groupBy(fn (p) => p.team)\",\n },\n countBy: { doc: \"A map from key to how many items share it.\" },\n keyBy: { doc: \"A map from key to item — an index, last one wins.\" },\n partition: { doc: \"Two lists: what the function kept, and what it rejected.\" },\n chunk: { doc: \"Split into runs of n.\", example: \"[1,2,3,4,5].chunk(2) # [[1,2],[3,4],[5]]\" },\n windows: { doc: \"Every consecutive run of n.\", example: \"[1,2,3].windows(2) # [[1,2],[2,3]]\" },\n pairwise: { doc: \"Every consecutive pair.\" },\n zip: { doc: \"Paired with another list, item by item.\" },\n unzip: { doc: \"Pairs pulled apart into separate lists.\" },\n};\n\nconst STRING: Record<string, MemberDoc> = {\n len: { doc: \"How many characters it holds.\" },\n upper: { doc: \"In upper case.\" },\n lower: { doc: \"In lower case.\" },\n trim: { doc: \"Without leading or trailing blanks.\" },\n trimStart: { doc: \"Without leading blanks.\" },\n trimEnd: { doc: \"Without trailing blanks.\" },\n reverse: { doc: \"The characters back to front.\" },\n toNumber: { doc: \"Read as a number.\" },\n isEmpty: { doc: \"True when it has no characters.\" },\n isBlank: { doc: \"True when it is empty or only blanks.\" },\n split: { doc: \"Cut into a list on a separator.\", example: \"'a,b'.split(',') # ['a', 'b']\" },\n replace: { doc: \"Every occurrence swapped for another.\" },\n contains: { doc: \"True when the text appears inside.\" },\n startsWith: { doc: \"True when it begins with the text.\" },\n endsWith: { doc: \"True when it ends with the text.\" },\n slice: { doc: \"The characters between two positions.\" },\n repeat: { doc: \"Itself, n times over.\" },\n padStart: { doc: \"Padded on the left to a width.\" },\n padEnd: { doc: \"Padded on the right to a width.\" },\n indexOf: { doc: \"Where the text starts, or -1.\" },\n words: { doc: \"Split on whitespace.\", example: \"'a b c'.words # ['a', 'b', 'c']\" },\n lines: { doc: \"Split on newlines.\" },\n chars: { doc: \"Each character as its own string.\" },\n capitalize: { doc: \"First letter upper-cased.\" },\n title: { doc: \"Every word capitalised.\" },\n slugify: {\n doc: \"URL-safe: accents stripped, spaces to dashes.\",\n example: \"'João Silva'.slugify # \\\"joao-silva\\\"\",\n },\n count: { doc: \"How many times the text appears.\" },\n matches: {\n doc: \"Every match of a pattern, as a list.\",\n example: \"'a1b22'.matches('[0-9]+') # ['1', '22']\",\n },\n test: { doc: \"True when the pattern matches anywhere.\" },\n before: { doc: \"What comes before the marker.\" },\n after: { doc: \"What comes after the marker.\" },\n ensureStart: { doc: \"The prefix added, unless it is already there.\" },\n ensureEnd: { doc: \"The suffix added, unless it is already there.\" },\n};\n\nconst MAP: Record<string, MemberDoc> = {\n len: { doc: \"How many entries it holds.\" },\n keys: { doc: \"Its keys, as a list.\" },\n values: { doc: \"Its values, as a list.\" },\n entries: { doc: \"Its `[key, value]` pairs.\" },\n has: { doc: \"True when the key is present.\" },\n get: { doc: \"The value under a key, or null.\" },\n merge: { doc: \"This map with another laid over it.\" },\n mergeDeep: {\n doc: \"Merged recursively, keeping untouched branches.\",\n example: \"cfg.mergeDeep({ server: { port: 90 } })\",\n },\n mapValues: { doc: \"Same keys, each value passed through the function.\" },\n mapKeys: { doc: \"Same values, each key passed through the function.\" },\n filterValues: { doc: \"Only the entries whose value the function keeps.\" },\n pick: { doc: \"Only the named keys.\", example: \"cfg.pick('host', 'port')\" },\n omit: { doc: \"Everything but the named keys.\" },\n invert: { doc: \"Keys and values swapped.\" },\n isEmpty: { doc: \"True when it has no entries.\" },\n getPath: {\n doc: \"Reach into nested data by a dotted path.\",\n example: \"cfg.getPath('server.port')\",\n },\n hasPath: { doc: \"True when the dotted path leads somewhere.\" },\n};\n\nconst NUMBER: Record<string, MemberDoc> = {\n abs: { doc: \"Its distance from zero.\" },\n floor: { doc: \"Rounded down to a whole number.\" },\n ceil: { doc: \"Rounded up to a whole number.\" },\n sign: { doc: \"-1, 0 or 1.\" },\n sqrt: { doc: \"Its square root.\" },\n isEven: { doc: \"True when it divides by two.\" },\n isOdd: { doc: \"True when it does not.\" },\n round: { doc: \"Rounded to n decimal places.\", example: \"(3.14159).round(2) # 3.14\" },\n toFixed: { doc: \"As text with exactly n decimals.\" },\n clamp: { doc: \"Held between a low and a high bound.\", example: \"(99).clamp(0, 10) # 10\" },\n pow: { doc: \"Raised to a power.\" },\n times: { doc: \"A list counting from 0 up to it.\", example: \"(3).times # [0, 1, 2]\" },\n toString: { doc: \"As text.\" },\n toMs: { doc: \"Read as a duration in milliseconds.\", example: \"1500.toMs # 1.5s\" },\n toSeconds: { doc: \"Read as a duration in seconds.\" },\n toMinutes: { doc: \"Read as a duration in minutes.\" },\n toHours: { doc: \"Read as a duration in hours.\" },\n toBytes: { doc: \"Read as a size in bytes.\" },\n toKb: { doc: \"Read as a size in kilobytes.\", example: \"2048.toKb # 2mb\" },\n toMb: { doc: \"Read as a size in megabytes.\" },\n toGb: { doc: \"Read as a size in gigabytes.\" },\n toRatio: { doc: \"Read as a percent, from a fraction of one.\", example: \"0.5.toRatio # 50%\" },\n toPercent: { doc: \"Read as a percent, from a number out of a hundred.\" },\n};\n\nconst DURATION: Record<string, MemberDoc> = {\n ms: { doc: \"As a plain number of milliseconds.\", example: \"1.5s.ms # 1500\" },\n seconds: { doc: \"As a plain number of seconds.\" },\n minutes: { doc: \"As a plain number of minutes.\", example: \"90s.minutes # 1.5\" },\n hours: { doc: \"As a plain number of hours.\" },\n};\n\nconst SIZE: Record<string, MemberDoc> = {\n bytes: { doc: \"As a plain number of bytes.\" },\n kb: { doc: \"As a plain number of kilobytes.\", example: \"2mb.kb # 2048\" },\n mb: { doc: \"As a plain number of megabytes.\" },\n gb: { doc: \"As a plain number of gigabytes.\" },\n};\n\nconst PERCENT: Record<string, MemberDoc> = {\n ratio: { doc: \"As a fraction of one.\", example: \"50%.ratio # 0.5\" },\n percent: { doc: \"As a number out of a hundred.\", example: \"0.5.round(2)\" },\n of: { doc: \"That share of a number.\", example: \"12%.of(50) # 6\" },\n};\n\nconst TASK: Record<string, MemberDoc> = {\n wait: { doc: \"The value, once the work has finished.\", example: \"let page = job.wait\" },\n done: { doc: \"True once it has finished, either way.\" },\n failed: { doc: \"True when it finished by failing.\" },\n settle: { doc: \"Wait without the failure spreading — the value, or nothing.\" },\n};\n\n/** Documentation for every built-in member, by the kind of value it hangs off. */\nexport const MEMBER_DOCS: Readonly<Record<string, Record<string, MemberDoc>>> = {\n list: LIST,\n string: STRING,\n map: MAP,\n number: NUMBER,\n duration: DURATION,\n size: SIZE,\n percent: PERCENT,\n task: TASK,\n};\n\nconst KINDS = new Set([\"string\", \"number\", \"duration\", \"size\", \"percent\"]);\n\n/** Which table of members a type answers to, if any. */\nexport function memberKind(type: Type): string | undefined {\n const t = prune(type);\n if (t.kind === \"list\") return \"list\";\n if (t.kind === \"record\") return \"map\";\n if (t.kind !== \"prim\") return undefined;\n return KINDS.has(t.name) ? t.name : undefined;\n}\n"],"mappings":";;;;;;;;;;;;AAUA,SAAgB,SAAS,MAAmC;CAC1D,MAAM,YAAY,KAAK,MAAM,QAAQ,CAAC;CACtC,IAAI,UAAU,WAAW,GAAG,OAAO,KAAK;CACxC,OAAO,CAAC,GAAG,UAAU,KAAK,QAAQ,IAAI,KAAK,GAAG,GAAG,KAAK,IAAI;AAC5D;;;;;;;ACNA,MAAa,gBAAgB;CACzB,IAAI;CACJ,IAAI;CACJ,SAAS;CACT,SAAS;CACT,QAAQ;CACR,QAAQ;CACR,IAAI;AACR;AAkGA,MAAa,aAAa;C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