@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
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,3654 @@
|
|
|
1
|
+
import * as langium from "langium";
|
|
2
|
+
import { AstNode, AstNode as AstNode$1, DefaultLexer, LangiumCoreServices, LangiumGeneratedCoreServices, LangiumGeneratedSharedCoreServices, LangiumSharedCoreServices, LanguageMetaData, LexerResult, Module, TokenizeOptions } from "langium";
|
|
3
|
+
import { TypeSpec } from "@venn-lang/types";
|
|
4
|
+
//#region src/generated/ast.d.ts
|
|
5
|
+
declare const VennTerminals: {
|
|
6
|
+
NL: RegExp;
|
|
7
|
+
WS: RegExp;
|
|
8
|
+
COMMENT: RegExp;
|
|
9
|
+
INSTANT: RegExp;
|
|
10
|
+
STRING: RegExp;
|
|
11
|
+
NUMBER: RegExp;
|
|
12
|
+
ID: RegExp;
|
|
13
|
+
};
|
|
14
|
+
type VennTerminalNames = keyof typeof VennTerminals;
|
|
15
|
+
type VennKeywordNames = "!" | "!=" | "%" | "&&" | "(" | ")" | "*" | "+" | "," | "-" | "->" | "." | "/" | ":" | "<" | "<=" | "=" | "==" | "=>" | ">" | ">=" | "?" | "?." | "??" | "@" | "[" | "]" | "afterEach" | "all" | "as" | "beforeEach" | "break" | "capture" | "catch" | "config" | "const" | "continue" | "dataset" | "deco" | "defer" | "else" | "expect" | "factory" | "false" | "finally" | "flow" | "fn" | "forEach" | "fragment" | "from" | "group" | "if" | "import" | "in" | "let" | "matrix" | "module" | "not" | "null" | "on" | "parallel" | "pub" | "race" | "repeat" | "report" | "return" | "run" | "setup" | "soft" | "step" | "teardown" | "true" | "try" | "type" | "use" | "while" | "{" | "|" | "||" | "}" | "~=";
|
|
16
|
+
type VennTokenNames = VennTerminalNames | VennKeywordNames;
|
|
17
|
+
interface ActionCall extends Declaration, Statement {
|
|
18
|
+
readonly $type: 'ActionCall';
|
|
19
|
+
args: Array<Expr>;
|
|
20
|
+
call?: ArgList;
|
|
21
|
+
called: boolean;
|
|
22
|
+
opts?: MapLit;
|
|
23
|
+
target: QualifiedName;
|
|
24
|
+
}
|
|
25
|
+
declare const ActionCall: {
|
|
26
|
+
readonly $type: 'ActionCall';
|
|
27
|
+
readonly annotations: 'annotations';
|
|
28
|
+
readonly args: 'args';
|
|
29
|
+
readonly call: 'call';
|
|
30
|
+
readonly called: 'called';
|
|
31
|
+
readonly opts: 'opts';
|
|
32
|
+
readonly target: 'target';
|
|
33
|
+
};
|
|
34
|
+
declare function isActionCall(item: unknown): item is ActionCall;
|
|
35
|
+
interface Annotation extends langium.AstNode {
|
|
36
|
+
readonly $container: Declaration | FieldDecl | Param | Statement;
|
|
37
|
+
readonly $type: 'Annotation';
|
|
38
|
+
args?: ArgList;
|
|
39
|
+
name: string;
|
|
40
|
+
}
|
|
41
|
+
declare const Annotation: {
|
|
42
|
+
readonly $type: 'Annotation';
|
|
43
|
+
readonly args: 'args';
|
|
44
|
+
readonly name: 'name';
|
|
45
|
+
};
|
|
46
|
+
declare function isAnnotation(item: unknown): item is Annotation;
|
|
47
|
+
interface Arg extends langium.AstNode {
|
|
48
|
+
readonly $container: ArgList;
|
|
49
|
+
readonly $type: 'Arg';
|
|
50
|
+
name?: string;
|
|
51
|
+
value: Expr;
|
|
52
|
+
}
|
|
53
|
+
declare const Arg: {
|
|
54
|
+
readonly $type: 'Arg';
|
|
55
|
+
readonly name: 'name';
|
|
56
|
+
readonly value: 'value';
|
|
57
|
+
};
|
|
58
|
+
declare function isArg(item: unknown): item is Arg;
|
|
59
|
+
interface ArgList extends langium.AstNode {
|
|
60
|
+
readonly $container: ActionCall | Annotation | Call | RunStmt;
|
|
61
|
+
readonly $type: 'ArgList';
|
|
62
|
+
args: Array<Arg>;
|
|
63
|
+
}
|
|
64
|
+
declare const ArgList: {
|
|
65
|
+
readonly $type: 'ArgList';
|
|
66
|
+
readonly args: 'args';
|
|
67
|
+
};
|
|
68
|
+
declare function isArgList(item: unknown): item is ArgList;
|
|
69
|
+
interface Binary extends langium.AstNode {
|
|
70
|
+
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;
|
|
71
|
+
readonly $type: 'Binary';
|
|
72
|
+
left: Expr;
|
|
73
|
+
operator: '!=' | '%' | '&&' | '*' | '+' | '-' | '/' | '<' | '<=' | '==' | '>' | '>=' | '??' | 'in' | '||' | '~=';
|
|
74
|
+
right: Expr;
|
|
75
|
+
}
|
|
76
|
+
declare const Binary: {
|
|
77
|
+
readonly $type: 'Binary';
|
|
78
|
+
readonly left: 'left';
|
|
79
|
+
readonly operator: 'operator';
|
|
80
|
+
readonly right: 'right';
|
|
81
|
+
};
|
|
82
|
+
declare function isBinary(item: unknown): item is Binary;
|
|
83
|
+
interface Block extends langium.AstNode {
|
|
84
|
+
readonly $container: DecoDecl | FlowDecl | ForEachStmt | FragmentDecl | GroupDecl | IfStmt | LifecycleDecl | ParallelStmt | RaceStmt | RepeatStmt | StepDecl | TryStmt | WhileStmt;
|
|
85
|
+
readonly $type: 'Block';
|
|
86
|
+
stmts: Array<Statement>;
|
|
87
|
+
}
|
|
88
|
+
declare const Block: {
|
|
89
|
+
readonly $type: 'Block';
|
|
90
|
+
readonly stmts: 'stmts';
|
|
91
|
+
};
|
|
92
|
+
declare function isBlock(item: unknown): item is Block;
|
|
93
|
+
interface BoolLit extends langium.AstNode {
|
|
94
|
+
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;
|
|
95
|
+
readonly $type: 'BoolLit';
|
|
96
|
+
value: 'false' | 'true';
|
|
97
|
+
}
|
|
98
|
+
declare const BoolLit: {
|
|
99
|
+
readonly $type: 'BoolLit';
|
|
100
|
+
readonly value: 'value';
|
|
101
|
+
};
|
|
102
|
+
declare function isBoolLit(item: unknown): item is BoolLit;
|
|
103
|
+
interface BreakStmt extends Statement {
|
|
104
|
+
readonly $type: 'BreakStmt';
|
|
105
|
+
}
|
|
106
|
+
declare const BreakStmt: {
|
|
107
|
+
readonly $type: 'BreakStmt';
|
|
108
|
+
readonly annotations: 'annotations';
|
|
109
|
+
};
|
|
110
|
+
declare function isBreakStmt(item: unknown): item is BreakStmt;
|
|
111
|
+
interface Call extends langium.AstNode {
|
|
112
|
+
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;
|
|
113
|
+
readonly $type: 'Call';
|
|
114
|
+
args?: ArgList;
|
|
115
|
+
callee: Expr;
|
|
116
|
+
}
|
|
117
|
+
declare const Call: {
|
|
118
|
+
readonly $type: 'Call';
|
|
119
|
+
readonly args: 'args';
|
|
120
|
+
readonly callee: 'callee';
|
|
121
|
+
};
|
|
122
|
+
declare function isCall(item: unknown): item is Call;
|
|
123
|
+
interface CaptureStmt extends Statement {
|
|
124
|
+
readonly $type: 'CaptureStmt';
|
|
125
|
+
name: string;
|
|
126
|
+
opts?: MapLit;
|
|
127
|
+
value: Expr;
|
|
128
|
+
}
|
|
129
|
+
declare const CaptureStmt: {
|
|
130
|
+
readonly $type: 'CaptureStmt';
|
|
131
|
+
readonly annotations: 'annotations';
|
|
132
|
+
readonly name: 'name';
|
|
133
|
+
readonly opts: 'opts';
|
|
134
|
+
readonly value: 'value';
|
|
135
|
+
};
|
|
136
|
+
declare function isCaptureStmt(item: unknown): item is CaptureStmt;
|
|
137
|
+
interface ConfigDecl extends Declaration {
|
|
138
|
+
readonly $type: 'ConfigDecl';
|
|
139
|
+
body: MapLit;
|
|
140
|
+
}
|
|
141
|
+
declare const ConfigDecl: {
|
|
142
|
+
readonly $type: 'ConfigDecl';
|
|
143
|
+
readonly annotations: 'annotations';
|
|
144
|
+
readonly body: 'body';
|
|
145
|
+
};
|
|
146
|
+
declare function isConfigDecl(item: unknown): item is ConfigDecl;
|
|
147
|
+
interface ContinueStmt extends Statement {
|
|
148
|
+
readonly $type: 'ContinueStmt';
|
|
149
|
+
}
|
|
150
|
+
declare const ContinueStmt: {
|
|
151
|
+
readonly $type: 'ContinueStmt';
|
|
152
|
+
readonly annotations: 'annotations';
|
|
153
|
+
};
|
|
154
|
+
declare function isContinueStmt(item: unknown): item is ContinueStmt;
|
|
155
|
+
interface DatasetDecl extends Declaration {
|
|
156
|
+
readonly $type: 'DatasetDecl';
|
|
157
|
+
declaredType?: TypeRef;
|
|
158
|
+
name: string;
|
|
159
|
+
value: Expr;
|
|
160
|
+
}
|
|
161
|
+
declare const DatasetDecl: {
|
|
162
|
+
readonly $type: 'DatasetDecl';
|
|
163
|
+
readonly annotations: 'annotations';
|
|
164
|
+
readonly declaredType: 'declaredType';
|
|
165
|
+
readonly name: 'name';
|
|
166
|
+
readonly value: 'value';
|
|
167
|
+
};
|
|
168
|
+
declare function isDatasetDecl(item: unknown): item is DatasetDecl;
|
|
169
|
+
interface Declaration extends langium.AstNode {
|
|
170
|
+
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';
|
|
171
|
+
annotations: Array<Annotation>;
|
|
172
|
+
}
|
|
173
|
+
declare const Declaration: {
|
|
174
|
+
readonly $type: 'Declaration';
|
|
175
|
+
readonly annotations: 'annotations';
|
|
176
|
+
};
|
|
177
|
+
declare function isDeclaration(item: unknown): item is Declaration;
|
|
178
|
+
interface DecoDecl extends Declaration {
|
|
179
|
+
readonly $type: 'DecoDecl';
|
|
180
|
+
body: Block;
|
|
181
|
+
export: boolean;
|
|
182
|
+
name: string;
|
|
183
|
+
params?: ParamList;
|
|
184
|
+
}
|
|
185
|
+
declare const DecoDecl: {
|
|
186
|
+
readonly $type: 'DecoDecl';
|
|
187
|
+
readonly annotations: 'annotations';
|
|
188
|
+
readonly body: 'body';
|
|
189
|
+
readonly export: 'export';
|
|
190
|
+
readonly name: 'name';
|
|
191
|
+
readonly params: 'params';
|
|
192
|
+
};
|
|
193
|
+
declare function isDecoDecl(item: unknown): item is DecoDecl;
|
|
194
|
+
interface Document extends langium.AstNode {
|
|
195
|
+
readonly $type: 'Document';
|
|
196
|
+
decls: Array<Declaration>;
|
|
197
|
+
imports: Array<ImportDecl>;
|
|
198
|
+
name?: QualifiedName;
|
|
199
|
+
}
|
|
200
|
+
declare const Document: {
|
|
201
|
+
readonly $type: 'Document';
|
|
202
|
+
readonly decls: 'decls';
|
|
203
|
+
readonly imports: 'imports';
|
|
204
|
+
readonly name: 'name';
|
|
205
|
+
};
|
|
206
|
+
declare function isDocument(item: unknown): item is Document;
|
|
207
|
+
type ElseBranch = Block | IfStmt;
|
|
208
|
+
declare const ElseBranch: {
|
|
209
|
+
readonly $type: 'ElseBranch';
|
|
210
|
+
};
|
|
211
|
+
declare function isElseBranch(item: unknown): item is ElseBranch;
|
|
212
|
+
interface ExpectStmt extends Declaration, Statement {
|
|
213
|
+
readonly $type: 'ExpectStmt';
|
|
214
|
+
checks: Array<Expr>;
|
|
215
|
+
matcher?: MatcherClause;
|
|
216
|
+
modifier?: 'all' | 'soft';
|
|
217
|
+
negate: boolean;
|
|
218
|
+
subject?: Expr;
|
|
219
|
+
}
|
|
220
|
+
declare const ExpectStmt: {
|
|
221
|
+
readonly $type: 'ExpectStmt';
|
|
222
|
+
readonly annotations: 'annotations';
|
|
223
|
+
readonly checks: 'checks';
|
|
224
|
+
readonly matcher: 'matcher';
|
|
225
|
+
readonly modifier: 'modifier';
|
|
226
|
+
readonly negate: 'negate';
|
|
227
|
+
readonly subject: 'subject';
|
|
228
|
+
};
|
|
229
|
+
declare function isExpectStmt(item: unknown): item is ExpectStmt;
|
|
230
|
+
type Expr = Binary | BoolLit | Call | FnExpr | Index | InstantLit | ListLit | MapLit | Member | NullLit | NumberLit | Ref | StringLit | Ternary | Unary;
|
|
231
|
+
declare const Expr: {
|
|
232
|
+
readonly $type: 'Expr';
|
|
233
|
+
};
|
|
234
|
+
declare function isExpr(item: unknown): item is Expr;
|
|
235
|
+
interface FactoryDecl extends Declaration {
|
|
236
|
+
readonly $type: 'FactoryDecl';
|
|
237
|
+
body: MapLit;
|
|
238
|
+
name: string;
|
|
239
|
+
}
|
|
240
|
+
declare const FactoryDecl: {
|
|
241
|
+
readonly $type: 'FactoryDecl';
|
|
242
|
+
readonly annotations: 'annotations';
|
|
243
|
+
readonly body: 'body';
|
|
244
|
+
readonly name: 'name';
|
|
245
|
+
};
|
|
246
|
+
declare function isFactoryDecl(item: unknown): item is FactoryDecl;
|
|
247
|
+
interface FieldDecl extends langium.AstNode {
|
|
248
|
+
readonly $container: TypeBody;
|
|
249
|
+
readonly $type: 'FieldDecl';
|
|
250
|
+
annotations: Array<Annotation>;
|
|
251
|
+
fieldType: TypeRef;
|
|
252
|
+
name: string;
|
|
253
|
+
optional: boolean;
|
|
254
|
+
}
|
|
255
|
+
declare const FieldDecl: {
|
|
256
|
+
readonly $type: 'FieldDecl';
|
|
257
|
+
readonly annotations: 'annotations';
|
|
258
|
+
readonly fieldType: 'fieldType';
|
|
259
|
+
readonly name: 'name';
|
|
260
|
+
readonly optional: 'optional';
|
|
261
|
+
};
|
|
262
|
+
declare function isFieldDecl(item: unknown): item is FieldDecl;
|
|
263
|
+
interface FlowDecl extends Declaration {
|
|
264
|
+
readonly $type: 'FlowDecl';
|
|
265
|
+
body: Block;
|
|
266
|
+
title: string;
|
|
267
|
+
}
|
|
268
|
+
declare const FlowDecl: {
|
|
269
|
+
readonly $type: 'FlowDecl';
|
|
270
|
+
readonly annotations: 'annotations';
|
|
271
|
+
readonly body: 'body';
|
|
272
|
+
readonly title: 'title';
|
|
273
|
+
};
|
|
274
|
+
declare function isFlowDecl(item: unknown): item is FlowDecl;
|
|
275
|
+
interface FnBody extends langium.AstNode {
|
|
276
|
+
readonly $container: FnDecl | FnExpr;
|
|
277
|
+
readonly $type: 'FnBody';
|
|
278
|
+
locals: Array<LetStmt>;
|
|
279
|
+
result: Expr;
|
|
280
|
+
}
|
|
281
|
+
declare const FnBody: {
|
|
282
|
+
readonly $type: 'FnBody';
|
|
283
|
+
readonly locals: 'locals';
|
|
284
|
+
readonly result: 'result';
|
|
285
|
+
};
|
|
286
|
+
declare function isFnBody(item: unknown): item is FnBody;
|
|
287
|
+
interface FnDecl extends Declaration {
|
|
288
|
+
readonly $type: 'FnDecl';
|
|
289
|
+
body: FnBody;
|
|
290
|
+
export: boolean;
|
|
291
|
+
name: string;
|
|
292
|
+
params?: ParamList;
|
|
293
|
+
returns?: TypeRef;
|
|
294
|
+
}
|
|
295
|
+
declare const FnDecl: {
|
|
296
|
+
readonly $type: 'FnDecl';
|
|
297
|
+
readonly annotations: 'annotations';
|
|
298
|
+
readonly body: 'body';
|
|
299
|
+
readonly export: 'export';
|
|
300
|
+
readonly name: 'name';
|
|
301
|
+
readonly params: 'params';
|
|
302
|
+
readonly returns: 'returns';
|
|
303
|
+
};
|
|
304
|
+
declare function isFnDecl(item: unknown): item is FnDecl;
|
|
305
|
+
interface FnExpr extends langium.AstNode {
|
|
306
|
+
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;
|
|
307
|
+
readonly $type: 'FnExpr';
|
|
308
|
+
body: FnBody;
|
|
309
|
+
params: ParamList;
|
|
310
|
+
returns?: TypeRef;
|
|
311
|
+
}
|
|
312
|
+
declare const FnExpr: {
|
|
313
|
+
readonly $type: 'FnExpr';
|
|
314
|
+
readonly body: 'body';
|
|
315
|
+
readonly params: 'params';
|
|
316
|
+
readonly returns: 'returns';
|
|
317
|
+
};
|
|
318
|
+
declare function isFnExpr(item: unknown): item is FnExpr;
|
|
319
|
+
interface ForEachStmt extends Declaration, Statement {
|
|
320
|
+
readonly $type: 'ForEachStmt';
|
|
321
|
+
body: Block;
|
|
322
|
+
item: string;
|
|
323
|
+
opts?: MapLit;
|
|
324
|
+
source: Expr;
|
|
325
|
+
}
|
|
326
|
+
declare const ForEachStmt: {
|
|
327
|
+
readonly $type: 'ForEachStmt';
|
|
328
|
+
readonly annotations: 'annotations';
|
|
329
|
+
readonly body: 'body';
|
|
330
|
+
readonly item: 'item';
|
|
331
|
+
readonly opts: 'opts';
|
|
332
|
+
readonly source: 'source';
|
|
333
|
+
};
|
|
334
|
+
declare function isForEachStmt(item: unknown): item is ForEachStmt;
|
|
335
|
+
interface FragmentDecl extends Declaration {
|
|
336
|
+
readonly $type: 'FragmentDecl';
|
|
337
|
+
body: Block;
|
|
338
|
+
export: boolean;
|
|
339
|
+
name: string;
|
|
340
|
+
params?: ParamList;
|
|
341
|
+
returns?: TypeRef;
|
|
342
|
+
}
|
|
343
|
+
declare const FragmentDecl: {
|
|
344
|
+
readonly $type: 'FragmentDecl';
|
|
345
|
+
readonly annotations: 'annotations';
|
|
346
|
+
readonly body: 'body';
|
|
347
|
+
readonly export: 'export';
|
|
348
|
+
readonly name: 'name';
|
|
349
|
+
readonly params: 'params';
|
|
350
|
+
readonly returns: 'returns';
|
|
351
|
+
};
|
|
352
|
+
declare function isFragmentDecl(item: unknown): item is FragmentDecl;
|
|
353
|
+
interface GroupDecl extends Statement {
|
|
354
|
+
readonly $type: 'GroupDecl';
|
|
355
|
+
body: Block;
|
|
356
|
+
title: string;
|
|
357
|
+
}
|
|
358
|
+
declare const GroupDecl: {
|
|
359
|
+
readonly $type: 'GroupDecl';
|
|
360
|
+
readonly annotations: 'annotations';
|
|
361
|
+
readonly body: 'body';
|
|
362
|
+
readonly title: 'title';
|
|
363
|
+
};
|
|
364
|
+
declare function isGroupDecl(item: unknown): item is GroupDecl;
|
|
365
|
+
interface IfStmt extends Declaration, Statement {
|
|
366
|
+
readonly $container: IfStmt;
|
|
367
|
+
readonly $type: 'IfStmt';
|
|
368
|
+
cond: Expr;
|
|
369
|
+
otherwise?: ElseBranch;
|
|
370
|
+
then: Block;
|
|
371
|
+
}
|
|
372
|
+
declare const IfStmt: {
|
|
373
|
+
readonly $type: 'IfStmt';
|
|
374
|
+
readonly annotations: 'annotations';
|
|
375
|
+
readonly cond: 'cond';
|
|
376
|
+
readonly otherwise: 'otherwise';
|
|
377
|
+
readonly then: 'then';
|
|
378
|
+
};
|
|
379
|
+
declare function isIfStmt(item: unknown): item is IfStmt;
|
|
380
|
+
type ImportDecl = UseDecl | ValueImport;
|
|
381
|
+
declare const ImportDecl: {
|
|
382
|
+
readonly $type: 'ImportDecl';
|
|
383
|
+
};
|
|
384
|
+
declare function isImportDecl(item: unknown): item is ImportDecl;
|
|
385
|
+
interface Index extends langium.AstNode {
|
|
386
|
+
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;
|
|
387
|
+
readonly $type: 'Index';
|
|
388
|
+
index: Expr;
|
|
389
|
+
receiver: Expr;
|
|
390
|
+
}
|
|
391
|
+
declare const Index: {
|
|
392
|
+
readonly $type: 'Index';
|
|
393
|
+
readonly index: 'index';
|
|
394
|
+
readonly receiver: 'receiver';
|
|
395
|
+
};
|
|
396
|
+
declare function isIndex(item: unknown): item is Index;
|
|
397
|
+
interface InstantLit extends langium.AstNode {
|
|
398
|
+
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;
|
|
399
|
+
readonly $type: 'InstantLit';
|
|
400
|
+
value: string;
|
|
401
|
+
}
|
|
402
|
+
declare const InstantLit: {
|
|
403
|
+
readonly $type: 'InstantLit';
|
|
404
|
+
readonly value: 'value';
|
|
405
|
+
};
|
|
406
|
+
declare function isInstantLit(item: unknown): item is InstantLit;
|
|
407
|
+
interface LetStmt extends Declaration, Statement {
|
|
408
|
+
readonly $container: FnBody;
|
|
409
|
+
readonly $type: 'LetStmt';
|
|
410
|
+
args: Array<Expr>;
|
|
411
|
+
declaredType?: TypeRef;
|
|
412
|
+
kind: 'const' | 'let';
|
|
413
|
+
name: string;
|
|
414
|
+
opts?: MapLit;
|
|
415
|
+
value: Expr;
|
|
416
|
+
}
|
|
417
|
+
declare const LetStmt: {
|
|
418
|
+
readonly $type: 'LetStmt';
|
|
419
|
+
readonly annotations: 'annotations';
|
|
420
|
+
readonly args: 'args';
|
|
421
|
+
readonly declaredType: 'declaredType';
|
|
422
|
+
readonly kind: 'kind';
|
|
423
|
+
readonly name: 'name';
|
|
424
|
+
readonly opts: 'opts';
|
|
425
|
+
readonly value: 'value';
|
|
426
|
+
};
|
|
427
|
+
declare function isLetStmt(item: unknown): item is LetStmt;
|
|
428
|
+
interface LifecycleDecl extends Declaration, Statement {
|
|
429
|
+
readonly $type: 'LifecycleDecl';
|
|
430
|
+
arg?: Expr;
|
|
431
|
+
body: Block;
|
|
432
|
+
event?: string;
|
|
433
|
+
hook?: 'afterEach' | 'beforeEach' | 'defer' | 'setup' | 'teardown';
|
|
434
|
+
}
|
|
435
|
+
declare const LifecycleDecl: {
|
|
436
|
+
readonly $type: 'LifecycleDecl';
|
|
437
|
+
readonly annotations: 'annotations';
|
|
438
|
+
readonly arg: 'arg';
|
|
439
|
+
readonly body: 'body';
|
|
440
|
+
readonly event: 'event';
|
|
441
|
+
readonly hook: 'hook';
|
|
442
|
+
};
|
|
443
|
+
declare function isLifecycleDecl(item: unknown): item is LifecycleDecl;
|
|
444
|
+
interface ListLit extends langium.AstNode {
|
|
445
|
+
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;
|
|
446
|
+
readonly $type: 'ListLit';
|
|
447
|
+
items: Array<Expr>;
|
|
448
|
+
}
|
|
449
|
+
declare const ListLit: {
|
|
450
|
+
readonly $type: 'ListLit';
|
|
451
|
+
readonly items: 'items';
|
|
452
|
+
};
|
|
453
|
+
declare function isListLit(item: unknown): item is ListLit;
|
|
454
|
+
interface LiteralType$1 extends langium.AstNode {
|
|
455
|
+
readonly $container: TypeRef;
|
|
456
|
+
readonly $type: 'LiteralType';
|
|
457
|
+
value: string;
|
|
458
|
+
}
|
|
459
|
+
declare const LiteralType$1: {
|
|
460
|
+
readonly $type: 'LiteralType';
|
|
461
|
+
readonly value: 'value';
|
|
462
|
+
};
|
|
463
|
+
declare function isLiteralType(item: unknown): item is LiteralType$1;
|
|
464
|
+
interface MapEntry extends langium.AstNode {
|
|
465
|
+
readonly $container: MapLit;
|
|
466
|
+
readonly $type: 'MapEntry';
|
|
467
|
+
key: MapKey;
|
|
468
|
+
value: Expr;
|
|
469
|
+
}
|
|
470
|
+
declare const MapEntry: {
|
|
471
|
+
readonly $type: 'MapEntry';
|
|
472
|
+
readonly key: 'key';
|
|
473
|
+
readonly value: 'value';
|
|
474
|
+
};
|
|
475
|
+
declare function isMapEntry(item: unknown): item is MapEntry;
|
|
476
|
+
type MapKey = Word | string;
|
|
477
|
+
declare function isMapKey(item: unknown): item is MapKey;
|
|
478
|
+
interface MapLit extends langium.AstNode {
|
|
479
|
+
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;
|
|
480
|
+
readonly $type: 'MapLit';
|
|
481
|
+
entries: Array<MapEntry>;
|
|
482
|
+
}
|
|
483
|
+
declare const MapLit: {
|
|
484
|
+
readonly $type: 'MapLit';
|
|
485
|
+
readonly entries: 'entries';
|
|
486
|
+
};
|
|
487
|
+
declare function isMapLit(item: unknown): item is MapLit;
|
|
488
|
+
interface MatcherClause extends langium.AstNode {
|
|
489
|
+
readonly $container: ExpectStmt;
|
|
490
|
+
readonly $type: 'MatcherClause';
|
|
491
|
+
args: Array<Expr>;
|
|
492
|
+
name: string;
|
|
493
|
+
opts?: MapLit;
|
|
494
|
+
}
|
|
495
|
+
declare const MatcherClause: {
|
|
496
|
+
readonly $type: 'MatcherClause';
|
|
497
|
+
readonly args: 'args';
|
|
498
|
+
readonly name: 'name';
|
|
499
|
+
readonly opts: 'opts';
|
|
500
|
+
};
|
|
501
|
+
declare function isMatcherClause(item: unknown): item is MatcherClause;
|
|
502
|
+
interface MatrixDecl extends Declaration {
|
|
503
|
+
readonly $type: 'MatrixDecl';
|
|
504
|
+
body: MapLit;
|
|
505
|
+
}
|
|
506
|
+
declare const MatrixDecl: {
|
|
507
|
+
readonly $type: 'MatrixDecl';
|
|
508
|
+
readonly annotations: 'annotations';
|
|
509
|
+
readonly body: 'body';
|
|
510
|
+
};
|
|
511
|
+
declare function isMatrixDecl(item: unknown): item is MatrixDecl;
|
|
512
|
+
interface Member extends langium.AstNode {
|
|
513
|
+
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;
|
|
514
|
+
readonly $type: 'Member';
|
|
515
|
+
member: Word | string;
|
|
516
|
+
optional: boolean;
|
|
517
|
+
receiver: Expr;
|
|
518
|
+
}
|
|
519
|
+
declare const Member: {
|
|
520
|
+
readonly $type: 'Member';
|
|
521
|
+
readonly member: 'member';
|
|
522
|
+
readonly optional: 'optional';
|
|
523
|
+
readonly receiver: 'receiver';
|
|
524
|
+
};
|
|
525
|
+
declare function isMember(item: unknown): item is Member;
|
|
526
|
+
interface NamedType extends langium.AstNode {
|
|
527
|
+
readonly $container: TypeRef;
|
|
528
|
+
readonly $type: 'NamedType';
|
|
529
|
+
args: Array<TypeRef>;
|
|
530
|
+
name: QualifiedName;
|
|
531
|
+
}
|
|
532
|
+
declare const NamedType: {
|
|
533
|
+
readonly $type: 'NamedType';
|
|
534
|
+
readonly args: 'args';
|
|
535
|
+
readonly name: 'name';
|
|
536
|
+
};
|
|
537
|
+
declare function isNamedType(item: unknown): item is NamedType;
|
|
538
|
+
interface NullLit extends langium.AstNode {
|
|
539
|
+
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;
|
|
540
|
+
readonly $type: 'NullLit';
|
|
541
|
+
}
|
|
542
|
+
declare const NullLit: {
|
|
543
|
+
readonly $type: 'NullLit';
|
|
544
|
+
};
|
|
545
|
+
declare function isNullLit(item: unknown): item is NullLit;
|
|
546
|
+
interface NumberLit extends langium.AstNode {
|
|
547
|
+
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;
|
|
548
|
+
readonly $type: 'NumberLit';
|
|
549
|
+
raw: string;
|
|
550
|
+
}
|
|
551
|
+
declare const NumberLit: {
|
|
552
|
+
readonly $type: 'NumberLit';
|
|
553
|
+
readonly raw: 'raw';
|
|
554
|
+
};
|
|
555
|
+
declare function isNumberLit(item: unknown): item is NumberLit;
|
|
556
|
+
interface ParallelStmt extends Declaration, Statement {
|
|
557
|
+
readonly $type: 'ParallelStmt';
|
|
558
|
+
body: Block;
|
|
559
|
+
opts?: MapLit;
|
|
560
|
+
}
|
|
561
|
+
declare const ParallelStmt: {
|
|
562
|
+
readonly $type: 'ParallelStmt';
|
|
563
|
+
readonly annotations: 'annotations';
|
|
564
|
+
readonly body: 'body';
|
|
565
|
+
readonly opts: 'opts';
|
|
566
|
+
};
|
|
567
|
+
declare function isParallelStmt(item: unknown): item is ParallelStmt;
|
|
568
|
+
interface Param extends langium.AstNode {
|
|
569
|
+
readonly $container: ParamList;
|
|
570
|
+
readonly $type: 'Param';
|
|
571
|
+
annotations: Array<Annotation>;
|
|
572
|
+
name: string;
|
|
573
|
+
paramType?: TypeRef;
|
|
574
|
+
}
|
|
575
|
+
declare const Param: {
|
|
576
|
+
readonly $type: 'Param';
|
|
577
|
+
readonly annotations: 'annotations';
|
|
578
|
+
readonly name: 'name';
|
|
579
|
+
readonly paramType: 'paramType';
|
|
580
|
+
};
|
|
581
|
+
declare function isParam(item: unknown): item is Param;
|
|
582
|
+
interface ParamList extends langium.AstNode {
|
|
583
|
+
readonly $container: DecoDecl | FnDecl | FnExpr | FragmentDecl;
|
|
584
|
+
readonly $type: 'ParamList';
|
|
585
|
+
params: Array<Param>;
|
|
586
|
+
}
|
|
587
|
+
declare const ParamList: {
|
|
588
|
+
readonly $type: 'ParamList';
|
|
589
|
+
readonly params: 'params';
|
|
590
|
+
};
|
|
591
|
+
declare function isParamList(item: unknown): item is ParamList;
|
|
592
|
+
type QualifiedName = string;
|
|
593
|
+
declare function isQualifiedName(item: unknown): item is QualifiedName;
|
|
594
|
+
interface RaceStmt extends Declaration, Statement {
|
|
595
|
+
readonly $type: 'RaceStmt';
|
|
596
|
+
body: Block;
|
|
597
|
+
opts?: MapLit;
|
|
598
|
+
}
|
|
599
|
+
declare const RaceStmt: {
|
|
600
|
+
readonly $type: 'RaceStmt';
|
|
601
|
+
readonly annotations: 'annotations';
|
|
602
|
+
readonly body: 'body';
|
|
603
|
+
readonly opts: 'opts';
|
|
604
|
+
};
|
|
605
|
+
declare function isRaceStmt(item: unknown): item is RaceStmt;
|
|
606
|
+
interface Ref extends langium.AstNode {
|
|
607
|
+
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;
|
|
608
|
+
readonly $type: 'Ref';
|
|
609
|
+
name: RefName;
|
|
610
|
+
}
|
|
611
|
+
declare const Ref: {
|
|
612
|
+
readonly $type: 'Ref';
|
|
613
|
+
readonly name: 'name';
|
|
614
|
+
};
|
|
615
|
+
declare function isRef(item: unknown): item is Ref;
|
|
616
|
+
type RefName = 'flow' | 'matrix' | 'step' | string;
|
|
617
|
+
declare function isRefName(item: unknown): item is RefName;
|
|
618
|
+
interface RepeatStmt extends Declaration, Statement {
|
|
619
|
+
readonly $type: 'RepeatStmt';
|
|
620
|
+
body: Block;
|
|
621
|
+
count: Expr;
|
|
622
|
+
index?: string;
|
|
623
|
+
}
|
|
624
|
+
declare const RepeatStmt: {
|
|
625
|
+
readonly $type: 'RepeatStmt';
|
|
626
|
+
readonly annotations: 'annotations';
|
|
627
|
+
readonly body: 'body';
|
|
628
|
+
readonly count: 'count';
|
|
629
|
+
readonly index: 'index';
|
|
630
|
+
};
|
|
631
|
+
declare function isRepeatStmt(item: unknown): item is RepeatStmt;
|
|
632
|
+
interface ReportDecl extends Declaration {
|
|
633
|
+
readonly $type: 'ReportDecl';
|
|
634
|
+
reporters: Array<Expr>;
|
|
635
|
+
}
|
|
636
|
+
declare const ReportDecl: {
|
|
637
|
+
readonly $type: 'ReportDecl';
|
|
638
|
+
readonly annotations: 'annotations';
|
|
639
|
+
readonly reporters: 'reporters';
|
|
640
|
+
};
|
|
641
|
+
declare function isReportDecl(item: unknown): item is ReportDecl;
|
|
642
|
+
interface ReturnStmt extends Statement {
|
|
643
|
+
readonly $type: 'ReturnStmt';
|
|
644
|
+
value?: Expr;
|
|
645
|
+
}
|
|
646
|
+
declare const ReturnStmt: {
|
|
647
|
+
readonly $type: 'ReturnStmt';
|
|
648
|
+
readonly annotations: 'annotations';
|
|
649
|
+
readonly value: 'value';
|
|
650
|
+
};
|
|
651
|
+
declare function isReturnStmt(item: unknown): item is ReturnStmt;
|
|
652
|
+
interface RunStmt extends Declaration, Statement {
|
|
653
|
+
readonly $type: 'RunStmt';
|
|
654
|
+
args?: ArgList;
|
|
655
|
+
bind?: string;
|
|
656
|
+
target: QualifiedName;
|
|
657
|
+
}
|
|
658
|
+
declare const RunStmt: {
|
|
659
|
+
readonly $type: 'RunStmt';
|
|
660
|
+
readonly annotations: 'annotations';
|
|
661
|
+
readonly args: 'args';
|
|
662
|
+
readonly bind: 'bind';
|
|
663
|
+
readonly target: 'target';
|
|
664
|
+
};
|
|
665
|
+
declare function isRunStmt(item: unknown): item is RunStmt;
|
|
666
|
+
type SingleType = LiteralType$1 | NamedType;
|
|
667
|
+
declare const SingleType: {
|
|
668
|
+
readonly $type: 'SingleType';
|
|
669
|
+
};
|
|
670
|
+
declare function isSingleType(item: unknown): item is SingleType;
|
|
671
|
+
interface Statement extends langium.AstNode {
|
|
672
|
+
readonly $type: 'ActionCall' | 'BreakStmt' | 'CaptureStmt' | 'ContinueStmt' | 'ExpectStmt' | 'ForEachStmt' | 'GroupDecl' | 'IfStmt' | 'LetStmt' | 'LifecycleDecl' | 'ParallelStmt' | 'RaceStmt' | 'RepeatStmt' | 'ReturnStmt' | 'RunStmt' | 'Statement' | 'StepDecl' | 'TryStmt' | 'WhileStmt';
|
|
673
|
+
annotations: Array<Annotation>;
|
|
674
|
+
}
|
|
675
|
+
declare const Statement: {
|
|
676
|
+
readonly $type: 'Statement';
|
|
677
|
+
readonly annotations: 'annotations';
|
|
678
|
+
};
|
|
679
|
+
declare function isStatement(item: unknown): item is Statement;
|
|
680
|
+
interface StepDecl extends Statement {
|
|
681
|
+
readonly $type: 'StepDecl';
|
|
682
|
+
body: Block;
|
|
683
|
+
title: string;
|
|
684
|
+
}
|
|
685
|
+
declare const StepDecl: {
|
|
686
|
+
readonly $type: 'StepDecl';
|
|
687
|
+
readonly annotations: 'annotations';
|
|
688
|
+
readonly body: 'body';
|
|
689
|
+
readonly title: 'title';
|
|
690
|
+
};
|
|
691
|
+
declare function isStepDecl(item: unknown): item is StepDecl;
|
|
692
|
+
interface StringLit extends langium.AstNode {
|
|
693
|
+
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;
|
|
694
|
+
readonly $type: 'StringLit';
|
|
695
|
+
value: string;
|
|
696
|
+
}
|
|
697
|
+
declare const StringLit: {
|
|
698
|
+
readonly $type: 'StringLit';
|
|
699
|
+
readonly value: 'value';
|
|
700
|
+
};
|
|
701
|
+
declare function isStringLit(item: unknown): item is StringLit;
|
|
702
|
+
interface Ternary extends langium.AstNode {
|
|
703
|
+
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;
|
|
704
|
+
readonly $type: 'Ternary';
|
|
705
|
+
condition: Expr;
|
|
706
|
+
otherwise: Expr;
|
|
707
|
+
then: Expr;
|
|
708
|
+
}
|
|
709
|
+
declare const Ternary: {
|
|
710
|
+
readonly $type: 'Ternary';
|
|
711
|
+
readonly condition: 'condition';
|
|
712
|
+
readonly otherwise: 'otherwise';
|
|
713
|
+
readonly then: 'then';
|
|
714
|
+
};
|
|
715
|
+
declare function isTernary(item: unknown): item is Ternary;
|
|
716
|
+
interface TryStmt extends Declaration, Statement {
|
|
717
|
+
readonly $type: 'TryStmt';
|
|
718
|
+
body: Block;
|
|
719
|
+
error?: string;
|
|
720
|
+
finalizer?: Block;
|
|
721
|
+
handler?: Block;
|
|
722
|
+
}
|
|
723
|
+
declare const TryStmt: {
|
|
724
|
+
readonly $type: 'TryStmt';
|
|
725
|
+
readonly annotations: 'annotations';
|
|
726
|
+
readonly body: 'body';
|
|
727
|
+
readonly error: 'error';
|
|
728
|
+
readonly finalizer: 'finalizer';
|
|
729
|
+
readonly handler: 'handler';
|
|
730
|
+
};
|
|
731
|
+
declare function isTryStmt(item: unknown): item is TryStmt;
|
|
732
|
+
interface TypeBody extends langium.AstNode {
|
|
733
|
+
readonly $container: TypeDecl;
|
|
734
|
+
readonly $type: 'TypeBody';
|
|
735
|
+
fields: Array<FieldDecl>;
|
|
736
|
+
}
|
|
737
|
+
declare const TypeBody: {
|
|
738
|
+
readonly $type: 'TypeBody';
|
|
739
|
+
readonly fields: 'fields';
|
|
740
|
+
};
|
|
741
|
+
declare function isTypeBody(item: unknown): item is TypeBody;
|
|
742
|
+
interface TypeDecl extends Declaration {
|
|
743
|
+
readonly $type: 'TypeDecl';
|
|
744
|
+
alias?: TypeRef;
|
|
745
|
+
body?: TypeBody;
|
|
746
|
+
name: string;
|
|
747
|
+
}
|
|
748
|
+
declare const TypeDecl: {
|
|
749
|
+
readonly $type: 'TypeDecl';
|
|
750
|
+
readonly alias: 'alias';
|
|
751
|
+
readonly annotations: 'annotations';
|
|
752
|
+
readonly body: 'body';
|
|
753
|
+
readonly name: 'name';
|
|
754
|
+
};
|
|
755
|
+
declare function isTypeDecl(item: unknown): item is TypeDecl;
|
|
756
|
+
interface TypeRef extends langium.AstNode {
|
|
757
|
+
readonly $container: DatasetDecl | FieldDecl | FnDecl | FnExpr | FragmentDecl | LetStmt | NamedType | Param | TypeDecl;
|
|
758
|
+
readonly $type: 'TypeRef';
|
|
759
|
+
members: Array<SingleType>;
|
|
760
|
+
}
|
|
761
|
+
declare const TypeRef: {
|
|
762
|
+
readonly $type: 'TypeRef';
|
|
763
|
+
readonly members: 'members';
|
|
764
|
+
};
|
|
765
|
+
declare function isTypeRef(item: unknown): item is TypeRef;
|
|
766
|
+
interface Unary extends langium.AstNode {
|
|
767
|
+
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;
|
|
768
|
+
readonly $type: 'Unary';
|
|
769
|
+
operand: Expr;
|
|
770
|
+
operator: '!' | '-';
|
|
771
|
+
}
|
|
772
|
+
declare const Unary: {
|
|
773
|
+
readonly $type: 'Unary';
|
|
774
|
+
readonly operand: 'operand';
|
|
775
|
+
readonly operator: 'operator';
|
|
776
|
+
};
|
|
777
|
+
declare function isUnary(item: unknown): item is Unary;
|
|
778
|
+
interface UseDecl extends langium.AstNode {
|
|
779
|
+
readonly $container: Document;
|
|
780
|
+
readonly $type: 'UseDecl';
|
|
781
|
+
alias?: string;
|
|
782
|
+
pkg: string;
|
|
783
|
+
}
|
|
784
|
+
declare const UseDecl: {
|
|
785
|
+
readonly $type: 'UseDecl';
|
|
786
|
+
readonly alias: 'alias';
|
|
787
|
+
readonly pkg: 'pkg';
|
|
788
|
+
};
|
|
789
|
+
declare function isUseDecl(item: unknown): item is UseDecl;
|
|
790
|
+
interface ValueImport extends langium.AstNode {
|
|
791
|
+
readonly $container: Document;
|
|
792
|
+
readonly $type: 'ValueImport';
|
|
793
|
+
default?: string;
|
|
794
|
+
export: boolean;
|
|
795
|
+
names: Array<string>;
|
|
796
|
+
path: string;
|
|
797
|
+
wildcard?: string;
|
|
798
|
+
}
|
|
799
|
+
declare const ValueImport: {
|
|
800
|
+
readonly $type: 'ValueImport';
|
|
801
|
+
readonly default: 'default';
|
|
802
|
+
readonly export: 'export';
|
|
803
|
+
readonly names: 'names';
|
|
804
|
+
readonly path: 'path';
|
|
805
|
+
readonly wildcard: 'wildcard';
|
|
806
|
+
};
|
|
807
|
+
declare function isValueImport(item: unknown): item is ValueImport;
|
|
808
|
+
interface WhileStmt extends Declaration, Statement {
|
|
809
|
+
readonly $type: 'WhileStmt';
|
|
810
|
+
body: Block;
|
|
811
|
+
cond: Expr;
|
|
812
|
+
}
|
|
813
|
+
declare const WhileStmt: {
|
|
814
|
+
readonly $type: 'WhileStmt';
|
|
815
|
+
readonly annotations: 'annotations';
|
|
816
|
+
readonly body: 'body';
|
|
817
|
+
readonly cond: 'cond';
|
|
818
|
+
};
|
|
819
|
+
declare function isWhileStmt(item: unknown): item is WhileStmt;
|
|
820
|
+
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;
|
|
821
|
+
declare function isWord(item: unknown): item is Word;
|
|
822
|
+
type VennAstType = {
|
|
823
|
+
ActionCall: ActionCall;
|
|
824
|
+
Annotation: Annotation;
|
|
825
|
+
Arg: Arg;
|
|
826
|
+
ArgList: ArgList;
|
|
827
|
+
Binary: Binary;
|
|
828
|
+
Block: Block;
|
|
829
|
+
BoolLit: BoolLit;
|
|
830
|
+
BreakStmt: BreakStmt;
|
|
831
|
+
Call: Call;
|
|
832
|
+
CaptureStmt: CaptureStmt;
|
|
833
|
+
ConfigDecl: ConfigDecl;
|
|
834
|
+
ContinueStmt: ContinueStmt;
|
|
835
|
+
DatasetDecl: DatasetDecl;
|
|
836
|
+
Declaration: Declaration;
|
|
837
|
+
DecoDecl: DecoDecl;
|
|
838
|
+
Document: Document;
|
|
839
|
+
ElseBranch: ElseBranch;
|
|
840
|
+
ExpectStmt: ExpectStmt;
|
|
841
|
+
Expr: Expr;
|
|
842
|
+
FactoryDecl: FactoryDecl;
|
|
843
|
+
FieldDecl: FieldDecl;
|
|
844
|
+
FlowDecl: FlowDecl;
|
|
845
|
+
FnBody: FnBody;
|
|
846
|
+
FnDecl: FnDecl;
|
|
847
|
+
FnExpr: FnExpr;
|
|
848
|
+
ForEachStmt: ForEachStmt;
|
|
849
|
+
FragmentDecl: FragmentDecl;
|
|
850
|
+
GroupDecl: GroupDecl;
|
|
851
|
+
IfStmt: IfStmt;
|
|
852
|
+
ImportDecl: ImportDecl;
|
|
853
|
+
Index: Index;
|
|
854
|
+
InstantLit: InstantLit;
|
|
855
|
+
LetStmt: LetStmt;
|
|
856
|
+
LifecycleDecl: LifecycleDecl;
|
|
857
|
+
ListLit: ListLit;
|
|
858
|
+
LiteralType: LiteralType$1;
|
|
859
|
+
MapEntry: MapEntry;
|
|
860
|
+
MapLit: MapLit;
|
|
861
|
+
MatcherClause: MatcherClause;
|
|
862
|
+
MatrixDecl: MatrixDecl;
|
|
863
|
+
Member: Member;
|
|
864
|
+
NamedType: NamedType;
|
|
865
|
+
NullLit: NullLit;
|
|
866
|
+
NumberLit: NumberLit;
|
|
867
|
+
ParallelStmt: ParallelStmt;
|
|
868
|
+
Param: Param;
|
|
869
|
+
ParamList: ParamList;
|
|
870
|
+
RaceStmt: RaceStmt;
|
|
871
|
+
Ref: Ref;
|
|
872
|
+
RepeatStmt: RepeatStmt;
|
|
873
|
+
ReportDecl: ReportDecl;
|
|
874
|
+
ReturnStmt: ReturnStmt;
|
|
875
|
+
RunStmt: RunStmt;
|
|
876
|
+
SingleType: SingleType;
|
|
877
|
+
Statement: Statement;
|
|
878
|
+
StepDecl: StepDecl;
|
|
879
|
+
StringLit: StringLit;
|
|
880
|
+
Ternary: Ternary;
|
|
881
|
+
TryStmt: TryStmt;
|
|
882
|
+
TypeBody: TypeBody;
|
|
883
|
+
TypeDecl: TypeDecl;
|
|
884
|
+
TypeRef: TypeRef;
|
|
885
|
+
Unary: Unary;
|
|
886
|
+
UseDecl: UseDecl;
|
|
887
|
+
ValueImport: ValueImport;
|
|
888
|
+
WhileStmt: WhileStmt;
|
|
889
|
+
};
|
|
890
|
+
declare class VennAstReflection extends langium.AbstractAstReflection {
|
|
891
|
+
readonly types: {
|
|
892
|
+
readonly ActionCall: {
|
|
893
|
+
readonly name: "ActionCall";
|
|
894
|
+
readonly properties: {
|
|
895
|
+
readonly annotations: {
|
|
896
|
+
readonly name: "annotations";
|
|
897
|
+
readonly defaultValue: [];
|
|
898
|
+
readonly optional: true;
|
|
899
|
+
};
|
|
900
|
+
readonly args: {
|
|
901
|
+
readonly name: "args";
|
|
902
|
+
readonly defaultValue: [];
|
|
903
|
+
readonly optional: true;
|
|
904
|
+
};
|
|
905
|
+
readonly call: {
|
|
906
|
+
readonly name: "call";
|
|
907
|
+
readonly optional: true;
|
|
908
|
+
};
|
|
909
|
+
readonly called: {
|
|
910
|
+
readonly name: "called";
|
|
911
|
+
readonly defaultValue: false;
|
|
912
|
+
readonly optional: true;
|
|
913
|
+
};
|
|
914
|
+
readonly opts: {
|
|
915
|
+
readonly name: "opts";
|
|
916
|
+
readonly optional: true;
|
|
917
|
+
};
|
|
918
|
+
readonly target: {
|
|
919
|
+
readonly name: "target";
|
|
920
|
+
};
|
|
921
|
+
};
|
|
922
|
+
readonly superTypes: ["Declaration", "Statement"];
|
|
923
|
+
};
|
|
924
|
+
readonly Annotation: {
|
|
925
|
+
readonly name: "Annotation";
|
|
926
|
+
readonly properties: {
|
|
927
|
+
readonly args: {
|
|
928
|
+
readonly name: "args";
|
|
929
|
+
readonly optional: true;
|
|
930
|
+
};
|
|
931
|
+
readonly name: {
|
|
932
|
+
readonly name: "name";
|
|
933
|
+
};
|
|
934
|
+
};
|
|
935
|
+
readonly superTypes: [];
|
|
936
|
+
};
|
|
937
|
+
readonly Arg: {
|
|
938
|
+
readonly name: "Arg";
|
|
939
|
+
readonly properties: {
|
|
940
|
+
readonly name: {
|
|
941
|
+
readonly name: "name";
|
|
942
|
+
readonly optional: true;
|
|
943
|
+
};
|
|
944
|
+
readonly value: {
|
|
945
|
+
readonly name: "value";
|
|
946
|
+
};
|
|
947
|
+
};
|
|
948
|
+
readonly superTypes: [];
|
|
949
|
+
};
|
|
950
|
+
readonly ArgList: {
|
|
951
|
+
readonly name: "ArgList";
|
|
952
|
+
readonly properties: {
|
|
953
|
+
readonly args: {
|
|
954
|
+
readonly name: "args";
|
|
955
|
+
readonly defaultValue: [];
|
|
956
|
+
};
|
|
957
|
+
};
|
|
958
|
+
readonly superTypes: [];
|
|
959
|
+
};
|
|
960
|
+
readonly Binary: {
|
|
961
|
+
readonly name: "Binary";
|
|
962
|
+
readonly properties: {
|
|
963
|
+
readonly left: {
|
|
964
|
+
readonly name: "left";
|
|
965
|
+
};
|
|
966
|
+
readonly operator: {
|
|
967
|
+
readonly name: "operator";
|
|
968
|
+
};
|
|
969
|
+
readonly right: {
|
|
970
|
+
readonly name: "right";
|
|
971
|
+
};
|
|
972
|
+
};
|
|
973
|
+
readonly superTypes: ["Expr"];
|
|
974
|
+
};
|
|
975
|
+
readonly Block: {
|
|
976
|
+
readonly name: "Block";
|
|
977
|
+
readonly properties: {
|
|
978
|
+
readonly stmts: {
|
|
979
|
+
readonly name: "stmts";
|
|
980
|
+
readonly defaultValue: [];
|
|
981
|
+
readonly optional: true;
|
|
982
|
+
};
|
|
983
|
+
};
|
|
984
|
+
readonly superTypes: ["ElseBranch"];
|
|
985
|
+
};
|
|
986
|
+
readonly BoolLit: {
|
|
987
|
+
readonly name: "BoolLit";
|
|
988
|
+
readonly properties: {
|
|
989
|
+
readonly value: {
|
|
990
|
+
readonly name: "value";
|
|
991
|
+
};
|
|
992
|
+
};
|
|
993
|
+
readonly superTypes: ["Expr"];
|
|
994
|
+
};
|
|
995
|
+
readonly BreakStmt: {
|
|
996
|
+
readonly name: "BreakStmt";
|
|
997
|
+
readonly properties: {
|
|
998
|
+
readonly annotations: {
|
|
999
|
+
readonly name: "annotations";
|
|
1000
|
+
readonly defaultValue: [];
|
|
1001
|
+
readonly optional: true;
|
|
1002
|
+
};
|
|
1003
|
+
};
|
|
1004
|
+
readonly superTypes: ["Statement"];
|
|
1005
|
+
};
|
|
1006
|
+
readonly Call: {
|
|
1007
|
+
readonly name: "Call";
|
|
1008
|
+
readonly properties: {
|
|
1009
|
+
readonly args: {
|
|
1010
|
+
readonly name: "args";
|
|
1011
|
+
readonly optional: true;
|
|
1012
|
+
};
|
|
1013
|
+
readonly callee: {
|
|
1014
|
+
readonly name: "callee";
|
|
1015
|
+
};
|
|
1016
|
+
};
|
|
1017
|
+
readonly superTypes: ["Expr"];
|
|
1018
|
+
};
|
|
1019
|
+
readonly CaptureStmt: {
|
|
1020
|
+
readonly name: "CaptureStmt";
|
|
1021
|
+
readonly properties: {
|
|
1022
|
+
readonly annotations: {
|
|
1023
|
+
readonly name: "annotations";
|
|
1024
|
+
readonly defaultValue: [];
|
|
1025
|
+
readonly optional: true;
|
|
1026
|
+
};
|
|
1027
|
+
readonly name: {
|
|
1028
|
+
readonly name: "name";
|
|
1029
|
+
};
|
|
1030
|
+
readonly opts: {
|
|
1031
|
+
readonly name: "opts";
|
|
1032
|
+
readonly optional: true;
|
|
1033
|
+
};
|
|
1034
|
+
readonly value: {
|
|
1035
|
+
readonly name: "value";
|
|
1036
|
+
};
|
|
1037
|
+
};
|
|
1038
|
+
readonly superTypes: ["Statement"];
|
|
1039
|
+
};
|
|
1040
|
+
readonly ConfigDecl: {
|
|
1041
|
+
readonly name: "ConfigDecl";
|
|
1042
|
+
readonly properties: {
|
|
1043
|
+
readonly annotations: {
|
|
1044
|
+
readonly name: "annotations";
|
|
1045
|
+
readonly defaultValue: [];
|
|
1046
|
+
readonly optional: true;
|
|
1047
|
+
};
|
|
1048
|
+
readonly body: {
|
|
1049
|
+
readonly name: "body";
|
|
1050
|
+
};
|
|
1051
|
+
};
|
|
1052
|
+
readonly superTypes: ["Declaration"];
|
|
1053
|
+
};
|
|
1054
|
+
readonly ContinueStmt: {
|
|
1055
|
+
readonly name: "ContinueStmt";
|
|
1056
|
+
readonly properties: {
|
|
1057
|
+
readonly annotations: {
|
|
1058
|
+
readonly name: "annotations";
|
|
1059
|
+
readonly defaultValue: [];
|
|
1060
|
+
readonly optional: true;
|
|
1061
|
+
};
|
|
1062
|
+
};
|
|
1063
|
+
readonly superTypes: ["Statement"];
|
|
1064
|
+
};
|
|
1065
|
+
readonly DatasetDecl: {
|
|
1066
|
+
readonly name: "DatasetDecl";
|
|
1067
|
+
readonly properties: {
|
|
1068
|
+
readonly annotations: {
|
|
1069
|
+
readonly name: "annotations";
|
|
1070
|
+
readonly defaultValue: [];
|
|
1071
|
+
readonly optional: true;
|
|
1072
|
+
};
|
|
1073
|
+
readonly declaredType: {
|
|
1074
|
+
readonly name: "declaredType";
|
|
1075
|
+
readonly optional: true;
|
|
1076
|
+
};
|
|
1077
|
+
readonly name: {
|
|
1078
|
+
readonly name: "name";
|
|
1079
|
+
};
|
|
1080
|
+
readonly value: {
|
|
1081
|
+
readonly name: "value";
|
|
1082
|
+
};
|
|
1083
|
+
};
|
|
1084
|
+
readonly superTypes: ["Declaration"];
|
|
1085
|
+
};
|
|
1086
|
+
readonly Declaration: {
|
|
1087
|
+
readonly name: "Declaration";
|
|
1088
|
+
readonly properties: {
|
|
1089
|
+
readonly annotations: {
|
|
1090
|
+
readonly name: "annotations";
|
|
1091
|
+
readonly defaultValue: [];
|
|
1092
|
+
readonly optional: true;
|
|
1093
|
+
};
|
|
1094
|
+
};
|
|
1095
|
+
readonly superTypes: [];
|
|
1096
|
+
};
|
|
1097
|
+
readonly DecoDecl: {
|
|
1098
|
+
readonly name: "DecoDecl";
|
|
1099
|
+
readonly properties: {
|
|
1100
|
+
readonly annotations: {
|
|
1101
|
+
readonly name: "annotations";
|
|
1102
|
+
readonly defaultValue: [];
|
|
1103
|
+
readonly optional: true;
|
|
1104
|
+
};
|
|
1105
|
+
readonly body: {
|
|
1106
|
+
readonly name: "body";
|
|
1107
|
+
};
|
|
1108
|
+
readonly export: {
|
|
1109
|
+
readonly name: "export";
|
|
1110
|
+
readonly defaultValue: false;
|
|
1111
|
+
readonly optional: true;
|
|
1112
|
+
};
|
|
1113
|
+
readonly name: {
|
|
1114
|
+
readonly name: "name";
|
|
1115
|
+
};
|
|
1116
|
+
readonly params: {
|
|
1117
|
+
readonly name: "params";
|
|
1118
|
+
readonly optional: true;
|
|
1119
|
+
};
|
|
1120
|
+
};
|
|
1121
|
+
readonly superTypes: ["Declaration"];
|
|
1122
|
+
};
|
|
1123
|
+
readonly Document: {
|
|
1124
|
+
readonly name: "Document";
|
|
1125
|
+
readonly properties: {
|
|
1126
|
+
readonly decls: {
|
|
1127
|
+
readonly name: "decls";
|
|
1128
|
+
readonly defaultValue: [];
|
|
1129
|
+
readonly optional: true;
|
|
1130
|
+
};
|
|
1131
|
+
readonly imports: {
|
|
1132
|
+
readonly name: "imports";
|
|
1133
|
+
readonly defaultValue: [];
|
|
1134
|
+
readonly optional: true;
|
|
1135
|
+
};
|
|
1136
|
+
readonly name: {
|
|
1137
|
+
readonly name: "name";
|
|
1138
|
+
readonly optional: true;
|
|
1139
|
+
};
|
|
1140
|
+
};
|
|
1141
|
+
readonly superTypes: [];
|
|
1142
|
+
};
|
|
1143
|
+
readonly ElseBranch: {
|
|
1144
|
+
readonly name: "ElseBranch";
|
|
1145
|
+
readonly properties: {};
|
|
1146
|
+
readonly superTypes: [];
|
|
1147
|
+
};
|
|
1148
|
+
readonly ExpectStmt: {
|
|
1149
|
+
readonly name: "ExpectStmt";
|
|
1150
|
+
readonly properties: {
|
|
1151
|
+
readonly annotations: {
|
|
1152
|
+
readonly name: "annotations";
|
|
1153
|
+
readonly defaultValue: [];
|
|
1154
|
+
readonly optional: true;
|
|
1155
|
+
};
|
|
1156
|
+
readonly checks: {
|
|
1157
|
+
readonly name: "checks";
|
|
1158
|
+
readonly defaultValue: [];
|
|
1159
|
+
readonly optional: true;
|
|
1160
|
+
};
|
|
1161
|
+
readonly matcher: {
|
|
1162
|
+
readonly name: "matcher";
|
|
1163
|
+
readonly optional: true;
|
|
1164
|
+
};
|
|
1165
|
+
readonly modifier: {
|
|
1166
|
+
readonly name: "modifier";
|
|
1167
|
+
readonly optional: true;
|
|
1168
|
+
};
|
|
1169
|
+
readonly negate: {
|
|
1170
|
+
readonly name: "negate";
|
|
1171
|
+
readonly defaultValue: false;
|
|
1172
|
+
readonly optional: true;
|
|
1173
|
+
};
|
|
1174
|
+
readonly subject: {
|
|
1175
|
+
readonly name: "subject";
|
|
1176
|
+
readonly optional: true;
|
|
1177
|
+
};
|
|
1178
|
+
};
|
|
1179
|
+
readonly superTypes: ["Declaration", "Statement"];
|
|
1180
|
+
};
|
|
1181
|
+
readonly Expr: {
|
|
1182
|
+
readonly name: "Expr";
|
|
1183
|
+
readonly properties: {};
|
|
1184
|
+
readonly superTypes: [];
|
|
1185
|
+
};
|
|
1186
|
+
readonly FactoryDecl: {
|
|
1187
|
+
readonly name: "FactoryDecl";
|
|
1188
|
+
readonly properties: {
|
|
1189
|
+
readonly annotations: {
|
|
1190
|
+
readonly name: "annotations";
|
|
1191
|
+
readonly defaultValue: [];
|
|
1192
|
+
readonly optional: true;
|
|
1193
|
+
};
|
|
1194
|
+
readonly body: {
|
|
1195
|
+
readonly name: "body";
|
|
1196
|
+
};
|
|
1197
|
+
readonly name: {
|
|
1198
|
+
readonly name: "name";
|
|
1199
|
+
};
|
|
1200
|
+
};
|
|
1201
|
+
readonly superTypes: ["Declaration"];
|
|
1202
|
+
};
|
|
1203
|
+
readonly FieldDecl: {
|
|
1204
|
+
readonly name: "FieldDecl";
|
|
1205
|
+
readonly properties: {
|
|
1206
|
+
readonly annotations: {
|
|
1207
|
+
readonly name: "annotations";
|
|
1208
|
+
readonly defaultValue: [];
|
|
1209
|
+
readonly optional: true;
|
|
1210
|
+
};
|
|
1211
|
+
readonly fieldType: {
|
|
1212
|
+
readonly name: "fieldType";
|
|
1213
|
+
};
|
|
1214
|
+
readonly name: {
|
|
1215
|
+
readonly name: "name";
|
|
1216
|
+
};
|
|
1217
|
+
readonly optional: {
|
|
1218
|
+
readonly name: "optional";
|
|
1219
|
+
readonly defaultValue: false;
|
|
1220
|
+
readonly optional: true;
|
|
1221
|
+
};
|
|
1222
|
+
};
|
|
1223
|
+
readonly superTypes: [];
|
|
1224
|
+
};
|
|
1225
|
+
readonly FlowDecl: {
|
|
1226
|
+
readonly name: "FlowDecl";
|
|
1227
|
+
readonly properties: {
|
|
1228
|
+
readonly annotations: {
|
|
1229
|
+
readonly name: "annotations";
|
|
1230
|
+
readonly defaultValue: [];
|
|
1231
|
+
readonly optional: true;
|
|
1232
|
+
};
|
|
1233
|
+
readonly body: {
|
|
1234
|
+
readonly name: "body";
|
|
1235
|
+
};
|
|
1236
|
+
readonly title: {
|
|
1237
|
+
readonly name: "title";
|
|
1238
|
+
};
|
|
1239
|
+
};
|
|
1240
|
+
readonly superTypes: ["Declaration"];
|
|
1241
|
+
};
|
|
1242
|
+
readonly FnBody: {
|
|
1243
|
+
readonly name: "FnBody";
|
|
1244
|
+
readonly properties: {
|
|
1245
|
+
readonly locals: {
|
|
1246
|
+
readonly name: "locals";
|
|
1247
|
+
readonly defaultValue: [];
|
|
1248
|
+
readonly optional: true;
|
|
1249
|
+
};
|
|
1250
|
+
readonly result: {
|
|
1251
|
+
readonly name: "result";
|
|
1252
|
+
};
|
|
1253
|
+
};
|
|
1254
|
+
readonly superTypes: [];
|
|
1255
|
+
};
|
|
1256
|
+
readonly FnDecl: {
|
|
1257
|
+
readonly name: "FnDecl";
|
|
1258
|
+
readonly properties: {
|
|
1259
|
+
readonly annotations: {
|
|
1260
|
+
readonly name: "annotations";
|
|
1261
|
+
readonly defaultValue: [];
|
|
1262
|
+
readonly optional: true;
|
|
1263
|
+
};
|
|
1264
|
+
readonly body: {
|
|
1265
|
+
readonly name: "body";
|
|
1266
|
+
};
|
|
1267
|
+
readonly export: {
|
|
1268
|
+
readonly name: "export";
|
|
1269
|
+
readonly defaultValue: false;
|
|
1270
|
+
readonly optional: true;
|
|
1271
|
+
};
|
|
1272
|
+
readonly name: {
|
|
1273
|
+
readonly name: "name";
|
|
1274
|
+
};
|
|
1275
|
+
readonly params: {
|
|
1276
|
+
readonly name: "params";
|
|
1277
|
+
readonly optional: true;
|
|
1278
|
+
};
|
|
1279
|
+
readonly returns: {
|
|
1280
|
+
readonly name: "returns";
|
|
1281
|
+
readonly optional: true;
|
|
1282
|
+
};
|
|
1283
|
+
};
|
|
1284
|
+
readonly superTypes: ["Declaration"];
|
|
1285
|
+
};
|
|
1286
|
+
readonly FnExpr: {
|
|
1287
|
+
readonly name: "FnExpr";
|
|
1288
|
+
readonly properties: {
|
|
1289
|
+
readonly body: {
|
|
1290
|
+
readonly name: "body";
|
|
1291
|
+
};
|
|
1292
|
+
readonly params: {
|
|
1293
|
+
readonly name: "params";
|
|
1294
|
+
};
|
|
1295
|
+
readonly returns: {
|
|
1296
|
+
readonly name: "returns";
|
|
1297
|
+
readonly optional: true;
|
|
1298
|
+
};
|
|
1299
|
+
};
|
|
1300
|
+
readonly superTypes: ["Expr"];
|
|
1301
|
+
};
|
|
1302
|
+
readonly ForEachStmt: {
|
|
1303
|
+
readonly name: "ForEachStmt";
|
|
1304
|
+
readonly properties: {
|
|
1305
|
+
readonly annotations: {
|
|
1306
|
+
readonly name: "annotations";
|
|
1307
|
+
readonly defaultValue: [];
|
|
1308
|
+
readonly optional: true;
|
|
1309
|
+
};
|
|
1310
|
+
readonly body: {
|
|
1311
|
+
readonly name: "body";
|
|
1312
|
+
};
|
|
1313
|
+
readonly item: {
|
|
1314
|
+
readonly name: "item";
|
|
1315
|
+
};
|
|
1316
|
+
readonly opts: {
|
|
1317
|
+
readonly name: "opts";
|
|
1318
|
+
readonly optional: true;
|
|
1319
|
+
};
|
|
1320
|
+
readonly source: {
|
|
1321
|
+
readonly name: "source";
|
|
1322
|
+
};
|
|
1323
|
+
};
|
|
1324
|
+
readonly superTypes: ["Declaration", "Statement"];
|
|
1325
|
+
};
|
|
1326
|
+
readonly FragmentDecl: {
|
|
1327
|
+
readonly name: "FragmentDecl";
|
|
1328
|
+
readonly properties: {
|
|
1329
|
+
readonly annotations: {
|
|
1330
|
+
readonly name: "annotations";
|
|
1331
|
+
readonly defaultValue: [];
|
|
1332
|
+
readonly optional: true;
|
|
1333
|
+
};
|
|
1334
|
+
readonly body: {
|
|
1335
|
+
readonly name: "body";
|
|
1336
|
+
};
|
|
1337
|
+
readonly export: {
|
|
1338
|
+
readonly name: "export";
|
|
1339
|
+
readonly defaultValue: false;
|
|
1340
|
+
readonly optional: true;
|
|
1341
|
+
};
|
|
1342
|
+
readonly name: {
|
|
1343
|
+
readonly name: "name";
|
|
1344
|
+
};
|
|
1345
|
+
readonly params: {
|
|
1346
|
+
readonly name: "params";
|
|
1347
|
+
readonly optional: true;
|
|
1348
|
+
};
|
|
1349
|
+
readonly returns: {
|
|
1350
|
+
readonly name: "returns";
|
|
1351
|
+
readonly optional: true;
|
|
1352
|
+
};
|
|
1353
|
+
};
|
|
1354
|
+
readonly superTypes: ["Declaration"];
|
|
1355
|
+
};
|
|
1356
|
+
readonly GroupDecl: {
|
|
1357
|
+
readonly name: "GroupDecl";
|
|
1358
|
+
readonly properties: {
|
|
1359
|
+
readonly annotations: {
|
|
1360
|
+
readonly name: "annotations";
|
|
1361
|
+
readonly defaultValue: [];
|
|
1362
|
+
readonly optional: true;
|
|
1363
|
+
};
|
|
1364
|
+
readonly body: {
|
|
1365
|
+
readonly name: "body";
|
|
1366
|
+
};
|
|
1367
|
+
readonly title: {
|
|
1368
|
+
readonly name: "title";
|
|
1369
|
+
};
|
|
1370
|
+
};
|
|
1371
|
+
readonly superTypes: ["Statement"];
|
|
1372
|
+
};
|
|
1373
|
+
readonly IfStmt: {
|
|
1374
|
+
readonly name: "IfStmt";
|
|
1375
|
+
readonly properties: {
|
|
1376
|
+
readonly annotations: {
|
|
1377
|
+
readonly name: "annotations";
|
|
1378
|
+
readonly defaultValue: [];
|
|
1379
|
+
readonly optional: true;
|
|
1380
|
+
};
|
|
1381
|
+
readonly cond: {
|
|
1382
|
+
readonly name: "cond";
|
|
1383
|
+
};
|
|
1384
|
+
readonly otherwise: {
|
|
1385
|
+
readonly name: "otherwise";
|
|
1386
|
+
readonly optional: true;
|
|
1387
|
+
};
|
|
1388
|
+
readonly then: {
|
|
1389
|
+
readonly name: "then";
|
|
1390
|
+
};
|
|
1391
|
+
};
|
|
1392
|
+
readonly superTypes: ["Declaration", "Statement", "ElseBranch"];
|
|
1393
|
+
};
|
|
1394
|
+
readonly ImportDecl: {
|
|
1395
|
+
readonly name: "ImportDecl";
|
|
1396
|
+
readonly properties: {};
|
|
1397
|
+
readonly superTypes: [];
|
|
1398
|
+
};
|
|
1399
|
+
readonly Index: {
|
|
1400
|
+
readonly name: "Index";
|
|
1401
|
+
readonly properties: {
|
|
1402
|
+
readonly index: {
|
|
1403
|
+
readonly name: "index";
|
|
1404
|
+
};
|
|
1405
|
+
readonly receiver: {
|
|
1406
|
+
readonly name: "receiver";
|
|
1407
|
+
};
|
|
1408
|
+
};
|
|
1409
|
+
readonly superTypes: ["Expr"];
|
|
1410
|
+
};
|
|
1411
|
+
readonly InstantLit: {
|
|
1412
|
+
readonly name: "InstantLit";
|
|
1413
|
+
readonly properties: {
|
|
1414
|
+
readonly value: {
|
|
1415
|
+
readonly name: "value";
|
|
1416
|
+
};
|
|
1417
|
+
};
|
|
1418
|
+
readonly superTypes: ["Expr"];
|
|
1419
|
+
};
|
|
1420
|
+
readonly LetStmt: {
|
|
1421
|
+
readonly name: "LetStmt";
|
|
1422
|
+
readonly properties: {
|
|
1423
|
+
readonly annotations: {
|
|
1424
|
+
readonly name: "annotations";
|
|
1425
|
+
readonly defaultValue: [];
|
|
1426
|
+
readonly optional: true;
|
|
1427
|
+
};
|
|
1428
|
+
readonly args: {
|
|
1429
|
+
readonly name: "args";
|
|
1430
|
+
readonly defaultValue: [];
|
|
1431
|
+
readonly optional: true;
|
|
1432
|
+
};
|
|
1433
|
+
readonly declaredType: {
|
|
1434
|
+
readonly name: "declaredType";
|
|
1435
|
+
readonly optional: true;
|
|
1436
|
+
};
|
|
1437
|
+
readonly kind: {
|
|
1438
|
+
readonly name: "kind";
|
|
1439
|
+
};
|
|
1440
|
+
readonly name: {
|
|
1441
|
+
readonly name: "name";
|
|
1442
|
+
};
|
|
1443
|
+
readonly opts: {
|
|
1444
|
+
readonly name: "opts";
|
|
1445
|
+
readonly optional: true;
|
|
1446
|
+
};
|
|
1447
|
+
readonly value: {
|
|
1448
|
+
readonly name: "value";
|
|
1449
|
+
};
|
|
1450
|
+
};
|
|
1451
|
+
readonly superTypes: ["Declaration", "Statement"];
|
|
1452
|
+
};
|
|
1453
|
+
readonly LifecycleDecl: {
|
|
1454
|
+
readonly name: "LifecycleDecl";
|
|
1455
|
+
readonly properties: {
|
|
1456
|
+
readonly annotations: {
|
|
1457
|
+
readonly name: "annotations";
|
|
1458
|
+
readonly defaultValue: [];
|
|
1459
|
+
readonly optional: true;
|
|
1460
|
+
};
|
|
1461
|
+
readonly arg: {
|
|
1462
|
+
readonly name: "arg";
|
|
1463
|
+
readonly optional: true;
|
|
1464
|
+
};
|
|
1465
|
+
readonly body: {
|
|
1466
|
+
readonly name: "body";
|
|
1467
|
+
};
|
|
1468
|
+
readonly event: {
|
|
1469
|
+
readonly name: "event";
|
|
1470
|
+
readonly optional: true;
|
|
1471
|
+
};
|
|
1472
|
+
readonly hook: {
|
|
1473
|
+
readonly name: "hook";
|
|
1474
|
+
readonly optional: true;
|
|
1475
|
+
};
|
|
1476
|
+
};
|
|
1477
|
+
readonly superTypes: ["Declaration", "Statement"];
|
|
1478
|
+
};
|
|
1479
|
+
readonly ListLit: {
|
|
1480
|
+
readonly name: "ListLit";
|
|
1481
|
+
readonly properties: {
|
|
1482
|
+
readonly items: {
|
|
1483
|
+
readonly name: "items";
|
|
1484
|
+
readonly defaultValue: [];
|
|
1485
|
+
readonly optional: true;
|
|
1486
|
+
};
|
|
1487
|
+
};
|
|
1488
|
+
readonly superTypes: ["Expr"];
|
|
1489
|
+
};
|
|
1490
|
+
readonly LiteralType: {
|
|
1491
|
+
readonly name: "LiteralType";
|
|
1492
|
+
readonly properties: {
|
|
1493
|
+
readonly value: {
|
|
1494
|
+
readonly name: "value";
|
|
1495
|
+
};
|
|
1496
|
+
};
|
|
1497
|
+
readonly superTypes: ["SingleType"];
|
|
1498
|
+
};
|
|
1499
|
+
readonly MapEntry: {
|
|
1500
|
+
readonly name: "MapEntry";
|
|
1501
|
+
readonly properties: {
|
|
1502
|
+
readonly key: {
|
|
1503
|
+
readonly name: "key";
|
|
1504
|
+
};
|
|
1505
|
+
readonly value: {
|
|
1506
|
+
readonly name: "value";
|
|
1507
|
+
};
|
|
1508
|
+
};
|
|
1509
|
+
readonly superTypes: [];
|
|
1510
|
+
};
|
|
1511
|
+
readonly MapLit: {
|
|
1512
|
+
readonly name: "MapLit";
|
|
1513
|
+
readonly properties: {
|
|
1514
|
+
readonly entries: {
|
|
1515
|
+
readonly name: "entries";
|
|
1516
|
+
readonly defaultValue: [];
|
|
1517
|
+
readonly optional: true;
|
|
1518
|
+
};
|
|
1519
|
+
};
|
|
1520
|
+
readonly superTypes: ["Expr"];
|
|
1521
|
+
};
|
|
1522
|
+
readonly MatcherClause: {
|
|
1523
|
+
readonly name: "MatcherClause";
|
|
1524
|
+
readonly properties: {
|
|
1525
|
+
readonly args: {
|
|
1526
|
+
readonly name: "args";
|
|
1527
|
+
readonly defaultValue: [];
|
|
1528
|
+
readonly optional: true;
|
|
1529
|
+
};
|
|
1530
|
+
readonly name: {
|
|
1531
|
+
readonly name: "name";
|
|
1532
|
+
};
|
|
1533
|
+
readonly opts: {
|
|
1534
|
+
readonly name: "opts";
|
|
1535
|
+
readonly optional: true;
|
|
1536
|
+
};
|
|
1537
|
+
};
|
|
1538
|
+
readonly superTypes: [];
|
|
1539
|
+
};
|
|
1540
|
+
readonly MatrixDecl: {
|
|
1541
|
+
readonly name: "MatrixDecl";
|
|
1542
|
+
readonly properties: {
|
|
1543
|
+
readonly annotations: {
|
|
1544
|
+
readonly name: "annotations";
|
|
1545
|
+
readonly defaultValue: [];
|
|
1546
|
+
readonly optional: true;
|
|
1547
|
+
};
|
|
1548
|
+
readonly body: {
|
|
1549
|
+
readonly name: "body";
|
|
1550
|
+
};
|
|
1551
|
+
};
|
|
1552
|
+
readonly superTypes: ["Declaration"];
|
|
1553
|
+
};
|
|
1554
|
+
readonly Member: {
|
|
1555
|
+
readonly name: "Member";
|
|
1556
|
+
readonly properties: {
|
|
1557
|
+
readonly member: {
|
|
1558
|
+
readonly name: "member";
|
|
1559
|
+
};
|
|
1560
|
+
readonly optional: {
|
|
1561
|
+
readonly name: "optional";
|
|
1562
|
+
readonly defaultValue: false;
|
|
1563
|
+
readonly optional: true;
|
|
1564
|
+
};
|
|
1565
|
+
readonly receiver: {
|
|
1566
|
+
readonly name: "receiver";
|
|
1567
|
+
};
|
|
1568
|
+
};
|
|
1569
|
+
readonly superTypes: ["Expr"];
|
|
1570
|
+
};
|
|
1571
|
+
readonly NamedType: {
|
|
1572
|
+
readonly name: "NamedType";
|
|
1573
|
+
readonly properties: {
|
|
1574
|
+
readonly args: {
|
|
1575
|
+
readonly name: "args";
|
|
1576
|
+
readonly defaultValue: [];
|
|
1577
|
+
readonly optional: true;
|
|
1578
|
+
};
|
|
1579
|
+
readonly name: {
|
|
1580
|
+
readonly name: "name";
|
|
1581
|
+
};
|
|
1582
|
+
};
|
|
1583
|
+
readonly superTypes: ["SingleType"];
|
|
1584
|
+
};
|
|
1585
|
+
readonly NullLit: {
|
|
1586
|
+
readonly name: "NullLit";
|
|
1587
|
+
readonly properties: {};
|
|
1588
|
+
readonly superTypes: ["Expr"];
|
|
1589
|
+
};
|
|
1590
|
+
readonly NumberLit: {
|
|
1591
|
+
readonly name: "NumberLit";
|
|
1592
|
+
readonly properties: {
|
|
1593
|
+
readonly raw: {
|
|
1594
|
+
readonly name: "raw";
|
|
1595
|
+
};
|
|
1596
|
+
};
|
|
1597
|
+
readonly superTypes: ["Expr"];
|
|
1598
|
+
};
|
|
1599
|
+
readonly ParallelStmt: {
|
|
1600
|
+
readonly name: "ParallelStmt";
|
|
1601
|
+
readonly properties: {
|
|
1602
|
+
readonly annotations: {
|
|
1603
|
+
readonly name: "annotations";
|
|
1604
|
+
readonly defaultValue: [];
|
|
1605
|
+
readonly optional: true;
|
|
1606
|
+
};
|
|
1607
|
+
readonly body: {
|
|
1608
|
+
readonly name: "body";
|
|
1609
|
+
};
|
|
1610
|
+
readonly opts: {
|
|
1611
|
+
readonly name: "opts";
|
|
1612
|
+
readonly optional: true;
|
|
1613
|
+
};
|
|
1614
|
+
};
|
|
1615
|
+
readonly superTypes: ["Declaration", "Statement"];
|
|
1616
|
+
};
|
|
1617
|
+
readonly Param: {
|
|
1618
|
+
readonly name: "Param";
|
|
1619
|
+
readonly properties: {
|
|
1620
|
+
readonly annotations: {
|
|
1621
|
+
readonly name: "annotations";
|
|
1622
|
+
readonly defaultValue: [];
|
|
1623
|
+
readonly optional: true;
|
|
1624
|
+
};
|
|
1625
|
+
readonly name: {
|
|
1626
|
+
readonly name: "name";
|
|
1627
|
+
};
|
|
1628
|
+
readonly paramType: {
|
|
1629
|
+
readonly name: "paramType";
|
|
1630
|
+
readonly optional: true;
|
|
1631
|
+
};
|
|
1632
|
+
};
|
|
1633
|
+
readonly superTypes: [];
|
|
1634
|
+
};
|
|
1635
|
+
readonly ParamList: {
|
|
1636
|
+
readonly name: "ParamList";
|
|
1637
|
+
readonly properties: {
|
|
1638
|
+
readonly params: {
|
|
1639
|
+
readonly name: "params";
|
|
1640
|
+
readonly defaultValue: [];
|
|
1641
|
+
};
|
|
1642
|
+
};
|
|
1643
|
+
readonly superTypes: [];
|
|
1644
|
+
};
|
|
1645
|
+
readonly RaceStmt: {
|
|
1646
|
+
readonly name: "RaceStmt";
|
|
1647
|
+
readonly properties: {
|
|
1648
|
+
readonly annotations: {
|
|
1649
|
+
readonly name: "annotations";
|
|
1650
|
+
readonly defaultValue: [];
|
|
1651
|
+
readonly optional: true;
|
|
1652
|
+
};
|
|
1653
|
+
readonly body: {
|
|
1654
|
+
readonly name: "body";
|
|
1655
|
+
};
|
|
1656
|
+
readonly opts: {
|
|
1657
|
+
readonly name: "opts";
|
|
1658
|
+
readonly optional: true;
|
|
1659
|
+
};
|
|
1660
|
+
};
|
|
1661
|
+
readonly superTypes: ["Declaration", "Statement"];
|
|
1662
|
+
};
|
|
1663
|
+
readonly Ref: {
|
|
1664
|
+
readonly name: "Ref";
|
|
1665
|
+
readonly properties: {
|
|
1666
|
+
readonly name: {
|
|
1667
|
+
readonly name: "name";
|
|
1668
|
+
};
|
|
1669
|
+
};
|
|
1670
|
+
readonly superTypes: ["Expr"];
|
|
1671
|
+
};
|
|
1672
|
+
readonly RepeatStmt: {
|
|
1673
|
+
readonly name: "RepeatStmt";
|
|
1674
|
+
readonly properties: {
|
|
1675
|
+
readonly annotations: {
|
|
1676
|
+
readonly name: "annotations";
|
|
1677
|
+
readonly defaultValue: [];
|
|
1678
|
+
readonly optional: true;
|
|
1679
|
+
};
|
|
1680
|
+
readonly body: {
|
|
1681
|
+
readonly name: "body";
|
|
1682
|
+
};
|
|
1683
|
+
readonly count: {
|
|
1684
|
+
readonly name: "count";
|
|
1685
|
+
};
|
|
1686
|
+
readonly index: {
|
|
1687
|
+
readonly name: "index";
|
|
1688
|
+
readonly optional: true;
|
|
1689
|
+
};
|
|
1690
|
+
};
|
|
1691
|
+
readonly superTypes: ["Declaration", "Statement"];
|
|
1692
|
+
};
|
|
1693
|
+
readonly ReportDecl: {
|
|
1694
|
+
readonly name: "ReportDecl";
|
|
1695
|
+
readonly properties: {
|
|
1696
|
+
readonly annotations: {
|
|
1697
|
+
readonly name: "annotations";
|
|
1698
|
+
readonly defaultValue: [];
|
|
1699
|
+
readonly optional: true;
|
|
1700
|
+
};
|
|
1701
|
+
readonly reporters: {
|
|
1702
|
+
readonly name: "reporters";
|
|
1703
|
+
readonly defaultValue: [];
|
|
1704
|
+
};
|
|
1705
|
+
};
|
|
1706
|
+
readonly superTypes: ["Declaration"];
|
|
1707
|
+
};
|
|
1708
|
+
readonly ReturnStmt: {
|
|
1709
|
+
readonly name: "ReturnStmt";
|
|
1710
|
+
readonly properties: {
|
|
1711
|
+
readonly annotations: {
|
|
1712
|
+
readonly name: "annotations";
|
|
1713
|
+
readonly defaultValue: [];
|
|
1714
|
+
readonly optional: true;
|
|
1715
|
+
};
|
|
1716
|
+
readonly value: {
|
|
1717
|
+
readonly name: "value";
|
|
1718
|
+
readonly optional: true;
|
|
1719
|
+
};
|
|
1720
|
+
};
|
|
1721
|
+
readonly superTypes: ["Statement"];
|
|
1722
|
+
};
|
|
1723
|
+
readonly RunStmt: {
|
|
1724
|
+
readonly name: "RunStmt";
|
|
1725
|
+
readonly properties: {
|
|
1726
|
+
readonly annotations: {
|
|
1727
|
+
readonly name: "annotations";
|
|
1728
|
+
readonly defaultValue: [];
|
|
1729
|
+
readonly optional: true;
|
|
1730
|
+
};
|
|
1731
|
+
readonly args: {
|
|
1732
|
+
readonly name: "args";
|
|
1733
|
+
readonly optional: true;
|
|
1734
|
+
};
|
|
1735
|
+
readonly bind: {
|
|
1736
|
+
readonly name: "bind";
|
|
1737
|
+
readonly optional: true;
|
|
1738
|
+
};
|
|
1739
|
+
readonly target: {
|
|
1740
|
+
readonly name: "target";
|
|
1741
|
+
};
|
|
1742
|
+
};
|
|
1743
|
+
readonly superTypes: ["Declaration", "Statement"];
|
|
1744
|
+
};
|
|
1745
|
+
readonly SingleType: {
|
|
1746
|
+
readonly name: "SingleType";
|
|
1747
|
+
readonly properties: {};
|
|
1748
|
+
readonly superTypes: [];
|
|
1749
|
+
};
|
|
1750
|
+
readonly Statement: {
|
|
1751
|
+
readonly name: "Statement";
|
|
1752
|
+
readonly properties: {
|
|
1753
|
+
readonly annotations: {
|
|
1754
|
+
readonly name: "annotations";
|
|
1755
|
+
readonly defaultValue: [];
|
|
1756
|
+
readonly optional: true;
|
|
1757
|
+
};
|
|
1758
|
+
};
|
|
1759
|
+
readonly superTypes: [];
|
|
1760
|
+
};
|
|
1761
|
+
readonly StepDecl: {
|
|
1762
|
+
readonly name: "StepDecl";
|
|
1763
|
+
readonly properties: {
|
|
1764
|
+
readonly annotations: {
|
|
1765
|
+
readonly name: "annotations";
|
|
1766
|
+
readonly defaultValue: [];
|
|
1767
|
+
readonly optional: true;
|
|
1768
|
+
};
|
|
1769
|
+
readonly body: {
|
|
1770
|
+
readonly name: "body";
|
|
1771
|
+
};
|
|
1772
|
+
readonly title: {
|
|
1773
|
+
readonly name: "title";
|
|
1774
|
+
};
|
|
1775
|
+
};
|
|
1776
|
+
readonly superTypes: ["Statement"];
|
|
1777
|
+
};
|
|
1778
|
+
readonly StringLit: {
|
|
1779
|
+
readonly name: "StringLit";
|
|
1780
|
+
readonly properties: {
|
|
1781
|
+
readonly value: {
|
|
1782
|
+
readonly name: "value";
|
|
1783
|
+
};
|
|
1784
|
+
};
|
|
1785
|
+
readonly superTypes: ["Expr"];
|
|
1786
|
+
};
|
|
1787
|
+
readonly Ternary: {
|
|
1788
|
+
readonly name: "Ternary";
|
|
1789
|
+
readonly properties: {
|
|
1790
|
+
readonly condition: {
|
|
1791
|
+
readonly name: "condition";
|
|
1792
|
+
};
|
|
1793
|
+
readonly otherwise: {
|
|
1794
|
+
readonly name: "otherwise";
|
|
1795
|
+
};
|
|
1796
|
+
readonly then: {
|
|
1797
|
+
readonly name: "then";
|
|
1798
|
+
};
|
|
1799
|
+
};
|
|
1800
|
+
readonly superTypes: ["Expr"];
|
|
1801
|
+
};
|
|
1802
|
+
readonly TryStmt: {
|
|
1803
|
+
readonly name: "TryStmt";
|
|
1804
|
+
readonly properties: {
|
|
1805
|
+
readonly annotations: {
|
|
1806
|
+
readonly name: "annotations";
|
|
1807
|
+
readonly defaultValue: [];
|
|
1808
|
+
readonly optional: true;
|
|
1809
|
+
};
|
|
1810
|
+
readonly body: {
|
|
1811
|
+
readonly name: "body";
|
|
1812
|
+
};
|
|
1813
|
+
readonly error: {
|
|
1814
|
+
readonly name: "error";
|
|
1815
|
+
readonly optional: true;
|
|
1816
|
+
};
|
|
1817
|
+
readonly finalizer: {
|
|
1818
|
+
readonly name: "finalizer";
|
|
1819
|
+
readonly optional: true;
|
|
1820
|
+
};
|
|
1821
|
+
readonly handler: {
|
|
1822
|
+
readonly name: "handler";
|
|
1823
|
+
readonly optional: true;
|
|
1824
|
+
};
|
|
1825
|
+
};
|
|
1826
|
+
readonly superTypes: ["Declaration", "Statement"];
|
|
1827
|
+
};
|
|
1828
|
+
readonly TypeBody: {
|
|
1829
|
+
readonly name: "TypeBody";
|
|
1830
|
+
readonly properties: {
|
|
1831
|
+
readonly fields: {
|
|
1832
|
+
readonly name: "fields";
|
|
1833
|
+
readonly defaultValue: [];
|
|
1834
|
+
};
|
|
1835
|
+
};
|
|
1836
|
+
readonly superTypes: [];
|
|
1837
|
+
};
|
|
1838
|
+
readonly TypeDecl: {
|
|
1839
|
+
readonly name: "TypeDecl";
|
|
1840
|
+
readonly properties: {
|
|
1841
|
+
readonly alias: {
|
|
1842
|
+
readonly name: "alias";
|
|
1843
|
+
readonly optional: true;
|
|
1844
|
+
};
|
|
1845
|
+
readonly annotations: {
|
|
1846
|
+
readonly name: "annotations";
|
|
1847
|
+
readonly defaultValue: [];
|
|
1848
|
+
readonly optional: true;
|
|
1849
|
+
};
|
|
1850
|
+
readonly body: {
|
|
1851
|
+
readonly name: "body";
|
|
1852
|
+
readonly optional: true;
|
|
1853
|
+
};
|
|
1854
|
+
readonly name: {
|
|
1855
|
+
readonly name: "name";
|
|
1856
|
+
};
|
|
1857
|
+
};
|
|
1858
|
+
readonly superTypes: ["Declaration"];
|
|
1859
|
+
};
|
|
1860
|
+
readonly TypeRef: {
|
|
1861
|
+
readonly name: "TypeRef";
|
|
1862
|
+
readonly properties: {
|
|
1863
|
+
readonly members: {
|
|
1864
|
+
readonly name: "members";
|
|
1865
|
+
readonly defaultValue: [];
|
|
1866
|
+
};
|
|
1867
|
+
};
|
|
1868
|
+
readonly superTypes: [];
|
|
1869
|
+
};
|
|
1870
|
+
readonly Unary: {
|
|
1871
|
+
readonly name: "Unary";
|
|
1872
|
+
readonly properties: {
|
|
1873
|
+
readonly operand: {
|
|
1874
|
+
readonly name: "operand";
|
|
1875
|
+
};
|
|
1876
|
+
readonly operator: {
|
|
1877
|
+
readonly name: "operator";
|
|
1878
|
+
};
|
|
1879
|
+
};
|
|
1880
|
+
readonly superTypes: ["Expr"];
|
|
1881
|
+
};
|
|
1882
|
+
readonly UseDecl: {
|
|
1883
|
+
readonly name: "UseDecl";
|
|
1884
|
+
readonly properties: {
|
|
1885
|
+
readonly alias: {
|
|
1886
|
+
readonly name: "alias";
|
|
1887
|
+
readonly optional: true;
|
|
1888
|
+
};
|
|
1889
|
+
readonly pkg: {
|
|
1890
|
+
readonly name: "pkg";
|
|
1891
|
+
};
|
|
1892
|
+
};
|
|
1893
|
+
readonly superTypes: ["ImportDecl"];
|
|
1894
|
+
};
|
|
1895
|
+
readonly ValueImport: {
|
|
1896
|
+
readonly name: "ValueImport";
|
|
1897
|
+
readonly properties: {
|
|
1898
|
+
readonly default: {
|
|
1899
|
+
readonly name: "default";
|
|
1900
|
+
readonly optional: true;
|
|
1901
|
+
};
|
|
1902
|
+
readonly export: {
|
|
1903
|
+
readonly name: "export";
|
|
1904
|
+
readonly defaultValue: false;
|
|
1905
|
+
readonly optional: true;
|
|
1906
|
+
};
|
|
1907
|
+
readonly names: {
|
|
1908
|
+
readonly name: "names";
|
|
1909
|
+
readonly defaultValue: [];
|
|
1910
|
+
readonly optional: true;
|
|
1911
|
+
};
|
|
1912
|
+
readonly path: {
|
|
1913
|
+
readonly name: "path";
|
|
1914
|
+
};
|
|
1915
|
+
readonly wildcard: {
|
|
1916
|
+
readonly name: "wildcard";
|
|
1917
|
+
readonly optional: true;
|
|
1918
|
+
};
|
|
1919
|
+
};
|
|
1920
|
+
readonly superTypes: ["ImportDecl"];
|
|
1921
|
+
};
|
|
1922
|
+
readonly WhileStmt: {
|
|
1923
|
+
readonly name: "WhileStmt";
|
|
1924
|
+
readonly properties: {
|
|
1925
|
+
readonly annotations: {
|
|
1926
|
+
readonly name: "annotations";
|
|
1927
|
+
readonly defaultValue: [];
|
|
1928
|
+
readonly optional: true;
|
|
1929
|
+
};
|
|
1930
|
+
readonly body: {
|
|
1931
|
+
readonly name: "body";
|
|
1932
|
+
};
|
|
1933
|
+
readonly cond: {
|
|
1934
|
+
readonly name: "cond";
|
|
1935
|
+
};
|
|
1936
|
+
};
|
|
1937
|
+
readonly superTypes: ["Declaration", "Statement"];
|
|
1938
|
+
};
|
|
1939
|
+
};
|
|
1940
|
+
}
|
|
1941
|
+
declare const reflection: VennAstReflection;
|
|
1942
|
+
//#endregion
|
|
1943
|
+
//#region src/ast/call-args.d.ts
|
|
1944
|
+
/**
|
|
1945
|
+
* The arguments of a call, however it was written.
|
|
1946
|
+
*
|
|
1947
|
+
* The language spells a call two ways, `conn.close()` with brackets and
|
|
1948
|
+
* `http.get "url"` without, and the parser keeps them in different places on
|
|
1949
|
+
* the node. They are the same call with the same arguments, so every reader
|
|
1950
|
+
* downstream asks here and sees one list.
|
|
1951
|
+
*/
|
|
1952
|
+
declare function callArgs(call: ActionCall): readonly Expr[];
|
|
1953
|
+
//#endregion
|
|
1954
|
+
//#region src/ast/dotted-path.d.ts
|
|
1955
|
+
/**
|
|
1956
|
+
* The dotted name an expression spells, such as `http.get` or
|
|
1957
|
+
* `data.faker.uuid`.
|
|
1958
|
+
*
|
|
1959
|
+
* The parser cannot tell a namespace from a field: `res.status` and `http.get`
|
|
1960
|
+
* are the same shape. Only a registry knows which is which, so the name is
|
|
1961
|
+
* carried this far as text and asked about there.
|
|
1962
|
+
*
|
|
1963
|
+
* @returns The dotted name, or `undefined` when the expression is not a plain
|
|
1964
|
+
* chain of identifiers.
|
|
1965
|
+
*/
|
|
1966
|
+
declare function dottedPath(expr: Expr | AstNode$1 | undefined): string | undefined;
|
|
1967
|
+
//#endregion
|
|
1968
|
+
//#region src/ast/is-statement.d.ts
|
|
1969
|
+
/**
|
|
1970
|
+
* Whether a top-level node runs, or merely defines.
|
|
1971
|
+
*
|
|
1972
|
+
* A `flow`, a `fn`, a `type` are definitions: they exist for something else to
|
|
1973
|
+
* reach. Everything else at the top of a file is a statement, and statements
|
|
1974
|
+
* run in the order they are written. That holds in a script, where the file is
|
|
1975
|
+
* the program, and in a test file, so the same lines mean the same thing in
|
|
1976
|
+
* both.
|
|
1977
|
+
*/
|
|
1978
|
+
declare function isRunnable(node: Declaration): node is Declaration & Statement;
|
|
1979
|
+
//#endregion
|
|
1980
|
+
//#region src/ast/split-call.d.ts
|
|
1981
|
+
/** A call's arguments, told apart: what it takes, and what configures it. */
|
|
1982
|
+
interface SplitCall {
|
|
1983
|
+
args: readonly Expr[];
|
|
1984
|
+
opts?: MapLit;
|
|
1985
|
+
}
|
|
1986
|
+
/**
|
|
1987
|
+
* Tell a verb's positional arguments from its options map.
|
|
1988
|
+
*
|
|
1989
|
+
* The language spells one call two ways, and the trailing `{ … }` means the
|
|
1990
|
+
* same in both: `http.get "url" { headers }` and `http.get("url", { headers })`
|
|
1991
|
+
* are the same request. Only the first spelling puts the map somewhere the
|
|
1992
|
+
* parser can label, so the second is disambiguated here.
|
|
1993
|
+
*
|
|
1994
|
+
* A map beyond the declared positionals is the options; a map *within* them is
|
|
1995
|
+
* an argument. `db.seed({ users: […] })` passes a map because seeding is what
|
|
1996
|
+
* it does, and that must never be read as configuration.
|
|
1997
|
+
*
|
|
1998
|
+
* @param takes How many positional arguments the verb declares.
|
|
1999
|
+
*/
|
|
2000
|
+
declare function splitCall(args: readonly Expr[], takes: number): SplitCall;
|
|
2001
|
+
//#endregion
|
|
2002
|
+
//#region src/ast/walk.d.ts
|
|
2003
|
+
/** Every descendant of `root`, depth-first, for whole-document passes. */
|
|
2004
|
+
declare function walkAst(root: AstNode$1): AstNode$1[];
|
|
2005
|
+
//#endregion
|
|
2006
|
+
//#region src/problem/diff.types.d.ts
|
|
2007
|
+
/**
|
|
2008
|
+
* One field of a structured comparison. Fields that agree are carried too: what
|
|
2009
|
+
* makes a diff readable is the one line that moved standing among the ones that
|
|
2010
|
+
* did not.
|
|
2011
|
+
*/
|
|
2012
|
+
interface DiffEntry {
|
|
2013
|
+
/** Where the field sits under the subject: `.status`, `[2]`, `.items[0].id`. */
|
|
2014
|
+
path: string;
|
|
2015
|
+
expected: string;
|
|
2016
|
+
actual: string;
|
|
2017
|
+
same: boolean;
|
|
2018
|
+
}
|
|
2019
|
+
/** Structured expected-vs-actual (§16), never a `toString`. */
|
|
2020
|
+
type Diff = {
|
|
2021
|
+
kind: "scalar";
|
|
2022
|
+
expected: string;
|
|
2023
|
+
actual: string;
|
|
2024
|
+
} | {
|
|
2025
|
+
kind: "json";
|
|
2026
|
+
path: string;
|
|
2027
|
+
expected: unknown;
|
|
2028
|
+
actual: unknown;
|
|
2029
|
+
} | {
|
|
2030
|
+
kind: "text";
|
|
2031
|
+
expected: string;
|
|
2032
|
+
actual: string;
|
|
2033
|
+
} |
|
|
2034
|
+
/** The two sides walked field by field; a list position counts as a field. */
|
|
2035
|
+
{
|
|
2036
|
+
kind: "fields";
|
|
2037
|
+
label: string;
|
|
2038
|
+
entries: readonly DiffEntry[];
|
|
2039
|
+
};
|
|
2040
|
+
//#endregion
|
|
2041
|
+
//#region src/problem/build-diff.d.ts
|
|
2042
|
+
/**
|
|
2043
|
+
* Turn the two sides a producer compared into a {@link Diff}. Two structures are
|
|
2044
|
+
* walked field by field, so the failure names the field that moved instead of
|
|
2045
|
+
* printing the same rendering twice; anything else stays a plain pair.
|
|
2046
|
+
*/
|
|
2047
|
+
declare function buildDiff(args: {
|
|
2048
|
+
/** Heading for the field-by-field form. */
|
|
2049
|
+
label: string;
|
|
2050
|
+
expected: unknown;
|
|
2051
|
+
actual: unknown;
|
|
2052
|
+
/**
|
|
2053
|
+
* Whether the two sides correspond position by position. Pass `false` for a
|
|
2054
|
+
* comparison that does not, such as `contains`. See {@link walkable}.
|
|
2055
|
+
*/
|
|
2056
|
+
aligned?: boolean;
|
|
2057
|
+
}): Diff;
|
|
2058
|
+
//#endregion
|
|
2059
|
+
//#region src/problem/format-value.d.ts
|
|
2060
|
+
/**
|
|
2061
|
+
* One side of a diff, rendered the way the language shows values: strings quoted
|
|
2062
|
+
* so `"1"` never reads as `1`, structures as compact JSON. Never `[object
|
|
2063
|
+
* Object]`, because a failure that hides what it compared is not a report.
|
|
2064
|
+
*/
|
|
2065
|
+
declare function formatValue(value: unknown): string;
|
|
2066
|
+
//#endregion
|
|
2067
|
+
//#region src/problem/span.types.d.ts
|
|
2068
|
+
/** The exact location of a problem in a source file (1-based line/column). */
|
|
2069
|
+
interface Span {
|
|
2070
|
+
uri: string;
|
|
2071
|
+
offset: number;
|
|
2072
|
+
length: number;
|
|
2073
|
+
line: number;
|
|
2074
|
+
column: number;
|
|
2075
|
+
}
|
|
2076
|
+
//#endregion
|
|
2077
|
+
//#region src/problem/related.types.d.ts
|
|
2078
|
+
/** A secondary location, e.g. "here it was declared as…". */
|
|
2079
|
+
interface RelatedInfo {
|
|
2080
|
+
span: Span;
|
|
2081
|
+
label: string;
|
|
2082
|
+
}
|
|
2083
|
+
//#endregion
|
|
2084
|
+
//#region src/problem/severity.types.d.ts
|
|
2085
|
+
/** How loudly a problem is reported. Only `error` fails a run. */
|
|
2086
|
+
type Severity = "error" | "warning" | "hint";
|
|
2087
|
+
//#endregion
|
|
2088
|
+
//#region src/problem/problem.types.d.ts
|
|
2089
|
+
/**
|
|
2090
|
+
* The single shape shared by compile diagnostics and runtime failures, so one
|
|
2091
|
+
* renderer serves terminal, editor, and UI (§16). Optional fields are populated
|
|
2092
|
+
* as each producer has the information.
|
|
2093
|
+
*/
|
|
2094
|
+
interface Problem {
|
|
2095
|
+
code: string;
|
|
2096
|
+
severity: Severity;
|
|
2097
|
+
title: string;
|
|
2098
|
+
span: Span;
|
|
2099
|
+
help?: string;
|
|
2100
|
+
related?: RelatedInfo[];
|
|
2101
|
+
diff?: Diff;
|
|
2102
|
+
note?: string;
|
|
2103
|
+
docs?: string;
|
|
2104
|
+
}
|
|
2105
|
+
//#endregion
|
|
2106
|
+
//#region src/problem/problem-error.d.ts
|
|
2107
|
+
/**
|
|
2108
|
+
* Carries a {@link Problem} across a throw boundary at runtime. Catch it to
|
|
2109
|
+
* recover the structured problem; `message` is only the title.
|
|
2110
|
+
*/
|
|
2111
|
+
declare class ProblemError extends Error {
|
|
2112
|
+
readonly problem: Problem;
|
|
2113
|
+
constructor(problem: Problem);
|
|
2114
|
+
}
|
|
2115
|
+
//#endregion
|
|
2116
|
+
//#region src/codes/code.types.d.ts
|
|
2117
|
+
/** A catalog entry: a stable code plus its default severity. */
|
|
2118
|
+
interface CodeSpec {
|
|
2119
|
+
code: string;
|
|
2120
|
+
severity: Severity;
|
|
2121
|
+
}
|
|
2122
|
+
//#endregion
|
|
2123
|
+
//#region src/codes/build-problem.d.ts
|
|
2124
|
+
/** Construct a {@link Problem} from a catalog spec plus location and message. */
|
|
2125
|
+
declare function buildProblem(args: {
|
|
2126
|
+
spec: CodeSpec;
|
|
2127
|
+
span: Span;
|
|
2128
|
+
title: string;
|
|
2129
|
+
help?: string;
|
|
2130
|
+
related?: RelatedInfo[];
|
|
2131
|
+
diff?: Diff;
|
|
2132
|
+
note?: string;
|
|
2133
|
+
}): Problem;
|
|
2134
|
+
//#endregion
|
|
2135
|
+
//#region src/codes/catalog.d.ts
|
|
2136
|
+
/**
|
|
2137
|
+
* Every VNxxxx the kernel itself can raise. Codes are stable, googlable, and
|
|
2138
|
+
* documented; families follow the leading digit (1 lex/syntax … 8 timeout).
|
|
2139
|
+
*/
|
|
2140
|
+
declare const CODES: {
|
|
2141
|
+
readonly VN1001_LEX: {
|
|
2142
|
+
readonly code: "VN1001";
|
|
2143
|
+
readonly severity: "error";
|
|
2144
|
+
};
|
|
2145
|
+
readonly VN1002_PARSE: {
|
|
2146
|
+
readonly code: "VN1002";
|
|
2147
|
+
readonly severity: "error";
|
|
2148
|
+
};
|
|
2149
|
+
readonly VN2003_UNKNOWN_ACTION: {
|
|
2150
|
+
readonly code: "VN2003";
|
|
2151
|
+
readonly severity: "error";
|
|
2152
|
+
};
|
|
2153
|
+
readonly VN2004_UNKNOWN_MATCHER: {
|
|
2154
|
+
readonly code: "VN2004";
|
|
2155
|
+
readonly severity: "error";
|
|
2156
|
+
};
|
|
2157
|
+
readonly VN2005_UNKNOWN_FRAGMENT: {
|
|
2158
|
+
readonly code: "VN2005";
|
|
2159
|
+
readonly severity: "error";
|
|
2160
|
+
};
|
|
2161
|
+
readonly VN2006_UNKNOWN_ENV: {
|
|
2162
|
+
readonly code: "VN2006";
|
|
2163
|
+
readonly severity: "error";
|
|
2164
|
+
};
|
|
2165
|
+
readonly VN2007_NAMESPACE_NOT_IMPORTED: {
|
|
2166
|
+
readonly code: "VN2007";
|
|
2167
|
+
readonly severity: "error";
|
|
2168
|
+
};
|
|
2169
|
+
readonly VN2008_UNCALLED_ACTION: {
|
|
2170
|
+
readonly code: "VN2008";
|
|
2171
|
+
readonly severity: "error";
|
|
2172
|
+
};
|
|
2173
|
+
readonly VN2009_NOT_EXPORTED: {
|
|
2174
|
+
readonly code: "VN2009";
|
|
2175
|
+
readonly severity: "error";
|
|
2176
|
+
};
|
|
2177
|
+
readonly VN2013_UNKNOWN_DECORATOR: {
|
|
2178
|
+
readonly code: "VN2013";
|
|
2179
|
+
readonly severity: "error";
|
|
2180
|
+
};
|
|
2181
|
+
readonly VN2014_DECORATOR_TARGET: {
|
|
2182
|
+
readonly code: "VN2014";
|
|
2183
|
+
readonly severity: "error";
|
|
2184
|
+
};
|
|
2185
|
+
readonly VN2015_DECO_SIGNATURE: {
|
|
2186
|
+
readonly code: "VN2015";
|
|
2187
|
+
readonly severity: "error";
|
|
2188
|
+
};
|
|
2189
|
+
readonly VN2016_DECO_IMPURE: {
|
|
2190
|
+
readonly code: "VN2016";
|
|
2191
|
+
readonly severity: "error";
|
|
2192
|
+
};
|
|
2193
|
+
readonly VN2017_DECO_VERB: {
|
|
2194
|
+
readonly code: "VN2017";
|
|
2195
|
+
readonly severity: "error";
|
|
2196
|
+
};
|
|
2197
|
+
readonly VN3001_UNKNOWN_OPTION: {
|
|
2198
|
+
readonly code: "VN3001";
|
|
2199
|
+
readonly severity: "error";
|
|
2200
|
+
};
|
|
2201
|
+
readonly VN3010_TYPE_MISMATCH: {
|
|
2202
|
+
readonly code: "VN3010";
|
|
2203
|
+
readonly severity: "error";
|
|
2204
|
+
};
|
|
2205
|
+
readonly VN3012_UNIT_MISMATCH: {
|
|
2206
|
+
readonly code: "VN3012";
|
|
2207
|
+
readonly severity: "error";
|
|
2208
|
+
};
|
|
2209
|
+
readonly VN3013_NOT_CALLABLE: {
|
|
2210
|
+
readonly code: "VN3013";
|
|
2211
|
+
readonly severity: "error";
|
|
2212
|
+
};
|
|
2213
|
+
readonly VN3014_STILL_WAITING: {
|
|
2214
|
+
readonly code: "VN3014";
|
|
2215
|
+
readonly severity: "error";
|
|
2216
|
+
};
|
|
2217
|
+
readonly VN3015_NOT_A_LIST: {
|
|
2218
|
+
readonly code: "VN3015";
|
|
2219
|
+
readonly severity: "error";
|
|
2220
|
+
};
|
|
2221
|
+
readonly VN3016_NOT_A_NUMBER: {
|
|
2222
|
+
readonly code: "VN3016";
|
|
2223
|
+
readonly severity: "error";
|
|
2224
|
+
};
|
|
2225
|
+
readonly VN3017_DECO_ARGUMENTS: {
|
|
2226
|
+
readonly code: "VN3017";
|
|
2227
|
+
readonly severity: "error";
|
|
2228
|
+
};
|
|
2229
|
+
readonly VN5001_REMOVED_KEYWORD: {
|
|
2230
|
+
readonly code: "VN5001";
|
|
2231
|
+
readonly severity: "error";
|
|
2232
|
+
};
|
|
2233
|
+
readonly VN6001_ASSERTION_FAILED: {
|
|
2234
|
+
readonly code: "VN6001";
|
|
2235
|
+
readonly severity: "error";
|
|
2236
|
+
};
|
|
2237
|
+
readonly VN7001_ACTION_FAILED: {
|
|
2238
|
+
readonly code: "VN7001";
|
|
2239
|
+
readonly severity: "error";
|
|
2240
|
+
};
|
|
2241
|
+
readonly VN7004_HOOK_FAILED: {
|
|
2242
|
+
readonly code: "VN7004";
|
|
2243
|
+
readonly severity: "error";
|
|
2244
|
+
};
|
|
2245
|
+
readonly VN8002_LOOP_LIMIT: {
|
|
2246
|
+
readonly code: "VN8002";
|
|
2247
|
+
readonly severity: "error";
|
|
2248
|
+
};
|
|
2249
|
+
};
|
|
2250
|
+
//#endregion
|
|
2251
|
+
//#region src/expr/eval-env.types.d.ts
|
|
2252
|
+
/**
|
|
2253
|
+
* The scope the evaluator reads from: `let`/`const`, captures, parameters.
|
|
2254
|
+
*
|
|
2255
|
+
* Actions and matchers are deliberately absent. They belong to the runtime
|
|
2256
|
+
* registry, which keeps the evaluator pure and free of protocol execution.
|
|
2257
|
+
*/
|
|
2258
|
+
interface EvalEnv {
|
|
2259
|
+
lookup(name: string): unknown;
|
|
2260
|
+
}
|
|
2261
|
+
//#endregion
|
|
2262
|
+
//#region src/compile/compile.types.d.ts
|
|
2263
|
+
/**
|
|
2264
|
+
* A compiled expression: everything the source decided is already captured, so
|
|
2265
|
+
* running it needs only the environment.
|
|
2266
|
+
*/
|
|
2267
|
+
type Thunk = (env: EvalEnv) => unknown;
|
|
2268
|
+
/** A function body, compiled: its local bindings in order, then its result. */
|
|
2269
|
+
interface CompiledBody {
|
|
2270
|
+
/** Every name that gets a slot: the parameters first, then the locals. */
|
|
2271
|
+
readonly names: readonly string[];
|
|
2272
|
+
/** How many names spill past the frame's inline slots. Usually none. */
|
|
2273
|
+
readonly extra: number;
|
|
2274
|
+
/** Every name the body reads but does not bind, in cell order. */
|
|
2275
|
+
readonly free: readonly string[];
|
|
2276
|
+
/**
|
|
2277
|
+
* The body binds one name, reads nothing else, and asks for nothing by text,
|
|
2278
|
+
* so a call hands the argument straight to `result` with no frame between.
|
|
2279
|
+
*/
|
|
2280
|
+
readonly bare: boolean;
|
|
2281
|
+
readonly locals: readonly CompiledLocal[];
|
|
2282
|
+
readonly result: Thunk;
|
|
2283
|
+
}
|
|
2284
|
+
/** One of the body's `let` bindings, compiled. Filled in declaration order. */
|
|
2285
|
+
interface CompiledLocal {
|
|
2286
|
+
/** Which slot of the frame this local writes to. */
|
|
2287
|
+
readonly slot: number;
|
|
2288
|
+
readonly value: Thunk;
|
|
2289
|
+
}
|
|
2290
|
+
//#endregion
|
|
2291
|
+
//#region src/expr/cell.types.d.ts
|
|
2292
|
+
/**
|
|
2293
|
+
* A binding's storage, addressed once and read many times.
|
|
2294
|
+
*
|
|
2295
|
+
* The language has no assignment, so a name never changes what it holds, but it
|
|
2296
|
+
* can be *filled in* after the function reading it was built. A recursive `fn`
|
|
2297
|
+
* is the plain case: `fib` becomes a value before the name `fib` is bound, so
|
|
2298
|
+
* anything resolved eagerly would capture nothing. The cell is handed out empty
|
|
2299
|
+
* and filled when the binding happens, which is what lets a name be resolved at
|
|
2300
|
+
* compile time and still read the right value.
|
|
2301
|
+
*/
|
|
2302
|
+
interface Cell {
|
|
2303
|
+
value: unknown;
|
|
2304
|
+
}
|
|
2305
|
+
/** An environment that can hand out a cell per name: the top of the chain. */
|
|
2306
|
+
interface CellEnv extends EvalEnv {
|
|
2307
|
+
cell(name: string): Cell;
|
|
2308
|
+
}
|
|
2309
|
+
/** Whether this environment addresses its bindings by cell. */
|
|
2310
|
+
declare function hasCells(env: EvalEnv): env is CellEnv;
|
|
2311
|
+
//#endregion
|
|
2312
|
+
//#region src/expr/closure.types.d.ts
|
|
2313
|
+
/** The brand that tells a function value apart from a map that happens to look like one. */
|
|
2314
|
+
declare const CLOSURE: unique symbol;
|
|
2315
|
+
/**
|
|
2316
|
+
* A function value: its parameter names, its compiled body, and the environment
|
|
2317
|
+
* it was defined in.
|
|
2318
|
+
*
|
|
2319
|
+
* Because `fn` is pure (§08), a closure runs entirely in the evaluator, which
|
|
2320
|
+
* is what makes functions first-class and callable from any expression,
|
|
2321
|
+
* interpolation included.
|
|
2322
|
+
*
|
|
2323
|
+
* The body arrives already compiled. A `fn (…) => …` written inside `map` is
|
|
2324
|
+
* evaluated once per call to `map`, so compiling there would put the compiler
|
|
2325
|
+
* back in the hot loop.
|
|
2326
|
+
*/
|
|
2327
|
+
interface Closure {
|
|
2328
|
+
readonly [CLOSURE]: true;
|
|
2329
|
+
readonly params: readonly string[];
|
|
2330
|
+
readonly body: CompiledBody;
|
|
2331
|
+
readonly env: EvalEnv;
|
|
2332
|
+
/**
|
|
2333
|
+
* A cell per free name of the body, resolved when this value was made.
|
|
2334
|
+
* Absent when the defining environment does not address bindings by cell: a
|
|
2335
|
+
* function nested inside another, whose free names live in its frame.
|
|
2336
|
+
*/
|
|
2337
|
+
readonly up?: readonly Cell[];
|
|
2338
|
+
}
|
|
2339
|
+
//#endregion
|
|
2340
|
+
//#region src/compile/compile.d.ts
|
|
2341
|
+
/**
|
|
2342
|
+
* Compile an expression into a function of the environment.
|
|
2343
|
+
*
|
|
2344
|
+
* Memoised per node, so asking twice for the same expression hands back the
|
|
2345
|
+
* same thunk.
|
|
2346
|
+
*
|
|
2347
|
+
* @returns A thunk: give it an environment and it produces the value.
|
|
2348
|
+
*/
|
|
2349
|
+
declare function compileExpr(expr: Expr): Thunk;
|
|
2350
|
+
/**
|
|
2351
|
+
* Build the function value for a top-level `fn name(…)`.
|
|
2352
|
+
*
|
|
2353
|
+
* The body is compiled against `env`, which is what lets a recursive
|
|
2354
|
+
* declaration reach its own name: the cell is handed out before the binding
|
|
2355
|
+
* that fills it exists.
|
|
2356
|
+
*
|
|
2357
|
+
* @returns The closure, ready to be bound under the declaration's name.
|
|
2358
|
+
*/
|
|
2359
|
+
declare function closureOfDecl(decl: FnDecl, env: EvalEnv): Closure;
|
|
2360
|
+
//#endregion
|
|
2361
|
+
//#region src/events/run-plan.types.d.ts
|
|
2362
|
+
/** One step of a {@link RunPlan}. */
|
|
2363
|
+
interface PlannedStep {
|
|
2364
|
+
title: string;
|
|
2365
|
+
}
|
|
2366
|
+
/** One flow of a {@link RunPlan}, with the steps it will take. */
|
|
2367
|
+
interface PlannedFlow {
|
|
2368
|
+
title: string;
|
|
2369
|
+
steps: PlannedStep[];
|
|
2370
|
+
}
|
|
2371
|
+
/**
|
|
2372
|
+
* What the run intends to do, carried on `run.started`. The UI draws it in
|
|
2373
|
+
* grey before anything executes, so the shape of the run is visible up front.
|
|
2374
|
+
*/
|
|
2375
|
+
interface RunPlan {
|
|
2376
|
+
flows: PlannedFlow[];
|
|
2377
|
+
}
|
|
2378
|
+
//#endregion
|
|
2379
|
+
//#region src/events/status.types.d.ts
|
|
2380
|
+
/** Where a flow, step or action stands when an event reports it. */
|
|
2381
|
+
type Status = "passed" | "failed" | "skipped" | "running";
|
|
2382
|
+
//#endregion
|
|
2383
|
+
//#region src/events/event-data.types.d.ts
|
|
2384
|
+
/**
|
|
2385
|
+
* The payload per event kind. EventKind is DERIVED from these keys, so adding an
|
|
2386
|
+
* event is a single edit here. This is the M1 subset of the §15 taxonomy.
|
|
2387
|
+
*/
|
|
2388
|
+
interface EventData {
|
|
2389
|
+
"run.started": {
|
|
2390
|
+
plan: RunPlan;
|
|
2391
|
+
};
|
|
2392
|
+
"run.finished": {
|
|
2393
|
+
passed: number;
|
|
2394
|
+
failed: number;
|
|
2395
|
+
durationMs: number;
|
|
2396
|
+
};
|
|
2397
|
+
"flow.started": {
|
|
2398
|
+
title: string;
|
|
2399
|
+
};
|
|
2400
|
+
"flow.finished": {
|
|
2401
|
+
title: string;
|
|
2402
|
+
status: Status;
|
|
2403
|
+
};
|
|
2404
|
+
"flow.retrying": {
|
|
2405
|
+
title: string;
|
|
2406
|
+
attempt: number;
|
|
2407
|
+
reason: string;
|
|
2408
|
+
};
|
|
2409
|
+
"step.started": {
|
|
2410
|
+
title: string;
|
|
2411
|
+
};
|
|
2412
|
+
"step.finished": {
|
|
2413
|
+
title: string;
|
|
2414
|
+
status: Status;
|
|
2415
|
+
};
|
|
2416
|
+
"action.started": {
|
|
2417
|
+
namespace: string;
|
|
2418
|
+
action: string;
|
|
2419
|
+
};
|
|
2420
|
+
"action.finished": {
|
|
2421
|
+
namespace: string;
|
|
2422
|
+
action: string;
|
|
2423
|
+
status: Status;
|
|
2424
|
+
durationMs: number;
|
|
2425
|
+
};
|
|
2426
|
+
"expect.passed": {
|
|
2427
|
+
source: string;
|
|
2428
|
+
};
|
|
2429
|
+
"expect.failed": {
|
|
2430
|
+
problem: Problem;
|
|
2431
|
+
};
|
|
2432
|
+
log: {
|
|
2433
|
+
level: string;
|
|
2434
|
+
message: string;
|
|
2435
|
+
};
|
|
2436
|
+
}
|
|
2437
|
+
/** Every event name, derived from {@link EventData}. */
|
|
2438
|
+
type EventKind = keyof EventData;
|
|
2439
|
+
//#endregion
|
|
2440
|
+
//#region src/events/ids.types.d.ts
|
|
2441
|
+
/** A run identifier (ULID). Branded so it is not confused with a plain string. */
|
|
2442
|
+
type RunId = string & {
|
|
2443
|
+
readonly __brand: "RunId";
|
|
2444
|
+
};
|
|
2445
|
+
/**
|
|
2446
|
+
* A node path derived from `@id`, e.g. "checkout/flow-checkout/step-cart".
|
|
2447
|
+
*
|
|
2448
|
+
* The join key across the node graph, the editor margin, and the execution
|
|
2449
|
+
* tree. Never a numeric index: an edit would silently desync history.
|
|
2450
|
+
*/
|
|
2451
|
+
type NodePath = string & {
|
|
2452
|
+
readonly __brand: "NodePath";
|
|
2453
|
+
};
|
|
2454
|
+
//#endregion
|
|
2455
|
+
//#region src/events/envelope.types.d.ts
|
|
2456
|
+
/** The single contract between runner, host, and UI. Everything else derives from it. */
|
|
2457
|
+
interface Envelope<K extends EventKind = EventKind> {
|
|
2458
|
+
/** Monotonic per run; the UI detects a gap and asks for a resync. */
|
|
2459
|
+
seq: number;
|
|
2460
|
+
/** ISO-8601 with milliseconds, from the runner's clock. */
|
|
2461
|
+
ts: string;
|
|
2462
|
+
run: RunId;
|
|
2463
|
+
kind: K;
|
|
2464
|
+
node?: NodePath;
|
|
2465
|
+
parent?: NodePath;
|
|
2466
|
+
/** Which parallel worker emitted this, so interleaved output can be split. */
|
|
2467
|
+
worker?: number;
|
|
2468
|
+
data: EventData[K];
|
|
2469
|
+
}
|
|
2470
|
+
//#endregion
|
|
2471
|
+
//#region src/expand/handles/handle.types.d.ts
|
|
2472
|
+
/**
|
|
2473
|
+
* What a `deco` decorates, written as the type of its first parameter.
|
|
2474
|
+
*
|
|
2475
|
+
* These are the words the language uses about itself. A decorator author says
|
|
2476
|
+
* `target: Fn` and never learns that the compiler calls that node a `FnDecl`,
|
|
2477
|
+
* which is the whole reason this vocabulary exists.
|
|
2478
|
+
*/
|
|
2479
|
+
type TargetKind = "Fn" | "Flow" | "Step" | "Binding" | "Type" | "Node";
|
|
2480
|
+
/**
|
|
2481
|
+
* The value a decorator body holds for its target: named members over the real
|
|
2482
|
+
* declaration. Reading one may refuse, so the members are defined as getters.
|
|
2483
|
+
*/
|
|
2484
|
+
type TargetHandle = Record<string, unknown>;
|
|
2485
|
+
/** What a handle is, for a caller holding one: its kind and every name it answers to. */
|
|
2486
|
+
interface HandleSurface {
|
|
2487
|
+
readonly kind: TargetKind;
|
|
2488
|
+
readonly offered: readonly string[];
|
|
2489
|
+
}
|
|
2490
|
+
//#endregion
|
|
2491
|
+
//#region src/expand/handles/kind-of.d.ts
|
|
2492
|
+
/** Every kind a `deco` may name, in the order a diagnostic should list them. */
|
|
2493
|
+
declare const TARGET_KINDS: readonly TargetKind[];
|
|
2494
|
+
/** What kind of thing a node is, in the language's own words. */
|
|
2495
|
+
declare function kindOf(node: AstNode$1): TargetKind;
|
|
2496
|
+
/** Whether a written type name is one of the kinds. */
|
|
2497
|
+
declare function isTargetKind(name: string): name is TargetKind;
|
|
2498
|
+
//#endregion
|
|
2499
|
+
//#region src/expand/handles/make-handle.d.ts
|
|
2500
|
+
/**
|
|
2501
|
+
* The typed mutable handle a decorator holds: verbs over the real declaration.
|
|
2502
|
+
*
|
|
2503
|
+
* Built like the native members of a list or a string, as a table of names and a
|
|
2504
|
+
* value produced on read, because that is what it is: the built-in members of
|
|
2505
|
+
* one more kind of value, whose receiver happens to be a piece of the program
|
|
2506
|
+
* rather than a piece of its data.
|
|
2507
|
+
*
|
|
2508
|
+
* Every verb any kind has is installed. The ones this kind lacks throw a
|
|
2509
|
+
* `ProblemError` naming the surface it does offer, so a reach for the wrong verb
|
|
2510
|
+
* is refused rather than read as nothing.
|
|
2511
|
+
*/
|
|
2512
|
+
declare function makeHandle(args: {
|
|
2513
|
+
node: AstNode$1;
|
|
2514
|
+
kind: TargetKind;
|
|
2515
|
+
}): TargetHandle;
|
|
2516
|
+
/**
|
|
2517
|
+
* What this handle answers to, or nothing when the value is not one.
|
|
2518
|
+
*
|
|
2519
|
+
* A getter can only refuse a name some kind has; a name no kind has would still
|
|
2520
|
+
* read as nothing. The caller that reaches for one asks here instead, so
|
|
2521
|
+
* `target.wobble` is refused in the same sentence as `target.addParam`.
|
|
2522
|
+
*/
|
|
2523
|
+
declare function handleSurface(value: unknown): HandleSurface | undefined;
|
|
2524
|
+
//#endregion
|
|
2525
|
+
//#region src/expand/accepted-kinds.d.ts
|
|
2526
|
+
/** The parameter that *is* the target: the first one, always. */
|
|
2527
|
+
declare function decoTarget(decl: DecoDecl): Param | undefined;
|
|
2528
|
+
/**
|
|
2529
|
+
* The kinds a `deco` decorates, read off the type on its first parameter.
|
|
2530
|
+
*
|
|
2531
|
+
* The signature is the only statement of what a decorator is for; a separate
|
|
2532
|
+
* list of node names would drift from it. Empty means the signature never said
|
|
2533
|
+
* (no parameter, or one typed with something that is not a kind). That fault is
|
|
2534
|
+
* reported where the `deco` is declared, so a use site stays quiet about a
|
|
2535
|
+
* mistake it did not make.
|
|
2536
|
+
*
|
|
2537
|
+
* @returns the kinds the first parameter's type names, in written order.
|
|
2538
|
+
*/
|
|
2539
|
+
declare function acceptedKinds(decl: DecoDecl): readonly TargetKind[];
|
|
2540
|
+
//#endregion
|
|
2541
|
+
//#region src/expr/closure.d.ts
|
|
2542
|
+
/** Whether this value is a `fn`. The brand distinguishes it from a lookalike map. */
|
|
2543
|
+
declare function isClosure(value: unknown): value is Closure;
|
|
2544
|
+
/**
|
|
2545
|
+
* An environment nested in `parent`, holding the given bindings.
|
|
2546
|
+
*
|
|
2547
|
+
* Only own properties of `bindings` count as bound, so a name such as
|
|
2548
|
+
* `toString` resolves through to the parent rather than to JavaScript's own.
|
|
2549
|
+
*/
|
|
2550
|
+
declare function childEnv(parent: EvalEnv, bindings: Record<string, unknown>): EvalEnv;
|
|
2551
|
+
//#endregion
|
|
2552
|
+
//#region src/expr/evaluate.d.ts
|
|
2553
|
+
/**
|
|
2554
|
+
* Evaluate a kernel expression against an injected environment.
|
|
2555
|
+
*
|
|
2556
|
+
* Compilation happens once per node and is remembered, so calling this in a
|
|
2557
|
+
* loop pays for the tree only on the first pass.
|
|
2558
|
+
*
|
|
2559
|
+
* @returns The value, or a promise for it when the expression reached something
|
|
2560
|
+
* that has not arrived yet.
|
|
2561
|
+
* @throws ProblemError When the expression fails: a unit mismatch, a value that
|
|
2562
|
+
* is not callable, or a placeholder that does not parse.
|
|
2563
|
+
*/
|
|
2564
|
+
declare function evaluate(expr: Expr, env: EvalEnv): unknown;
|
|
2565
|
+
//#endregion
|
|
2566
|
+
//#region src/expr/native.types.d.ts
|
|
2567
|
+
declare const NATIVE: unique symbol;
|
|
2568
|
+
/** A callable backed by a host function rather than by Venn source. */
|
|
2569
|
+
interface NativeFn {
|
|
2570
|
+
readonly [NATIVE]: true;
|
|
2571
|
+
call(values: readonly unknown[]): unknown;
|
|
2572
|
+
}
|
|
2573
|
+
/** Whether this value is a host-backed callable. */
|
|
2574
|
+
declare function isNativeFn(value: unknown): value is NativeFn;
|
|
2575
|
+
/**
|
|
2576
|
+
* Wrap a host function so the language can call it.
|
|
2577
|
+
*
|
|
2578
|
+
* The wrapper takes the whole argument list: arity is the host function's own
|
|
2579
|
+
* business, and a plugin verb reads what it needs and ignores the rest.
|
|
2580
|
+
*/
|
|
2581
|
+
declare function nativeFn(call: (values: readonly unknown[]) => unknown): NativeFn;
|
|
2582
|
+
//#endregion
|
|
2583
|
+
//#region src/expr/invoke.d.ts
|
|
2584
|
+
/**
|
|
2585
|
+
* Call any Venn callable, a `fn` closure or a built-in method, with values.
|
|
2586
|
+
*
|
|
2587
|
+
* A callee declaring fewer parameters than it is handed ignores the rest.
|
|
2588
|
+
*
|
|
2589
|
+
* @throws ProblemError VN3013 when the value is not callable.
|
|
2590
|
+
*/
|
|
2591
|
+
declare function invoke(callee: unknown, values: readonly unknown[]): unknown;
|
|
2592
|
+
/** Whether {@link invoke} can call this, asked before committing to a call. */
|
|
2593
|
+
declare function isCallable(value: unknown): boolean;
|
|
2594
|
+
/**
|
|
2595
|
+
* Call with a single value, without building an argument list for it.
|
|
2596
|
+
*
|
|
2597
|
+
* One argument is what most calls carry, and the array holding it would live
|
|
2598
|
+
* exactly as long as the call takes to read it out again.
|
|
2599
|
+
*
|
|
2600
|
+
* @throws ProblemError VN3013 when the value is not callable.
|
|
2601
|
+
*/
|
|
2602
|
+
declare function invoke1(callee: unknown, arg: unknown): unknown;
|
|
2603
|
+
/**
|
|
2604
|
+
* Run a closure's compiled body against the given argument values.
|
|
2605
|
+
*
|
|
2606
|
+
* One allocation for the call: the frame itself. The names, the body and every
|
|
2607
|
+
* expression in it were settled when the function was compiled.
|
|
2608
|
+
*
|
|
2609
|
+
* @returns The body's result, or a promise for it when the body reached
|
|
2610
|
+
* something that has not arrived yet.
|
|
2611
|
+
*/
|
|
2612
|
+
declare function callClosure(closure: Closure, values: readonly unknown[]): unknown;
|
|
2613
|
+
//#endregion
|
|
2614
|
+
//#region src/expr/member-value.d.ts
|
|
2615
|
+
/**
|
|
2616
|
+
* One member of a value: `xs.len`, `m.user`, `target.wrap`.
|
|
2617
|
+
*
|
|
2618
|
+
* A map's own data wins; a list or a string only ever has built-in members.
|
|
2619
|
+
* Lives here rather than in the compiler because the compiler is not the only
|
|
2620
|
+
* reader: a decorator body reaches a handle's verbs by the same rule, and two
|
|
2621
|
+
* spellings of "what does `.x` mean" would drift apart.
|
|
2622
|
+
*
|
|
2623
|
+
* @returns The member's value, undefined when there is none, or a promise when
|
|
2624
|
+
* the receiver has not arrived yet.
|
|
2625
|
+
*/
|
|
2626
|
+
declare function memberValue(receiver: unknown, member: string): unknown;
|
|
2627
|
+
//#endregion
|
|
2628
|
+
//#region src/expr/namespace.d.ts
|
|
2629
|
+
/**
|
|
2630
|
+
* A plugin namespace as a value (`fmt`, `data`, `crypto`), so its verbs can be
|
|
2631
|
+
* called from any expression: `print(fmt.table(rows))`.
|
|
2632
|
+
*
|
|
2633
|
+
* Marked, because a name the user binds must still win over a namespace of the
|
|
2634
|
+
* same name, and a bare `data.faker.uuid` must still read as a call rather than
|
|
2635
|
+
* as the function itself.
|
|
2636
|
+
*/
|
|
2637
|
+
declare function namespaceValue(members: Record<string, unknown>): Record<string, unknown>;
|
|
2638
|
+
/** Whether this value is a namespace rather than an ordinary map. */
|
|
2639
|
+
declare function isNamespaceValue(value: unknown): boolean;
|
|
2640
|
+
//#endregion
|
|
2641
|
+
//#region src/units/unit.types.d.ts
|
|
2642
|
+
/**
|
|
2643
|
+
* Unit-typed values.
|
|
2644
|
+
*
|
|
2645
|
+
* Each holds a canonical base unit (milliseconds, bytes, a ratio in 0..1, epoch
|
|
2646
|
+
* milliseconds), so arithmetic never converts and only display does. The `kind`
|
|
2647
|
+
* field is the brand that keeps a unit from reading as an ordinary map.
|
|
2648
|
+
*/
|
|
2649
|
+
/** Which unit a value carries. */
|
|
2650
|
+
type UnitKind = "duration" | "size" | "percent";
|
|
2651
|
+
/** A length of time, held in milliseconds. */
|
|
2652
|
+
interface Duration {
|
|
2653
|
+
readonly kind: "duration";
|
|
2654
|
+
readonly ms: number;
|
|
2655
|
+
}
|
|
2656
|
+
/** A quantity of data, held in bytes. */
|
|
2657
|
+
interface Size {
|
|
2658
|
+
readonly kind: "size";
|
|
2659
|
+
readonly bytes: number;
|
|
2660
|
+
}
|
|
2661
|
+
/** A proportion, held as a ratio in 0..1 rather than as 0..100. */
|
|
2662
|
+
interface Percent {
|
|
2663
|
+
readonly kind: "percent";
|
|
2664
|
+
readonly ratio: number;
|
|
2665
|
+
}
|
|
2666
|
+
/** A point in time. The source ISO text is kept so printing it back is exact. */
|
|
2667
|
+
interface Instant {
|
|
2668
|
+
readonly kind: "instant";
|
|
2669
|
+
readonly epochMs: number;
|
|
2670
|
+
readonly iso: string;
|
|
2671
|
+
}
|
|
2672
|
+
/** Any value carrying a unit. */
|
|
2673
|
+
type UnitValue = Duration | Size | Percent;
|
|
2674
|
+
//#endregion
|
|
2675
|
+
//#region src/units/combine.d.ts
|
|
2676
|
+
/** Anything arithmetic accepts: a plain number, or a number carrying a unit. */
|
|
2677
|
+
type Numeric = number | UnitValue;
|
|
2678
|
+
/** Why two operands would not combine: the operator, and the kind of each side. */
|
|
2679
|
+
type UnitMismatch = {
|
|
2680
|
+
op: string;
|
|
2681
|
+
left: string;
|
|
2682
|
+
right: string;
|
|
2683
|
+
};
|
|
2684
|
+
/** The outcome of {@link combine}: the value, or the mismatch behind VN3012. */
|
|
2685
|
+
type CombineResult = {
|
|
2686
|
+
ok: true;
|
|
2687
|
+
value: Numeric | boolean;
|
|
2688
|
+
} | {
|
|
2689
|
+
ok: false;
|
|
2690
|
+
mismatch: UnitMismatch;
|
|
2691
|
+
};
|
|
2692
|
+
/**
|
|
2693
|
+
* Combine two numerics with an operator, checking that their units agree.
|
|
2694
|
+
*
|
|
2695
|
+
* `300ms + 1s` succeeds; `300ms + 2mb` reports a mismatch. Never throws: the
|
|
2696
|
+
* caller decides whether a mismatch is a problem and where to point at it.
|
|
2697
|
+
*
|
|
2698
|
+
* @returns The combined value, or the mismatch that stopped it.
|
|
2699
|
+
*/
|
|
2700
|
+
declare function combine(args: {
|
|
2701
|
+
op: string;
|
|
2702
|
+
left: Numeric;
|
|
2703
|
+
right: Numeric;
|
|
2704
|
+
}): CombineResult;
|
|
2705
|
+
//#endregion
|
|
2706
|
+
//#region src/units/parse-instant.d.ts
|
|
2707
|
+
/**
|
|
2708
|
+
* Read an ISO-8601 lexeme into an {@link Instant}, keeping the source text.
|
|
2709
|
+
*
|
|
2710
|
+
* A lexeme that does not parse takes epoch 0 rather than NaN, so comparing two
|
|
2711
|
+
* instants stays total. The grammar has already accepted the shape by here.
|
|
2712
|
+
*/
|
|
2713
|
+
declare function parseInstant(iso: string): Instant;
|
|
2714
|
+
//#endregion
|
|
2715
|
+
//#region src/units/parse-number.d.ts
|
|
2716
|
+
/**
|
|
2717
|
+
* Read a NUMBER lexeme into the value it denotes.
|
|
2718
|
+
*
|
|
2719
|
+
* Accepts digit grouping and an optional unit suffix: "200", "1_000", "300ms",
|
|
2720
|
+
* "2mb", "50%". A lexeme with no recognised suffix reads as a plain number.
|
|
2721
|
+
*
|
|
2722
|
+
* @returns A number, or the `UnitValue` the suffix asks for.
|
|
2723
|
+
*/
|
|
2724
|
+
declare function parseNumber(raw: string): number | UnitValue;
|
|
2725
|
+
//#endregion
|
|
2726
|
+
//#region src/units/unit-guards.d.ts
|
|
2727
|
+
/** Whether this value carries a unit: a duration, a size or a percent. */
|
|
2728
|
+
declare function isUnitValue(value: unknown): value is UnitValue;
|
|
2729
|
+
/** Whether this value is a point in time. */
|
|
2730
|
+
declare function isInstant(value: unknown): value is Instant;
|
|
2731
|
+
//#endregion
|
|
2732
|
+
//#region src/expr/prelude.d.ts
|
|
2733
|
+
/**
|
|
2734
|
+
* Render a value the way `print` and `str` do: a string as itself, anything
|
|
2735
|
+
* else as JSON. A value JSON cannot hold falls back to its plain text rather
|
|
2736
|
+
* than throwing, because printing must never be the thing that fails a flow.
|
|
2737
|
+
*/
|
|
2738
|
+
declare function display(value: unknown): string;
|
|
2739
|
+
/**
|
|
2740
|
+
* The name of a value's type, as the language talks about it: "null", "list",
|
|
2741
|
+
* "fn", "map", "bool", "string", "number", or a unit's own kind.
|
|
2742
|
+
*/
|
|
2743
|
+
declare function typeName(value: unknown): string;
|
|
2744
|
+
/**
|
|
2745
|
+
* The whole prelude of values: what has no receiver to hang off.
|
|
2746
|
+
*
|
|
2747
|
+
* `len(xs)`, `sum(xs)`, `keys(m)` and `round(x, 2)` are deliberately absent:
|
|
2748
|
+
* they read better as `xs.len`, `xs.sum`, `m.keys` and `x.round(2)`, and a
|
|
2749
|
+
* second spelling would only be a second way to say the same thing. Those names
|
|
2750
|
+
* are also exactly the ones a script wants to bind (`const sum = …`), and a
|
|
2751
|
+
* binding would silently shadow them.
|
|
2752
|
+
*/
|
|
2753
|
+
declare const PRELUDE_VALUES: Readonly<Record<string, unknown>>;
|
|
2754
|
+
//#endregion
|
|
2755
|
+
//#region src/expand/deco/deco-env.d.ts
|
|
2756
|
+
/**
|
|
2757
|
+
* What a decorator body can see: its own parameters, its own `let`s, and the
|
|
2758
|
+
* prelude.
|
|
2759
|
+
*
|
|
2760
|
+
* Nothing else, and deliberately so. The body runs before the program exists: no
|
|
2761
|
+
* flow has started and no plugin has been asked for anything, so a name it did
|
|
2762
|
+
* not bind itself cannot mean anything yet. The runner says exactly that instead
|
|
2763
|
+
* of quietly evaluating to nothing.
|
|
2764
|
+
*/
|
|
2765
|
+
declare class DecoEnv implements EvalEnv {
|
|
2766
|
+
private readonly bindings;
|
|
2767
|
+
constructor(bindings: Record<string, unknown>);
|
|
2768
|
+
lookup(name: string): unknown;
|
|
2769
|
+
bind(name: string, value: unknown): void;
|
|
2770
|
+
}
|
|
2771
|
+
//#endregion
|
|
2772
|
+
//#region src/expand/deco/deco.types.d.ts
|
|
2773
|
+
/**
|
|
2774
|
+
* A `deco`'s parameter list, read as what it means: the first parameter is the
|
|
2775
|
+
* thing decorated and its type is what may be decorated; the rest are the
|
|
2776
|
+
* decorator's own arguments, bound from `@name(…)`.
|
|
2777
|
+
*/
|
|
2778
|
+
interface DecoSignature {
|
|
2779
|
+
/** The name the body calls its target by. */
|
|
2780
|
+
readonly target: string;
|
|
2781
|
+
/** The kinds the declared type allows. Several when it is a union. */
|
|
2782
|
+
readonly kinds: readonly TargetKind[];
|
|
2783
|
+
/** The remaining parameter names, in the order `@name(…)` fills them. */
|
|
2784
|
+
readonly args: readonly string[];
|
|
2785
|
+
}
|
|
2786
|
+
/** A signature that reads, or the one-line reason it does not. */
|
|
2787
|
+
type SignatureResult = {
|
|
2788
|
+
readonly ok: true;
|
|
2789
|
+
readonly signature: DecoSignature;
|
|
2790
|
+
} | {
|
|
2791
|
+
readonly ok: false;
|
|
2792
|
+
readonly title: string;
|
|
2793
|
+
};
|
|
2794
|
+
/**
|
|
2795
|
+
* A `pub deco` another file exported, with the file it was written in.
|
|
2796
|
+
*
|
|
2797
|
+
* The uri travels with the declaration because a fault in it (a signature that
|
|
2798
|
+
* does not read, a verb its kind has not got) belongs to the line that wrote it,
|
|
2799
|
+
* not to the line that imported it.
|
|
2800
|
+
*/
|
|
2801
|
+
interface ImportedDeco {
|
|
2802
|
+
readonly decl: DecoDecl;
|
|
2803
|
+
readonly uri: string;
|
|
2804
|
+
}
|
|
2805
|
+
/** Everything running one decorator's body needs. */
|
|
2806
|
+
interface DecoBodyArgs {
|
|
2807
|
+
readonly body: Block;
|
|
2808
|
+
readonly env: DecoEnv;
|
|
2809
|
+
readonly uri: string;
|
|
2810
|
+
readonly reject: (problem: Problem) => void;
|
|
2811
|
+
}
|
|
2812
|
+
//#endregion
|
|
2813
|
+
//#region src/expand/expand.types.d.ts
|
|
2814
|
+
/**
|
|
2815
|
+
* A node a decorator may be attached to, as the decorator sees it.
|
|
2816
|
+
*
|
|
2817
|
+
* Deliberately structural: a decorator receives the real tree, not a copy and
|
|
2818
|
+
* not a facade, so it can read anything the grammar produced and rewrite it.
|
|
2819
|
+
* `$type` is how it knows what it is holding.
|
|
2820
|
+
*/
|
|
2821
|
+
type DecoratedNode = AstNode$1;
|
|
2822
|
+
/** What a decorator writes for the runtime to read later. */
|
|
2823
|
+
type NodeMeta = Record<string, unknown>;
|
|
2824
|
+
/**
|
|
2825
|
+
* Everything a decorator is handed when it runs.
|
|
2826
|
+
*
|
|
2827
|
+
* Expansion happens once, between parsing and everything else, so a decorator
|
|
2828
|
+
* sees the whole program before a single statement has run. What it leaves
|
|
2829
|
+
* behind is what the checker checks and the runtime runs.
|
|
2830
|
+
*/
|
|
2831
|
+
interface ExpandContext {
|
|
2832
|
+
/** The node carrying this decorator. */
|
|
2833
|
+
readonly node: DecoratedNode;
|
|
2834
|
+
/** The arguments, evaluated: `@retry(2, { backoff: 500ms })` gives `[2, {…}]`. */
|
|
2835
|
+
readonly args: readonly unknown[];
|
|
2836
|
+
/** The same arguments as syntax, for a decorator that transforms rather than reads. */
|
|
2837
|
+
readonly written: readonly DecoratedNode[];
|
|
2838
|
+
/** Where the node sits, for a decorator that needs to look around or reattach. */
|
|
2839
|
+
readonly parent: DecoratedNode | undefined;
|
|
2840
|
+
/** Put this node in place of the decorated one. */
|
|
2841
|
+
replace(node: DecoratedNode): void;
|
|
2842
|
+
/** Take the decorated node out of the tree entirely. */
|
|
2843
|
+
remove(): void;
|
|
2844
|
+
/** Leave something for the runtime, keyed by name. */
|
|
2845
|
+
meta(key: string, value: unknown): void;
|
|
2846
|
+
/** Refuse the program, in the language's own error vocabulary. */
|
|
2847
|
+
reject(args: {
|
|
2848
|
+
code: string;
|
|
2849
|
+
title: string;
|
|
2850
|
+
}): void;
|
|
2851
|
+
}
|
|
2852
|
+
/**
|
|
2853
|
+
* A decorator: a named transformation of the tree, contributed by the kernel or
|
|
2854
|
+
* by a plugin, and applied wherever a program writes `@name`.
|
|
2855
|
+
*/
|
|
2856
|
+
interface DecoratorDefinition {
|
|
2857
|
+
readonly name: string;
|
|
2858
|
+
readonly doc?: string;
|
|
2859
|
+
/**
|
|
2860
|
+
* The `$type`s this may decorate, such as `["FlowDecl", "StepDecl"]`. Omitted
|
|
2861
|
+
* means anywhere: a decorator that reads nothing about its target constrains
|
|
2862
|
+
* nothing about it.
|
|
2863
|
+
*
|
|
2864
|
+
* Node names are the plugin author's spelling, and they stay. A TypeScript
|
|
2865
|
+
* decorator is handed the raw node, so nothing shorter describes what it is
|
|
2866
|
+
* able to read.
|
|
2867
|
+
*/
|
|
2868
|
+
readonly targets?: readonly string[];
|
|
2869
|
+
/**
|
|
2870
|
+
* The kinds this decorates, as a `deco` declared them, read off the type of
|
|
2871
|
+
* its first parameter with `acceptedKinds`. Present only for a decorator the
|
|
2872
|
+
* language itself declared, and it wins over `targets`: a signature says in
|
|
2873
|
+
* the user's words what a list of node names only approximates.
|
|
2874
|
+
*/
|
|
2875
|
+
readonly accepts?: readonly TargetKind[];
|
|
2876
|
+
expand(ctx: ExpandContext): void;
|
|
2877
|
+
}
|
|
2878
|
+
/** Where expansion looks a decorator up. The kernel does not know what plugins are. */
|
|
2879
|
+
interface DecoratorSource {
|
|
2880
|
+
get(name: string): DecoratorDefinition | undefined;
|
|
2881
|
+
}
|
|
2882
|
+
/** What expansion reports. The tree itself is rewritten in place. */
|
|
2883
|
+
interface ExpandResult {
|
|
2884
|
+
problems: Problem[];
|
|
2885
|
+
}
|
|
2886
|
+
//#endregion
|
|
2887
|
+
//#region src/expand/deco/deco-decorator.d.ts
|
|
2888
|
+
/** A `deco` and everything reporting about it needs. */
|
|
2889
|
+
interface DecoArgs {
|
|
2890
|
+
decl: DecoDecl;
|
|
2891
|
+
uri: string;
|
|
2892
|
+
problems: Problem[];
|
|
2893
|
+
}
|
|
2894
|
+
/**
|
|
2895
|
+
* A `deco` written in the language, as a decorator the expansion phase applies.
|
|
2896
|
+
*
|
|
2897
|
+
* This is the very {@link DecoratorDefinition} a plugin's TypeScript
|
|
2898
|
+
* `defineDecorator` produces: one mechanism, two doors. What the signature says
|
|
2899
|
+
* it decorates becomes `accepts`, so the type error for `@memoize` on a flow
|
|
2900
|
+
* comes from how the author wrote the parameters rather than from a list kept by
|
|
2901
|
+
* hand beside them.
|
|
2902
|
+
*
|
|
2903
|
+
* @returns a definition that does nothing when the signature does not read. The
|
|
2904
|
+
* reason is pushed onto `args.problems` once, here, rather than at every use.
|
|
2905
|
+
*/
|
|
2906
|
+
declare function decoDecorator(args: DecoArgs): DecoratorDefinition;
|
|
2907
|
+
//#endregion
|
|
2908
|
+
//#region src/expand/deco/document-decos.d.ts
|
|
2909
|
+
/** Every `deco` one document can reach, and the file it is being expanded for. */
|
|
2910
|
+
interface DocumentDecoArgs {
|
|
2911
|
+
document: Document;
|
|
2912
|
+
decorators: DecoratorSource;
|
|
2913
|
+
uri: string;
|
|
2914
|
+
problems: Problem[];
|
|
2915
|
+
/** The `pub deco`s this file's imports reach, by name. */
|
|
2916
|
+
imported?: ReadonlyMap<string, ImportedDeco>;
|
|
2917
|
+
}
|
|
2918
|
+
/**
|
|
2919
|
+
* The document's own `deco`s, then the ones it imported, layered over whatever
|
|
2920
|
+
* the host contributed.
|
|
2921
|
+
*
|
|
2922
|
+
* A local declaration wins against a plugin's and against a built-in of the same
|
|
2923
|
+
* name: the more local one is what the author is looking at. All of them arrive
|
|
2924
|
+
* as ordinary members of one {@link DecoratorSource}, so `@memoize` resolves
|
|
2925
|
+
* without expansion ever asking where a decorator came from.
|
|
2926
|
+
*/
|
|
2927
|
+
declare function withDocumentDecos(args: DocumentDecoArgs): DecoratorSource;
|
|
2928
|
+
//#endregion
|
|
2929
|
+
//#region src/expand/deco/read-signature.d.ts
|
|
2930
|
+
/**
|
|
2931
|
+
* Read a `deco`'s parameters as what they mean.
|
|
2932
|
+
*
|
|
2933
|
+
* The first parameter *is* the target and its type is what may carry the
|
|
2934
|
+
* decorator; the rest are the decorator's own arguments, filled by `@name(…)` in
|
|
2935
|
+
* order. Nobody writing a decorator ever names a node of the compiler's tree,
|
|
2936
|
+
* and what it decorates follows from the signature rather than from a list kept
|
|
2937
|
+
* beside it.
|
|
2938
|
+
*
|
|
2939
|
+
* @returns the signature, or the one-line reason it does not read.
|
|
2940
|
+
*/
|
|
2941
|
+
declare function readSignature(decl: DecoDecl): SignatureResult;
|
|
2942
|
+
//#endregion
|
|
2943
|
+
//#region src/expand/deco/run-body.d.ts
|
|
2944
|
+
/**
|
|
2945
|
+
* The one sentence for a verb a decorator cannot reach.
|
|
2946
|
+
*
|
|
2947
|
+
* Exported because the static pass notices the same thing without ever running
|
|
2948
|
+
* the body, and two wordings for one fact is how they start to disagree.
|
|
2949
|
+
*/
|
|
2950
|
+
declare function impure(target: string): string;
|
|
2951
|
+
//#endregion
|
|
2952
|
+
//#region src/expand/decorate-callable.d.ts
|
|
2953
|
+
/**
|
|
2954
|
+
* The callable a decorated `fn` binds to: its own body with every `.wrap`,
|
|
2955
|
+
* `.before` and `.after` a `deco` asked for already around it.
|
|
2956
|
+
*
|
|
2957
|
+
* An untouched function is handed straight back, so nothing pays for a feature
|
|
2958
|
+
* it did not use.
|
|
2959
|
+
*/
|
|
2960
|
+
declare function decorateCallable(node: object, base: unknown): unknown;
|
|
2961
|
+
//#endregion
|
|
2962
|
+
//#region src/expand/decorations.d.ts
|
|
2963
|
+
/**
|
|
2964
|
+
* Where `.wrap`, `.before` and `.after` leave their closures.
|
|
2965
|
+
*
|
|
2966
|
+
* Prefixed, because `meta` is open to any key a decorator invents and a program
|
|
2967
|
+
* that writes `target.meta "before" x` must not be mistaken for one that wrote
|
|
2968
|
+
* `target.before(f)`.
|
|
2969
|
+
*/
|
|
2970
|
+
declare const AROUND_KEYS: {
|
|
2971
|
+
readonly wrap: "deco.wrap";
|
|
2972
|
+
readonly before: "deco.before";
|
|
2973
|
+
readonly after: "deco.after";
|
|
2974
|
+
};
|
|
2975
|
+
/** The closures a `deco` asked to run around this declaration. */
|
|
2976
|
+
interface Decorations {
|
|
2977
|
+
readonly wrap: readonly unknown[];
|
|
2978
|
+
readonly before: readonly unknown[];
|
|
2979
|
+
readonly after: readonly unknown[];
|
|
2980
|
+
}
|
|
2981
|
+
/**
|
|
2982
|
+
* What the behavioural verbs left on this node, or nothing at all.
|
|
2983
|
+
*
|
|
2984
|
+
* The language has no syntax for "around this body", so `.wrap` cannot rewrite
|
|
2985
|
+
* the tree the way `.addParam` does. It records a fact about the declaration
|
|
2986
|
+
* and the scheduler honours it.
|
|
2987
|
+
*/
|
|
2988
|
+
declare function readDecorations(node: object): Decorations | undefined;
|
|
2989
|
+
/** Append one closure to a behavioural list, keeping the order they were written. */
|
|
2990
|
+
declare function addDecoration(node: object, key: string, fn: unknown): void;
|
|
2991
|
+
//#endregion
|
|
2992
|
+
//#region src/expand/expand.d.ts
|
|
2993
|
+
/**
|
|
2994
|
+
* Run every decorator the program wrote, before anything else reads the program.
|
|
2995
|
+
*
|
|
2996
|
+
* This is the one place a `@name` means anything. The kernel does not know what
|
|
2997
|
+
* `@retry` is; it knows that a name written with an `@` is looked up, handed the
|
|
2998
|
+
* node it sits on, and allowed to rewrite it. Built-in decorators come through
|
|
2999
|
+
* here too, so there is no shorter path for them.
|
|
3000
|
+
*
|
|
3001
|
+
* Applied innermost first, so a decorator that rewrites a body finds a body its
|
|
3002
|
+
* own decorators have already finished with.
|
|
3003
|
+
*
|
|
3004
|
+
* A `deco` the document declares, or one imported from a file that wrote `pub`,
|
|
3005
|
+
* joins the same source the built-ins live in before any of them run. Nothing
|
|
3006
|
+
* below here can tell whether `@memoize` was written in TypeScript, in this
|
|
3007
|
+
* file, or in the one next to it.
|
|
3008
|
+
*
|
|
3009
|
+
* @returns the problems raised. The document itself is rewritten in place.
|
|
3010
|
+
*/
|
|
3011
|
+
declare function expand(args: {
|
|
3012
|
+
document: Document;
|
|
3013
|
+
decorators: DecoratorSource;
|
|
3014
|
+
uri?: string;
|
|
3015
|
+
/** The `pub deco`s this file's imports reach, by name. */
|
|
3016
|
+
imported?: ReadonlyMap<string, ImportedDeco>;
|
|
3017
|
+
}): ExpandResult;
|
|
3018
|
+
//#endregion
|
|
3019
|
+
//#region src/expand/node-meta.d.ts
|
|
3020
|
+
/**
|
|
3021
|
+
* What the decorators left on this node, or nothing.
|
|
3022
|
+
*
|
|
3023
|
+
* Metadata rather than a rewrite is how a decorator says something the grammar
|
|
3024
|
+
* has no word for. `@retry(2)` cannot be expressed as a tree of existing
|
|
3025
|
+
* statements, so it is expressed as a fact about one.
|
|
3026
|
+
*/
|
|
3027
|
+
declare function metaOf(node: object): NodeMeta | undefined;
|
|
3028
|
+
/** Read one key, typed by the caller who knows what it wrote. */
|
|
3029
|
+
declare function readMeta<T>(node: object, key: string): T | undefined;
|
|
3030
|
+
/** Attach a fact to a node. Non-enumerable, so it never lands in a serialised AST. */
|
|
3031
|
+
declare function writeMeta(node: object, key: string, value: unknown): void;
|
|
3032
|
+
//#endregion
|
|
3033
|
+
//#region src/expand/node-span.d.ts
|
|
3034
|
+
/** Where a node sits in its file, for a Problem that has to point at it. */
|
|
3035
|
+
declare function spanOf(node: AstNode$1, uri: string): Span;
|
|
3036
|
+
//#endregion
|
|
3037
|
+
//#region src/expand/swap-node.d.ts
|
|
3038
|
+
/**
|
|
3039
|
+
* Put `next` where `node` is, in its parent's list or in the field holding it.
|
|
3040
|
+
* Passing nothing takes the node out of the program entirely.
|
|
3041
|
+
*
|
|
3042
|
+
* The write goes straight into the parent's own array or field. That is the tree
|
|
3043
|
+
* the checker and the runtime read, not a copy of it, so a decorator's rewrite
|
|
3044
|
+
* is indistinguishable downstream from source the author wrote.
|
|
3045
|
+
*/
|
|
3046
|
+
declare function swapNode(node: AstNode$1, next: AstNode$1 | undefined): void;
|
|
3047
|
+
//#endregion
|
|
3048
|
+
//#region src/expand/wrong-kind.d.ts
|
|
3049
|
+
/** The kinds a signature allows, read as prose: "a function or a flow". */
|
|
3050
|
+
declare function kindWords(kinds: readonly TargetKind[]): string;
|
|
3051
|
+
/** Every kind, listed for an author who has to pick one. */
|
|
3052
|
+
declare function everyKindWritten(): string;
|
|
3053
|
+
/**
|
|
3054
|
+
* What a node is called for someone reading a message.
|
|
3055
|
+
*
|
|
3056
|
+
* A plugin's decorator may name any node it is able to read, so an unlisted one
|
|
3057
|
+
* has its word derived rather than printed: `FlowDecl` is the compiler talking
|
|
3058
|
+
* to itself, and a word nobody ever typed has no business on a user's screen.
|
|
3059
|
+
*/
|
|
3060
|
+
declare function nodeWord(type: string): string;
|
|
3061
|
+
/** "@memoize decorates a function, and this is a flow." */
|
|
3062
|
+
declare function wrongKindTitle(args: {
|
|
3063
|
+
name: string;
|
|
3064
|
+
kinds: readonly TargetKind[];
|
|
3065
|
+
node: AstNode$1;
|
|
3066
|
+
}): string;
|
|
3067
|
+
/**
|
|
3068
|
+
* The same sentence for a plugin's decorator, whose reach is a list of node
|
|
3069
|
+
* types. It still reads as prose: what the author wrote is what they are told
|
|
3070
|
+
* about, and the list they never wrote stays out of it.
|
|
3071
|
+
*/
|
|
3072
|
+
declare function wrongTargetTitle(args: {
|
|
3073
|
+
name: string;
|
|
3074
|
+
targets: readonly string[];
|
|
3075
|
+
node: AstNode$1;
|
|
3076
|
+
}): string;
|
|
3077
|
+
/**
|
|
3078
|
+
* Why a `@name` does not belong on this node, if it does not.
|
|
3079
|
+
*
|
|
3080
|
+
* Nothing when the signature never said which kinds it takes: that is a fault
|
|
3081
|
+
* committed once, where the `deco` is written, and repeating it at every use
|
|
3082
|
+
* site would bury the one message that can be acted on.
|
|
3083
|
+
*/
|
|
3084
|
+
declare function wrongKind(args: {
|
|
3085
|
+
name: string;
|
|
3086
|
+
kinds: readonly TargetKind[];
|
|
3087
|
+
node: AstNode$1;
|
|
3088
|
+
}): string | undefined;
|
|
3089
|
+
//#endregion
|
|
3090
|
+
//#region src/format/format.types.d.ts
|
|
3091
|
+
/** How to format a `.vn` file. Mirrors the `[format]` table of `venn.toml`. */
|
|
3092
|
+
interface FormatOptions {
|
|
3093
|
+
/** Spaces per indent level. Ignored when {@link useTabs} is on. */
|
|
3094
|
+
indentWidth: number;
|
|
3095
|
+
useTabs: boolean;
|
|
3096
|
+
/** Move every `use` above every `import`. */
|
|
3097
|
+
organizeHeader: boolean;
|
|
3098
|
+
/** Sort each header group alphabetically. */
|
|
3099
|
+
sortHeader: boolean;
|
|
3100
|
+
}
|
|
3101
|
+
/** What the formatter does when `venn.toml` says nothing. */
|
|
3102
|
+
declare const DEFAULT_FORMAT: FormatOptions;
|
|
3103
|
+
//#endregion
|
|
3104
|
+
//#region src/format/format-text.d.ts
|
|
3105
|
+
/**
|
|
3106
|
+
* Format a `.vn` source: group the header, then re-indent. Line-oriented by
|
|
3107
|
+
* design, so it never joins or splits lines. That makes it idempotent, and a
|
|
3108
|
+
* one-line block stays on one line.
|
|
3109
|
+
*/
|
|
3110
|
+
declare function formatText(source: string, options?: Partial<FormatOptions>): string;
|
|
3111
|
+
//#endregion
|
|
3112
|
+
//#region src/format/from-settings.d.ts
|
|
3113
|
+
/** The shape of the `[format]` table, loose enough for a parsed TOML record. */
|
|
3114
|
+
interface FormatTable {
|
|
3115
|
+
indent?: unknown;
|
|
3116
|
+
tabs?: unknown;
|
|
3117
|
+
organize?: unknown;
|
|
3118
|
+
sort?: unknown;
|
|
3119
|
+
}
|
|
3120
|
+
/**
|
|
3121
|
+
* Map the raw `[format]` table of `venn.toml` onto formatter options. Keys the
|
|
3122
|
+
* project did not set are dropped, so the defaults survive the merge.
|
|
3123
|
+
*/
|
|
3124
|
+
declare function formatOptionsFrom(settings: FormatTable | undefined): Partial<FormatOptions>;
|
|
3125
|
+
//#endregion
|
|
3126
|
+
//#region src/format/organize-header.d.ts
|
|
3127
|
+
/**
|
|
3128
|
+
* Put every `use` above every `import`. A comment sitting directly on top of a
|
|
3129
|
+
* line travels with it; a comment separated by a blank line is left where the
|
|
3130
|
+
* header begins, so nothing is silently re-attached to the wrong statement.
|
|
3131
|
+
*/
|
|
3132
|
+
declare function organizeHeader(lines: readonly string[], sort: boolean): string[];
|
|
3133
|
+
//#endregion
|
|
3134
|
+
//#region src/format/reindent.d.ts
|
|
3135
|
+
/**
|
|
3136
|
+
* Re-indent by bracket depth. Venn statements are newline terminated, so this
|
|
3137
|
+
* only ever rewrites the leading whitespace of a line. It never joins or splits
|
|
3138
|
+
* lines, which makes it idempotent by construction.
|
|
3139
|
+
*
|
|
3140
|
+
* @param unit The string for one indent level, either spaces or a tab.
|
|
3141
|
+
*/
|
|
3142
|
+
declare function reindent(lines: readonly string[], unit: string): string[];
|
|
3143
|
+
//#endregion
|
|
3144
|
+
//#region src/generated/module.d.ts
|
|
3145
|
+
declare const VennLanguageMetaData: {
|
|
3146
|
+
readonly languageId: 'venn';
|
|
3147
|
+
readonly fileExtensions: readonly [".vn"];
|
|
3148
|
+
readonly caseInsensitive: false;
|
|
3149
|
+
readonly mode: 'development';
|
|
3150
|
+
};
|
|
3151
|
+
declare const VennGeneratedSharedModule: Module<LangiumSharedCoreServices, LangiumGeneratedSharedCoreServices>;
|
|
3152
|
+
declare const VennGeneratedModule: Module<LangiumCoreServices, LangiumGeneratedCoreServices>;
|
|
3153
|
+
//#endregion
|
|
3154
|
+
//#region src/graph/graph.types.d.ts
|
|
3155
|
+
/** A node in the visual graph derived from the AST (§22). */
|
|
3156
|
+
interface GraphNode {
|
|
3157
|
+
id: string;
|
|
3158
|
+
kind: string;
|
|
3159
|
+
label: string;
|
|
3160
|
+
parent?: string;
|
|
3161
|
+
}
|
|
3162
|
+
/** A directed edge between two graph nodes (sequential flow or branch). */
|
|
3163
|
+
interface GraphEdge {
|
|
3164
|
+
from: string;
|
|
3165
|
+
to: string;
|
|
3166
|
+
label?: string;
|
|
3167
|
+
}
|
|
3168
|
+
/** The graph the editor renders: nodes plus edges, derived purely from the AST. */
|
|
3169
|
+
interface Graph {
|
|
3170
|
+
nodes: GraphNode[];
|
|
3171
|
+
edges: GraphEdge[];
|
|
3172
|
+
}
|
|
3173
|
+
//#endregion
|
|
3174
|
+
//#region src/graph/to-graph.d.ts
|
|
3175
|
+
/** Derive the node graph (§22) from a parsed document — a pure AST transform. */
|
|
3176
|
+
declare function toGraph(doc: Document): Graph;
|
|
3177
|
+
//#endregion
|
|
3178
|
+
//#region src/interpolation/template.types.d.ts
|
|
3179
|
+
/** One `${…}`, resolved from text to something the evaluator can just run. */
|
|
3180
|
+
interface TemplateHole {
|
|
3181
|
+
/** The placeholder's source, kept for the error when it does not parse. */
|
|
3182
|
+
readonly source: string;
|
|
3183
|
+
/** The parsed expression, or undefined when the source is not one. */
|
|
3184
|
+
readonly expr: Expr | undefined;
|
|
3185
|
+
}
|
|
3186
|
+
/**
|
|
3187
|
+
* A string literal split once into the text around its placeholders and what
|
|
3188
|
+
* fills them. `chunks` has exactly one more entry than `holes`: `chunks[i]`
|
|
3189
|
+
* comes before `holes[i]`, and the last chunk is the tail.
|
|
3190
|
+
*/
|
|
3191
|
+
interface Template {
|
|
3192
|
+
readonly chunks: readonly string[];
|
|
3193
|
+
readonly holes: readonly TemplateHole[];
|
|
3194
|
+
}
|
|
3195
|
+
//#endregion
|
|
3196
|
+
//#region src/interpolation/compile-template.d.ts
|
|
3197
|
+
/**
|
|
3198
|
+
* Split a string literal into the constant text around its placeholders and the
|
|
3199
|
+
* parsed expression filling each one.
|
|
3200
|
+
*
|
|
3201
|
+
* @param text The literal's value, placeholders included.
|
|
3202
|
+
* @returns The template, memoised: the same text always yields the same object.
|
|
3203
|
+
*/
|
|
3204
|
+
declare function compileTemplate(text: string): Template;
|
|
3205
|
+
//#endregion
|
|
3206
|
+
//#region src/interpolation/interpolation.types.d.ts
|
|
3207
|
+
/**
|
|
3208
|
+
* One `${…}` placeholder found inside a string, located precisely enough to
|
|
3209
|
+
* highlight, hover and jump to what is written inside it.
|
|
3210
|
+
*
|
|
3211
|
+
* Offsets are relative to the text handed to the scanner, so the runtime can
|
|
3212
|
+
* scan the cooked value while the language server scans the raw source token.
|
|
3213
|
+
* One description of what `${…}` means, serving both.
|
|
3214
|
+
*/
|
|
3215
|
+
interface InterpolationSlot {
|
|
3216
|
+
/** Offset of the opening `${`. */
|
|
3217
|
+
start: number;
|
|
3218
|
+
/** Offset just past the closing `}`. */
|
|
3219
|
+
end: number;
|
|
3220
|
+
/** The expression source between the braces, trimmed. */
|
|
3221
|
+
source: string;
|
|
3222
|
+
/** Offset of {@link source} itself, past `${` and any leading blanks. */
|
|
3223
|
+
sourceStart: number;
|
|
3224
|
+
}
|
|
3225
|
+
//#endregion
|
|
3226
|
+
//#region src/interpolation/scan-interpolations.d.ts
|
|
3227
|
+
/**
|
|
3228
|
+
* Find every `${…}` placeholder in a string.
|
|
3229
|
+
*
|
|
3230
|
+
* The single description of where interpolation starts and stops: the evaluator
|
|
3231
|
+
* substitutes what this returns, and the language server colours, hovers and
|
|
3232
|
+
* resolves the very same spans. An unclosed `${` ends the scan, so the text
|
|
3233
|
+
* after it is ordinary characters.
|
|
3234
|
+
*
|
|
3235
|
+
* @returns The slots, in the order they appear.
|
|
3236
|
+
*/
|
|
3237
|
+
declare function scanInterpolations(text: string): InterpolationSlot[];
|
|
3238
|
+
//#endregion
|
|
3239
|
+
//#region src/lang/default-services.d.ts
|
|
3240
|
+
/**
|
|
3241
|
+
* The Langium core services that `parse()` uses, built once on first call.
|
|
3242
|
+
* Constructing the Chevrotain parser is the expensive part of a first parse,
|
|
3243
|
+
* so it must not happen per document.
|
|
3244
|
+
*/
|
|
3245
|
+
declare function vennServices(): LangiumCoreServices;
|
|
3246
|
+
//#endregion
|
|
3247
|
+
//#region src/lang/venn-lexer.d.ts
|
|
3248
|
+
/**
|
|
3249
|
+
* Makes `NL` (a newline or `;`) significant between statements, but suppresses
|
|
3250
|
+
* it inside `( )` and `[ ]` so calls, arg lists and list literals may still
|
|
3251
|
+
* span multiple physical lines. Blocks and maps (`{ }`) keep their newlines.
|
|
3252
|
+
*/
|
|
3253
|
+
declare class VennLexer extends DefaultLexer {
|
|
3254
|
+
tokenize(text: string, options?: TokenizeOptions): LexerResult;
|
|
3255
|
+
}
|
|
3256
|
+
//#endregion
|
|
3257
|
+
//#region src/lang/venn-module.d.ts
|
|
3258
|
+
/**
|
|
3259
|
+
* Build the Langium core services on `EmptyFileSystem`, so no `node:*` is
|
|
3260
|
+
* touched and this runs in both the CLI (Node) and the LSP (Web Worker).
|
|
3261
|
+
*
|
|
3262
|
+
* `production` skips Chevrotain's grammar validation, which dominates the cost
|
|
3263
|
+
* of a first parse and only ever checks generated code against itself. That
|
|
3264
|
+
* check belongs in a test, `venn-module.test.ts`, which is why this takes a
|
|
3265
|
+
* mode at all.
|
|
3266
|
+
*
|
|
3267
|
+
* @param mode Langium language mode; `development` re-enables the validation.
|
|
3268
|
+
*/
|
|
3269
|
+
declare function createVennServices(mode?: LanguageMetaData["mode"]): LangiumCoreServices;
|
|
3270
|
+
//#endregion
|
|
3271
|
+
//#region src/module/specifier.d.ts
|
|
3272
|
+
/** What a specifier written in an `import` names. */
|
|
3273
|
+
type SpecifierKind = "relative" | "alias" | "package";
|
|
3274
|
+
/**
|
|
3275
|
+
* Which of the three a specifier is.
|
|
3276
|
+
*
|
|
3277
|
+
* The rule is Node's, so there is no `npm:` prefix and nothing new to learn:
|
|
3278
|
+
* `./util.vn` is a file beside this one, `#shared/auth.vn` goes through
|
|
3279
|
+
* `[paths]`, and a bare `zod` is an installed package. The shape of what is
|
|
3280
|
+
* written already says which it is.
|
|
3281
|
+
*/
|
|
3282
|
+
declare function specifierKind(spec: string): SpecifierKind;
|
|
3283
|
+
/** Whether the specifier names an installed package rather than a file. */
|
|
3284
|
+
declare function isPackageSpecifier(spec: string): boolean;
|
|
3285
|
+
//#endregion
|
|
3286
|
+
//#region src/parse/parse-output.types.d.ts
|
|
3287
|
+
/** The result of {@link parse}: a (possibly partial) AST plus VN1xxx problems. */
|
|
3288
|
+
interface ParseOutput {
|
|
3289
|
+
ast: Document;
|
|
3290
|
+
problems: Problem[];
|
|
3291
|
+
}
|
|
3292
|
+
//#endregion
|
|
3293
|
+
//#region src/parse/parse.d.ts
|
|
3294
|
+
/**
|
|
3295
|
+
* Parse `.vn` source into an AST plus VN1xxx problems. Synchronous and
|
|
3296
|
+
* filesystem-free (Chevrotain error recovery keeps a partial AST on failure).
|
|
3297
|
+
* It never throws: bad syntax comes back in `problems`.
|
|
3298
|
+
*
|
|
3299
|
+
* @param options.uri Source URI recorded on every span, for editors and reports.
|
|
3300
|
+
*/
|
|
3301
|
+
declare function parse(text: string, options?: {
|
|
3302
|
+
uri?: string;
|
|
3303
|
+
}): ParseOutput;
|
|
3304
|
+
//#endregion
|
|
3305
|
+
//#region src/parse/parse-expression.d.ts
|
|
3306
|
+
/**
|
|
3307
|
+
* How far {@link parseExpression} shifts CST offsets. Exported because the
|
|
3308
|
+
* editor maps the parsed expression back onto the `${…}` it came from, and a
|
|
3309
|
+
* hand-counted constant there would rot the moment this wrapper changes.
|
|
3310
|
+
*/
|
|
3311
|
+
declare const EXPRESSION_OFFSET: number;
|
|
3312
|
+
/**
|
|
3313
|
+
* Parse a standalone expression by wrapping it in a minimal flow and extracting
|
|
3314
|
+
* the `expect` subject. Used by string interpolation (`${…}`).
|
|
3315
|
+
*
|
|
3316
|
+
* @returns The expression, or `undefined` when the source does not parse.
|
|
3317
|
+
*/
|
|
3318
|
+
declare function parseExpression(source: string): Expr | undefined;
|
|
3319
|
+
//#endregion
|
|
3320
|
+
//#region src/typecheck/builtin-types.d.ts
|
|
3321
|
+
/** What a built-in type is, and how it reads when written. */
|
|
3322
|
+
interface BuiltinType {
|
|
3323
|
+
/** One line, in the reader's terms rather than the compiler's. */
|
|
3324
|
+
doc: string;
|
|
3325
|
+
/** How it is written where a type goes. */
|
|
3326
|
+
example: string;
|
|
3327
|
+
}
|
|
3328
|
+
/**
|
|
3329
|
+
* The types the language brings with it, described once.
|
|
3330
|
+
*
|
|
3331
|
+
* These are the words a reader meets first, so the hover and the completion list
|
|
3332
|
+
* read from here. A built-in that cannot explain itself is a built-in nobody
|
|
3333
|
+
* discovers.
|
|
3334
|
+
*/
|
|
3335
|
+
declare const BUILTIN_TYPES: Readonly<Record<string, BuiltinType>>;
|
|
3336
|
+
/** Whether a name is one of the language's own types. */
|
|
3337
|
+
declare function isBuiltinType(name: string): boolean;
|
|
3338
|
+
//#endregion
|
|
3339
|
+
//#region src/typecheck/type.types.d.ts
|
|
3340
|
+
/**
|
|
3341
|
+
* A static type. `dynamic` is the escape hatch for the result of a plugin
|
|
3342
|
+
* action, an HTTP response, `json`: anything the checker cannot know. It unifies
|
|
3343
|
+
* with everything and never produces an error, so the effectful world places no
|
|
3344
|
+
* annotation burden on the pure one.
|
|
3345
|
+
*/
|
|
3346
|
+
type Type = PrimType | LiteralType | ListType | RecordType | FnType | UnionType | OpaqueType | DynamicType | TypeVar;
|
|
3347
|
+
type PrimName = "number" | "string" | "bool" | "null" | "void" | "duration" | "size" | "percent" | "instant";
|
|
3348
|
+
interface PrimType {
|
|
3349
|
+
readonly kind: "prim";
|
|
3350
|
+
readonly name: PrimName;
|
|
3351
|
+
}
|
|
3352
|
+
/** One value, standing for itself: `"GET"`, `200`, `true`. */
|
|
3353
|
+
interface LiteralType {
|
|
3354
|
+
readonly kind: "literal";
|
|
3355
|
+
readonly value: string | number | boolean;
|
|
3356
|
+
}
|
|
3357
|
+
interface ListType {
|
|
3358
|
+
readonly kind: "list";
|
|
3359
|
+
readonly element: Type;
|
|
3360
|
+
}
|
|
3361
|
+
/** One of several. What makes `"GET" | "POST"` more than a string. */
|
|
3362
|
+
interface UnionType {
|
|
3363
|
+
readonly kind: "union";
|
|
3364
|
+
readonly members: readonly Type[];
|
|
3365
|
+
}
|
|
3366
|
+
/**
|
|
3367
|
+
* A handle with a name and no visible inside: a server, a browser, a connection.
|
|
3368
|
+
*
|
|
3369
|
+
* This is the border with the world outside. Whatever a JavaScript class really
|
|
3370
|
+
* is, it arrives here as a name its own namespace's verbs understand and nothing
|
|
3371
|
+
* else can open, which keeps the object graph of another language out of this
|
|
3372
|
+
* one.
|
|
3373
|
+
*/
|
|
3374
|
+
interface OpaqueType {
|
|
3375
|
+
readonly kind: "opaque";
|
|
3376
|
+
readonly name: string;
|
|
3377
|
+
/** What it publishes. Absent means a name and nothing more. */
|
|
3378
|
+
readonly members?: ReadonlyMap<string, Type>;
|
|
3379
|
+
}
|
|
3380
|
+
/** A map/object with known fields. `open` records tolerate extra fields. */
|
|
3381
|
+
interface RecordType {
|
|
3382
|
+
readonly kind: "record";
|
|
3383
|
+
readonly fields: ReadonlyMap<string, Type>;
|
|
3384
|
+
readonly open: boolean;
|
|
3385
|
+
/**
|
|
3386
|
+
* What a key nobody listed holds: `Record<string, string>` written as a type.
|
|
3387
|
+
* Without it an open record answers `dynamic` for everything it did not name,
|
|
3388
|
+
* which is right for a loose map and wrong for `headers`.
|
|
3389
|
+
*/
|
|
3390
|
+
readonly rest?: Type;
|
|
3391
|
+
}
|
|
3392
|
+
/** A function: what it takes, what it gives back, and how strictly it is called. */
|
|
3393
|
+
interface FnType {
|
|
3394
|
+
readonly kind: "fn";
|
|
3395
|
+
readonly params: readonly Type[];
|
|
3396
|
+
readonly result: Type;
|
|
3397
|
+
/** Takes any number of arguments, as `str(a, b, c)` and `range(1, 4)` do. Its
|
|
3398
|
+
* params describe the shape it accepts, not a count to enforce. */
|
|
3399
|
+
readonly variadic?: boolean;
|
|
3400
|
+
/** Params from this index on are handed over but may be ignored: `map` offers
|
|
3401
|
+
* the index to a callback that is free to take only the item. */
|
|
3402
|
+
readonly ignorableFrom?: number;
|
|
3403
|
+
}
|
|
3404
|
+
interface DynamicType {
|
|
3405
|
+
readonly kind: "dynamic";
|
|
3406
|
+
}
|
|
3407
|
+
/** A unification variable. `ref` is filled in as inference solves it. */
|
|
3408
|
+
interface TypeVar {
|
|
3409
|
+
readonly kind: "var";
|
|
3410
|
+
readonly id: number;
|
|
3411
|
+
ref: Type | undefined;
|
|
3412
|
+
}
|
|
3413
|
+
/** The one `dynamic`. Shared, since it carries no state to keep apart. */
|
|
3414
|
+
declare const DYNAMIC: DynamicType;
|
|
3415
|
+
/** One value standing for itself, as `"GET"` does where a type is written. */
|
|
3416
|
+
declare function literal(value: string | number | boolean): LiteralType;
|
|
3417
|
+
/** A named handle, with the surface it publishes, or a bare name without one. */
|
|
3418
|
+
declare function opaque(name: string, members?: ReadonlyMap<string, Type>): OpaqueType;
|
|
3419
|
+
/** A union of one is that one: `string | string` helps nobody read anything. */
|
|
3420
|
+
declare function union(members: readonly Type[]): Type;
|
|
3421
|
+
//#endregion
|
|
3422
|
+
//#region src/typecheck/context.d.ts
|
|
3423
|
+
/**
|
|
3424
|
+
* Per-run inference state: a fresh-variable source and the list of type
|
|
3425
|
+
* mismatches found. Held in a context (not a module global) so two checks never
|
|
3426
|
+
* share variable ids or leak diagnostics into each other.
|
|
3427
|
+
*/
|
|
3428
|
+
interface TypeContext {
|
|
3429
|
+
fresh(): TypeVar;
|
|
3430
|
+
mismatches: TypeMismatch[];
|
|
3431
|
+
}
|
|
3432
|
+
/** One place where two types could not be made equal, at a source node. */
|
|
3433
|
+
interface TypeMismatch {
|
|
3434
|
+
node: AstNode$1;
|
|
3435
|
+
expected: Type;
|
|
3436
|
+
actual: Type;
|
|
3437
|
+
note?: string;
|
|
3438
|
+
/** A unit clash rather than a plain type clash: VN3012 instead of VN3010. */
|
|
3439
|
+
unit?: boolean;
|
|
3440
|
+
}
|
|
3441
|
+
/** A fresh inference context: variable ids from zero, no mismatches recorded. */
|
|
3442
|
+
declare function createContext(): TypeContext;
|
|
3443
|
+
//#endregion
|
|
3444
|
+
//#region src/typecheck/builtins.d.ts
|
|
3445
|
+
/**
|
|
3446
|
+
* The type of a built-in member: a property such as `length`, or a generic
|
|
3447
|
+
* method such as `map`.
|
|
3448
|
+
*
|
|
3449
|
+
* These are where generics earn their keep. `list<T>.map` is
|
|
3450
|
+
* `fn(fn(T, number) -> U) -> list<U>`, with a fresh `U` per use.
|
|
3451
|
+
*
|
|
3452
|
+
* @returns undefined when the receiver's type has no such member, so the caller
|
|
3453
|
+
* can fall back to a record field or to `dynamic`.
|
|
3454
|
+
*/
|
|
3455
|
+
declare function memberType(receiver: Type, name: string, ctx: TypeContext): Type | undefined;
|
|
3456
|
+
/**
|
|
3457
|
+
* A member as the language reads it: the built-in when there is one, otherwise
|
|
3458
|
+
* the field the map carries.
|
|
3459
|
+
*
|
|
3460
|
+
* {@link memberType} alone stops at built-ins so inference can report an unknown
|
|
3461
|
+
* field. Tooling wants the answer, not the distinction.
|
|
3462
|
+
*/
|
|
3463
|
+
declare function resolveMember(receiver: Type, name: string, ctx: TypeContext): Type | undefined;
|
|
3464
|
+
//#endregion
|
|
3465
|
+
//#region src/typecheck/catalog.types.d.ts
|
|
3466
|
+
/**
|
|
3467
|
+
* What the checker knows that the file itself does not: the types the loaded
|
|
3468
|
+
* plugins contribute.
|
|
3469
|
+
*
|
|
3470
|
+
* The core has no idea what a plugin is, and must not: it asks this interface
|
|
3471
|
+
* two questions and takes the answers. Whoever owns the registry, the runtime or
|
|
3472
|
+
* the language server, is the one that can answer them.
|
|
3473
|
+
*/
|
|
3474
|
+
interface TypeCatalog {
|
|
3475
|
+
/** A named type: `http.Request`. Undefined when nothing declares it. */
|
|
3476
|
+
typeOf(name: string): Type | undefined;
|
|
3477
|
+
/** A verb's signature: `http.serve`, `http.on`. */
|
|
3478
|
+
signatureOf(target: string): FnType | undefined;
|
|
3479
|
+
}
|
|
3480
|
+
//#endregion
|
|
3481
|
+
//#region src/typecheck/check-types.d.ts
|
|
3482
|
+
/** What one check of a document produced. */
|
|
3483
|
+
interface CheckTypesResult {
|
|
3484
|
+
problems: Problem[];
|
|
3485
|
+
/** Every expression's inferred type, keyed by node, for hover. */
|
|
3486
|
+
types: Map<object, Type>;
|
|
3487
|
+
/** Per string literal, the expression parsed from each of its ${…} slots. */
|
|
3488
|
+
slots: Map<object, (Expr | undefined)[]>;
|
|
3489
|
+
}
|
|
3490
|
+
/** What the checker may be told about the world outside the file. */
|
|
3491
|
+
interface CheckTypesOptions {
|
|
3492
|
+
uri?: string;
|
|
3493
|
+
/** The types and signatures the loaded plugins contribute. */
|
|
3494
|
+
catalog?: TypeCatalog;
|
|
3495
|
+
/** The `pub deco`s this file's imports reach. Without them an imported
|
|
3496
|
+
* `@name` is a name the checker knows nothing about, and says nothing about. */
|
|
3497
|
+
decos?: ReadonlyMap<string, ImportedDeco>;
|
|
3498
|
+
/** What the names this file imports turned out to be, from the files it names. */
|
|
3499
|
+
imports?: ReadonlyMap<string, Type>;
|
|
3500
|
+
}
|
|
3501
|
+
/**
|
|
3502
|
+
* Infer and check the types across a document.
|
|
3503
|
+
*
|
|
3504
|
+
* Errors are raised only where a type is actually known. Anything touching
|
|
3505
|
+
* `dynamic`, such as a plugin that published no signature or an HTTP response,
|
|
3506
|
+
* is left alone, so the checker helps without ever blocking.
|
|
3507
|
+
*
|
|
3508
|
+
* @returns the problems found, plus the inferred type of every expression and
|
|
3509
|
+
* the expressions parsed out of each `${…}`, both of which the editor reads.
|
|
3510
|
+
*/
|
|
3511
|
+
declare function checkTypes(document: Document, options?: CheckTypesOptions): CheckTypesResult;
|
|
3512
|
+
//#endregion
|
|
3513
|
+
//#region src/typecheck/imported-types.d.ts
|
|
3514
|
+
/** What the names a file imported turned out to be, ready to bind in its env. */
|
|
3515
|
+
type ImportedTypes = ReadonlyMap<string, Type>;
|
|
3516
|
+
interface ImportedTypesArgs {
|
|
3517
|
+
document: Document;
|
|
3518
|
+
uri: string;
|
|
3519
|
+
/** Every module the import graph reached, already parsed, by resolved URI. */
|
|
3520
|
+
modules: ReadonlyMap<string, Document>;
|
|
3521
|
+
/** How a specifier written in one file names another. */
|
|
3522
|
+
resolve: (from: string, spec: string) => string;
|
|
3523
|
+
catalog?: TypeCatalog;
|
|
3524
|
+
/**
|
|
3525
|
+
* What each installed package publishes, derived from its `.d.ts`.
|
|
3526
|
+
*
|
|
3527
|
+
* Keyed by the specifier as written, because that is what the import says.
|
|
3528
|
+
* Absent for a host that has not derived any, which is every run in an editor
|
|
3529
|
+
* that has not installed anything yet.
|
|
3530
|
+
*/
|
|
3531
|
+
packages?: ReadonlyMap<string, Record<string, TypeSpec>>;
|
|
3532
|
+
}
|
|
3533
|
+
/**
|
|
3534
|
+
* The types of the names a document imports, worked out from the files it names.
|
|
3535
|
+
*
|
|
3536
|
+
* Each module is checked on its own, with *its* imports resolved first, so a
|
|
3537
|
+
* `pub fn` that calls another file has the signature it really has. That is what
|
|
3538
|
+
* lets `triplo("texto")` be refused against a `fn(number) -> number` declared
|
|
3539
|
+
* one file away.
|
|
3540
|
+
*
|
|
3541
|
+
* @returns a type per imported name. A name whose module publishes nothing for
|
|
3542
|
+
* it is simply absent, and the checker treats it as `dynamic`.
|
|
3543
|
+
*/
|
|
3544
|
+
declare function importedTypes(args: ImportedTypesArgs): ImportedTypes;
|
|
3545
|
+
//#endregion
|
|
3546
|
+
//#region src/typecheck/kind-types.d.ts
|
|
3547
|
+
/**
|
|
3548
|
+
* The kinds, published as types.
|
|
3549
|
+
*
|
|
3550
|
+
* Written as data, the same data `http.Request` is written as, so the checker,
|
|
3551
|
+
* the hover and the completion list read one description of what a target
|
|
3552
|
+
* offers. This is the static twin of the verb tables in
|
|
3553
|
+
* `expand/handles/make-handle.ts`: whatever a kind has there it has here, and
|
|
3554
|
+
* `kind-types.test.ts` fails the day they stop agreeing.
|
|
3555
|
+
*/
|
|
3556
|
+
declare const KIND_SPECS: Readonly<Record<TargetKind, TypeSpec>>;
|
|
3557
|
+
/**
|
|
3558
|
+
* The same kinds as the checker's own types, built once.
|
|
3559
|
+
*
|
|
3560
|
+
* Safe to share across files and across edits: a handle's surface is fixed, so
|
|
3561
|
+
* none of these holds an inference variable for a later document to write into.
|
|
3562
|
+
*/
|
|
3563
|
+
declare const KIND_TYPES: ReadonlyMap<string, Type>;
|
|
3564
|
+
//#endregion
|
|
3565
|
+
//#region src/typecheck/member-docs.d.ts
|
|
3566
|
+
/** What a built-in member does, and how it reads. */
|
|
3567
|
+
interface MemberDoc {
|
|
3568
|
+
doc: string;
|
|
3569
|
+
example?: string;
|
|
3570
|
+
}
|
|
3571
|
+
/** Documentation for every built-in member, by the kind of value it hangs off. */
|
|
3572
|
+
declare const MEMBER_DOCS: Readonly<Record<string, Record<string, MemberDoc>>>;
|
|
3573
|
+
/** Which table of members a type answers to, if any. */
|
|
3574
|
+
declare function memberKind(type: Type): string | undefined;
|
|
3575
|
+
//#endregion
|
|
3576
|
+
//#region src/typecheck/prelude-types.d.ts
|
|
3577
|
+
/** One argument of a prelude verb, named so the editor can point at it. */
|
|
3578
|
+
interface PreludeArg {
|
|
3579
|
+
name: string;
|
|
3580
|
+
type: string;
|
|
3581
|
+
doc?: string;
|
|
3582
|
+
optional?: boolean;
|
|
3583
|
+
}
|
|
3584
|
+
/** What the editor needs to describe a prelude name: its type, and what it is for. */
|
|
3585
|
+
interface PreludeSpec {
|
|
3586
|
+
/** How it reads when written out. Shown as the hover's signature. */
|
|
3587
|
+
signature: string;
|
|
3588
|
+
doc: string;
|
|
3589
|
+
example?: string;
|
|
3590
|
+
type: Type;
|
|
3591
|
+
/**
|
|
3592
|
+
* The arguments, one by one. `signature` above is a whole line meant to be
|
|
3593
|
+
* read; these are meant to be pointed at, one at a time, as each is typed.
|
|
3594
|
+
*/
|
|
3595
|
+
args?: readonly PreludeArg[];
|
|
3596
|
+
}
|
|
3597
|
+
/**
|
|
3598
|
+
* The prelude, described once: the checker reads the types, the editor reads
|
|
3599
|
+
* the prose. Two tables would drift; this one cannot.
|
|
3600
|
+
*/
|
|
3601
|
+
declare const PRELUDE_SPECS: Readonly<Record<string, PreludeSpec>>;
|
|
3602
|
+
/** Whether a bare name is part of the prelude: no `use` needed, always in scope. */
|
|
3603
|
+
declare function isPrelude(name: string): boolean;
|
|
3604
|
+
//#endregion
|
|
3605
|
+
//#region src/typecheck/show.d.ts
|
|
3606
|
+
/** Render one type for a hover or a diagnostic, naming variables `a`, `b`, … */
|
|
3607
|
+
declare function showType(type: Type): string;
|
|
3608
|
+
/**
|
|
3609
|
+
* Several types that belong together, named as one.
|
|
3610
|
+
*
|
|
3611
|
+
* Rendering them one at a time restarts the alphabet each time, so the two
|
|
3612
|
+
* unrelated parameters of `fn (nome, idade)` would both come back as `a`. That
|
|
3613
|
+
* says they are the same type, which is the opposite of what is known.
|
|
3614
|
+
*/
|
|
3615
|
+
declare function showTypes(types: readonly Type[]): string[];
|
|
3616
|
+
//#endregion
|
|
3617
|
+
//#region src/typecheck/spec-to-type.d.ts
|
|
3618
|
+
/** How a `ref` finds what it points at. Returning undefined is fine: the
|
|
3619
|
+
* reference degrades to `dynamic` rather than failing. */
|
|
3620
|
+
type ResolveRef = (name: string) => Type | undefined;
|
|
3621
|
+
/**
|
|
3622
|
+
* Read the published form of a type into the checker's own.
|
|
3623
|
+
*
|
|
3624
|
+
* The wire format is plain data with no inference variables; the checker's type
|
|
3625
|
+
* is a live thing that unification writes into. Keeping them apart is what lets
|
|
3626
|
+
* a signature be written by hand, generated from a `.d.ts`, or shipped as JSON
|
|
3627
|
+
* without any of them reaching into the compiler.
|
|
3628
|
+
*/
|
|
3629
|
+
declare function specToType(spec: TypeSpec, resolve: ResolveRef): Type;
|
|
3630
|
+
//#endregion
|
|
3631
|
+
//#region src/typecheck/unify.d.ts
|
|
3632
|
+
/** Follow solved variables to the type they stand for. */
|
|
3633
|
+
declare function prune(type: Type): Type;
|
|
3634
|
+
//#endregion
|
|
3635
|
+
//#region src/value/equals.d.ts
|
|
3636
|
+
/** Strict equality with no coercion: "99.00" (string) never equals 99 (number). */
|
|
3637
|
+
declare function strictEquals(left: unknown, right: unknown): boolean;
|
|
3638
|
+
//#endregion
|
|
3639
|
+
//#region src/value/is-numeric.d.ts
|
|
3640
|
+
/** True for plain numbers and unit values (duration/size/percent). */
|
|
3641
|
+
declare function isNumeric(value: unknown): value is Numeric;
|
|
3642
|
+
//#endregion
|
|
3643
|
+
//#region src/value/truthiness.d.ts
|
|
3644
|
+
/** Boolean coercion for `!`, `&&`, `||`, and `if` conditions. */
|
|
3645
|
+
declare function truthy(value: unknown): boolean;
|
|
3646
|
+
//#endregion
|
|
3647
|
+
//#region src/value/value.types.d.ts
|
|
3648
|
+
/** A runtime value in the language: primitives, unit values, lists, and maps. */
|
|
3649
|
+
type Value = null | boolean | number | string | UnitValue | Instant | readonly Value[] | {
|
|
3650
|
+
readonly [key: string]: Value;
|
|
3651
|
+
};
|
|
3652
|
+
//#endregion
|
|
3653
|
+
export { AROUND_KEYS, ActionCall, Annotation, Arg, ArgList, type AstNode, BUILTIN_TYPES, Binary, Block, BoolLit, BreakStmt, type BuiltinType, CODES, Call, CaptureStmt, type Cell, type CellEnv, type CheckTypesOptions, type CheckTypesResult, type Closure, type CodeSpec, type CombineResult, type CompiledBody, ConfigDecl, ContinueStmt, DEFAULT_FORMAT, DYNAMIC, DatasetDecl, Declaration, type DecoBodyArgs, DecoDecl, type DecoSignature, type DecoratedNode, type Decorations, type DecoratorDefinition, type DecoratorSource, type Diff, type DiffEntry, Document, type DocumentDecoArgs, type Duration, EXPRESSION_OFFSET, ElseBranch, type Envelope, type EvalEnv, type EventData, type EventKind, type ExpandContext, type ExpandResult, ExpectStmt, Expr, FactoryDecl, FieldDecl, FlowDecl, FnBody, FnDecl, FnExpr, type FnType, ForEachStmt, type FormatOptions, type FormatTable, FragmentDecl, type Graph, type GraphEdge, type GraphNode, GroupDecl, type HandleSurface, IfStmt, ImportDecl, type ImportedDeco, type ImportedTypes, Index, type Instant, InstantLit, type InterpolationSlot, KIND_SPECS, KIND_TYPES, LetStmt, LifecycleDecl, ListLit, LiteralType, MEMBER_DOCS, MapEntry, MapKey, MapLit, MatcherClause, MatrixDecl, Member, type MemberDoc, NamedType, type NativeFn, type NodeMeta, type NodePath, NullLit, NumberLit, type Numeric, type OpaqueType, PRELUDE_SPECS, PRELUDE_VALUES, ParallelStmt, Param, ParamList, type ParseOutput, type Percent, type PlannedFlow, type PlannedStep, type PreludeArg, type PreludeSpec, type Problem, ProblemError, QualifiedName, RaceStmt, type RecordType, Ref, RefName, type RelatedInfo, RepeatStmt, ReportDecl, type ResolveRef, ReturnStmt, type RunId, type RunPlan, RunStmt, type Severity, type SignatureResult, SingleType, type Size, type Span, type SpecifierKind, type SplitCall, Statement, type Status, StepDecl, StringLit, TARGET_KINDS, type TargetHandle, type TargetKind, type Template, type TemplateHole, Ternary, type Thunk, TryStmt, type Type, TypeBody, type TypeCatalog, TypeDecl, TypeRef, Unary, type UnionType, type UnitKind, type UnitMismatch, type UnitValue, UseDecl, type Value, ValueImport, VennAstReflection, VennAstType, VennGeneratedModule, VennGeneratedSharedModule, VennKeywordNames, VennLanguageMetaData, VennLexer, VennTerminalNames, VennTerminals, VennTokenNames, WhileStmt, Word, acceptedKinds, addDecoration, buildDiff, buildProblem, callArgs, callClosure, checkTypes, childEnv, closureOfDecl, combine, compileExpr, compileTemplate, createContext, createVennServices, impure as decoCannotCall, decoDecorator, decoTarget, decorateCallable, display, dottedPath, evaluate, everyKindWritten, expand, formatOptionsFrom, formatText, formatValue, handleSurface, hasCells, importedTypes, invoke, invoke1, isActionCall, isAnnotation, isArg, isArgList, isBinary, isBlock, isBoolLit, isBreakStmt, isBuiltinType, isCall, isCallable, isCaptureStmt, isClosure, isConfigDecl, isContinueStmt, isDatasetDecl, isDeclaration, isDecoDecl, isDocument, isElseBranch, isExpectStmt, isExpr, isFactoryDecl, isFieldDecl, isFlowDecl, isFnBody, isFnDecl, isFnExpr, isForEachStmt, isFragmentDecl, isGroupDecl, isIfStmt, isImportDecl, isIndex, isInstant, isInstantLit, isLetStmt, isLifecycleDecl, isListLit, isLiteralType, isMapEntry, isMapKey, isMapLit, isMatcherClause, isMatrixDecl, isMember, isNamedType, isNamespaceValue, isNativeFn, isNullLit, isNumberLit, isNumeric, isPackageSpecifier, isParallelStmt, isParam, isParamList, isPrelude, isQualifiedName, isRaceStmt, isRef, isRefName, isRepeatStmt, isReportDecl, isReturnStmt, isRunStmt, isRunnable, isSingleType, isStatement, isStepDecl, isStringLit, isTargetKind, isTernary, isTryStmt, isTypeBody, isTypeDecl, isTypeRef, isUnary, isUnitValue, isUseDecl, isValueImport, isWhileStmt, isWord, kindOf, kindWords, literal, makeHandle, memberKind, memberType, memberValue, metaOf, namespaceValue, nativeFn, nodeWord, opaque, organizeHeader, parse, parseExpression, parseInstant, parseNumber, prune, readDecorations, readMeta, readSignature, reflection, reindent, resolveMember, scanInterpolations, showType, showTypes, spanOf, specToType, specifierKind, splitCall, strictEquals, swapNode, toGraph, truthy, typeName, union, vennServices, walkAst, withDocumentDecos, writeMeta, wrongKind, wrongKindTitle, wrongTargetTitle };
|
|
3654
|
+
//# sourceMappingURL=index.d.ts.map
|