@dancrumb/cant-shared 0.0.0-stage → 0.10.1
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/dist/ast.d.ts +579 -0
- package/dist/ast.d.ts.map +1 -0
- package/dist/ast.js +2 -0
- package/dist/ast.js.map +1 -0
- package/dist/compiled.d.ts +376 -0
- package/dist/compiled.d.ts.map +1 -0
- package/dist/compiled.js +3 -0
- package/dist/compiled.js.map +1 -0
- package/dist/evaluate.d.ts +48 -0
- package/dist/evaluate.d.ts.map +1 -0
- package/dist/evaluate.js +224 -0
- package/dist/evaluate.js.map +1 -0
- package/dist/generated/parser.d.ts +12 -0
- package/dist/generated/parser.d.ts.map +1 -0
- package/dist/generated/parser.js +11517 -0
- package/dist/generated/parser.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/parse.d.ts +30 -0
- package/dist/parse.d.ts.map +1 -0
- package/dist/parse.js +11 -0
- package/dist/parse.js.map +1 -0
- package/dist/tokenize.d.ts +26 -0
- package/dist/tokenize.d.ts.map +1 -0
- package/dist/tokenize.js +311 -0
- package/dist/tokenize.js.map +1 -0
- package/dist/values.d.ts +83 -0
- package/dist/values.d.ts.map +1 -0
- package/dist/values.js +119 -0
- package/dist/values.js.map +1 -0
- package/package.json +41 -3
- package/README.md +0 -3
package/dist/ast.d.ts
ADDED
|
@@ -0,0 +1,579 @@
|
|
|
1
|
+
import type { Literal, Node, Parent, Position } from 'unist';
|
|
2
|
+
/**
|
|
3
|
+
* The syntax tree for Cant source. Every node is a unist node with a `position`.
|
|
4
|
+
*
|
|
5
|
+
* Nodes that contain statements keep them in `children`; other sub-nodes are held in named
|
|
6
|
+
* fields, so `unist-util-visit` and friends only walk the statement structure.
|
|
7
|
+
*
|
|
8
|
+
* The tree records what the source says, not whether it makes sense: type checking, name
|
|
9
|
+
* resolution and the other compile-time rules in docs/adr are left to later passes.
|
|
10
|
+
*/
|
|
11
|
+
export interface Identifier extends Literal {
|
|
12
|
+
type: 'identifier';
|
|
13
|
+
position: Position;
|
|
14
|
+
value: string;
|
|
15
|
+
}
|
|
16
|
+
/** `nameSpace::symbolName`: a symbol in a named namespace (docs/adr/0005-module-namespaces.md). */
|
|
17
|
+
export interface QualifiedIdentifier extends Node {
|
|
18
|
+
type: 'qualifiedIdentifier';
|
|
19
|
+
position: Position;
|
|
20
|
+
namespace: Identifier;
|
|
21
|
+
name: Identifier;
|
|
22
|
+
}
|
|
23
|
+
/** A name that may be in another namespace, such as a type, an action or an error. */
|
|
24
|
+
export type Name = Identifier | QualifiedIdentifier;
|
|
25
|
+
/** `@subject`, `@all`: a built-in value (docs/adr/0009-triggers.md). `name` is without the `@`. */
|
|
26
|
+
export interface BuiltIn extends Node {
|
|
27
|
+
type: 'builtIn';
|
|
28
|
+
position: Position;
|
|
29
|
+
name: string;
|
|
30
|
+
}
|
|
31
|
+
/** Literal text in a string, with its escape sequences already decoded. */
|
|
32
|
+
export interface Text extends Literal {
|
|
33
|
+
type: 'text';
|
|
34
|
+
position: Position;
|
|
35
|
+
value: string;
|
|
36
|
+
}
|
|
37
|
+
/** `${expression}` inside a string. */
|
|
38
|
+
export interface Interpolation extends Node {
|
|
39
|
+
type: 'interpolation';
|
|
40
|
+
position: Position;
|
|
41
|
+
expression: Expression;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* `"Hello, ${name}!"`. Every string is a template: its parts are runs of text and
|
|
45
|
+
* interpolations, in order. Adjacent text is always merged into one `text` part, so a string
|
|
46
|
+
* with no interpolations has at most one part.
|
|
47
|
+
*/
|
|
48
|
+
export interface StringLiteral extends Node {
|
|
49
|
+
type: 'string';
|
|
50
|
+
position: Position;
|
|
51
|
+
parts: (Text | Interpolation)[];
|
|
52
|
+
}
|
|
53
|
+
/** `42`, `0xFF`, `1_000.5e3`. A number literal is never negative: `-1` is a unary `-`. */
|
|
54
|
+
export interface NumberLiteral extends Literal {
|
|
55
|
+
type: 'number';
|
|
56
|
+
position: Position;
|
|
57
|
+
value: number;
|
|
58
|
+
}
|
|
59
|
+
/** `true` or `false`. */
|
|
60
|
+
export interface BooleanLiteral extends Literal {
|
|
61
|
+
type: 'boolean';
|
|
62
|
+
position: Position;
|
|
63
|
+
value: boolean;
|
|
64
|
+
}
|
|
65
|
+
/** A literal whose value is known at compile time, as in an enum (docs/adr/0013-enums.md). */
|
|
66
|
+
/**
|
|
67
|
+
* `DATE_TIME("2026-11-21T09:30:00Z")` (docs/adr/0026-dates-and-times.md). `value` is the ISO 8601
|
|
68
|
+
* string as written, which the parser has checked names a real instant.
|
|
69
|
+
*/
|
|
70
|
+
export interface DateTimeLiteral extends Literal {
|
|
71
|
+
type: 'dateTime';
|
|
72
|
+
position: Position;
|
|
73
|
+
value: string;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* `DURATION("PT1H30M")` (docs/adr/0026-dates-and-times.md). `value` is the ISO 8601 string as
|
|
77
|
+
* written, in days, hours, minutes and seconds.
|
|
78
|
+
*/
|
|
79
|
+
export interface DurationLiteral extends Literal {
|
|
80
|
+
type: 'duration';
|
|
81
|
+
position: Position;
|
|
82
|
+
value: string;
|
|
83
|
+
}
|
|
84
|
+
export type ConstantValue = StringLiteral | NumberLiteral | BooleanLiteral | DateTimeLiteral | DurationLiteral;
|
|
85
|
+
/** `NOTHING`, which can only be written in a `return` (docs/adr/0012-base-types.md). */
|
|
86
|
+
export interface Nothing extends Node {
|
|
87
|
+
type: 'nothing';
|
|
88
|
+
position: Position;
|
|
89
|
+
}
|
|
90
|
+
/** `TEXT`, `NUMBER`, `BOOLEAN`, `DATE_TIME` or `FILE` (docs/adr/0012-base-types.md). */
|
|
91
|
+
export interface BaseType extends Node {
|
|
92
|
+
type: 'baseType';
|
|
93
|
+
position: Position;
|
|
94
|
+
name: 'TEXT' | 'NUMBER' | 'BOOLEAN' | 'DATE_TIME' | 'DURATION' | 'FILE';
|
|
95
|
+
}
|
|
96
|
+
/** `VOID`, which can only be a return type (docs/adr/0012-base-types.md). */
|
|
97
|
+
export interface VoidType extends Node {
|
|
98
|
+
type: 'voidType';
|
|
99
|
+
position: Position;
|
|
100
|
+
}
|
|
101
|
+
/** `UNKNOWN` (docs/adr/0033-unknown-type.md). */
|
|
102
|
+
export interface UnknownType extends Node {
|
|
103
|
+
type: 'unknownType';
|
|
104
|
+
position: Position;
|
|
105
|
+
}
|
|
106
|
+
/** `enum("draft", "published")`: an inline enum (docs/adr/0013-enums.md). */
|
|
107
|
+
export interface EnumType extends Node {
|
|
108
|
+
type: 'enum';
|
|
109
|
+
position: Position;
|
|
110
|
+
values: ConstantValue[];
|
|
111
|
+
}
|
|
112
|
+
/** `[T]` (docs/adr/0021-collections.md). */
|
|
113
|
+
export interface ArrayType extends Node {
|
|
114
|
+
type: 'arrayType';
|
|
115
|
+
position: Position;
|
|
116
|
+
elementType: TypeRef;
|
|
117
|
+
}
|
|
118
|
+
/** `{T}` (docs/adr/0021-collections.md). */
|
|
119
|
+
export interface MapType extends Node {
|
|
120
|
+
type: 'mapType';
|
|
121
|
+
position: Position;
|
|
122
|
+
valueType: TypeRef;
|
|
123
|
+
}
|
|
124
|
+
/** `SET(T)` (docs/adr/0021-collections.md). */
|
|
125
|
+
export interface SetType extends Node {
|
|
126
|
+
type: 'setType';
|
|
127
|
+
position: Position;
|
|
128
|
+
elementType: TypeRef;
|
|
129
|
+
}
|
|
130
|
+
/** A type: a base type, `UNKNOWN`, an inline enum, a collection type, or a named type. */
|
|
131
|
+
export type TypeRef = BaseType | UnknownType | EnumType | ArrayType | MapType | SetType | Name;
|
|
132
|
+
/** `ERROR`, the type of every error, on the right of `instanceOf` (docs/adr/0023-error-handling.md). */
|
|
133
|
+
export interface ErrorType extends Node {
|
|
134
|
+
type: 'errorType';
|
|
135
|
+
position: Position;
|
|
136
|
+
}
|
|
137
|
+
/** `name := value` or `value` in a call (docs/adr/0020-action-parameters.md). */
|
|
138
|
+
export interface Argument extends Node {
|
|
139
|
+
type: 'argument';
|
|
140
|
+
position: Position;
|
|
141
|
+
/** Missing for an unnamed argument, including the matching-identifier form `f(name)`. */
|
|
142
|
+
name?: Identifier;
|
|
143
|
+
value: Expression;
|
|
144
|
+
}
|
|
145
|
+
/** `value.name`. The name can be a keyword, as in `request.body`. */
|
|
146
|
+
export interface MemberExpression extends Node {
|
|
147
|
+
type: 'member';
|
|
148
|
+
position: Position;
|
|
149
|
+
object: Expression;
|
|
150
|
+
property: Identifier;
|
|
151
|
+
}
|
|
152
|
+
/** `value[index]` (docs/adr/0021-collections.md). */
|
|
153
|
+
export interface IndexExpression extends Node {
|
|
154
|
+
type: 'index';
|
|
155
|
+
position: Position;
|
|
156
|
+
object: Expression;
|
|
157
|
+
index: Expression;
|
|
158
|
+
}
|
|
159
|
+
export interface CallExpression extends Node {
|
|
160
|
+
type: 'call';
|
|
161
|
+
position: Position;
|
|
162
|
+
callee: Expression;
|
|
163
|
+
arguments: Argument[];
|
|
164
|
+
}
|
|
165
|
+
export type UnaryOperator = '!' | '-' | 'isEmpty' | 'ignore';
|
|
166
|
+
/** `!a`, `-a`, `isEmpty a`, `ignore a`. */
|
|
167
|
+
export interface UnaryExpression extends Node {
|
|
168
|
+
type: 'unary';
|
|
169
|
+
position: Position;
|
|
170
|
+
operator: UnaryOperator;
|
|
171
|
+
argument: Expression;
|
|
172
|
+
}
|
|
173
|
+
export type BinaryOperator = 'orElse' | '**' | '*' | '/' | '%' | '+' | '-' | '==' | '!=' | '<' | '<=' | '>' | '>=' | 'in' | 'and' | 'or';
|
|
174
|
+
export interface BinaryExpression extends Node {
|
|
175
|
+
type: 'binary';
|
|
176
|
+
position: Position;
|
|
177
|
+
operator: BinaryOperator;
|
|
178
|
+
left: Expression;
|
|
179
|
+
right: Expression;
|
|
180
|
+
}
|
|
181
|
+
/** `value instanceOf T`, `value instanceOf T?` or `value instanceOf ERROR`. */
|
|
182
|
+
export interface InstanceOfExpression extends Node {
|
|
183
|
+
type: 'instanceOf';
|
|
184
|
+
position: Position;
|
|
185
|
+
value: Expression;
|
|
186
|
+
target: TypeRef | ErrorType;
|
|
187
|
+
/** Whether the type is followed by `?`. */
|
|
188
|
+
optional: boolean;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* `@subject can "permission"`, optionally `within group`, where the group is an expression
|
|
192
|
+
* (docs/adr/0010-security.md).
|
|
193
|
+
*/
|
|
194
|
+
export interface CanPredicate extends Node {
|
|
195
|
+
type: 'canPredicate';
|
|
196
|
+
position: Position;
|
|
197
|
+
subject: BuiltIn;
|
|
198
|
+
permission: StringLiteral;
|
|
199
|
+
group?: Expression;
|
|
200
|
+
}
|
|
201
|
+
/** `@subject is User` or `@subject is @anonymous` (docs/adr/0010-security.md). */
|
|
202
|
+
export interface IsPredicate extends Node {
|
|
203
|
+
type: 'isPredicate';
|
|
204
|
+
position: Position;
|
|
205
|
+
subject: BuiltIn;
|
|
206
|
+
subjectType: Identifier | BuiltIn;
|
|
207
|
+
}
|
|
208
|
+
/** `@subject is admin within org`, where the group is an expression (docs/adr/0010-security.md). */
|
|
209
|
+
export interface RolePredicate extends Node {
|
|
210
|
+
type: 'rolePredicate';
|
|
211
|
+
position: Position;
|
|
212
|
+
subject: BuiltIn;
|
|
213
|
+
role: Identifier;
|
|
214
|
+
group: Expression;
|
|
215
|
+
}
|
|
216
|
+
/** `[a, b, c]` (docs/adr/0021-collections.md). */
|
|
217
|
+
export interface ArrayValue extends Node {
|
|
218
|
+
type: 'array';
|
|
219
|
+
position: Position;
|
|
220
|
+
elements: Expression[];
|
|
221
|
+
}
|
|
222
|
+
/** `name := value` in an object value. */
|
|
223
|
+
export interface ObjectItem extends Node {
|
|
224
|
+
type: 'objectItem';
|
|
225
|
+
position: Position;
|
|
226
|
+
/**
|
|
227
|
+
* An identifier, which can be a keyword, a string for names that are not identifiers, or a
|
|
228
|
+
* built-in name, such as `@entity` in a test case's `subject` (docs/adr/0037-test-case-trigger-source.md).
|
|
229
|
+
*/
|
|
230
|
+
name: Identifier | StringLiteral | BuiltIn;
|
|
231
|
+
value: Expression;
|
|
232
|
+
}
|
|
233
|
+
/** `{ name := value, ... }`: an anonymous model (docs/adr/0027-object-shapes.md). */
|
|
234
|
+
export interface ObjectValue extends Node {
|
|
235
|
+
type: 'object';
|
|
236
|
+
position: Position;
|
|
237
|
+
items: ObjectItem[];
|
|
238
|
+
}
|
|
239
|
+
/** `SET(a, b)` (docs/adr/0021-collections.md). */
|
|
240
|
+
export interface SetValue extends Node {
|
|
241
|
+
type: 'set';
|
|
242
|
+
position: Position;
|
|
243
|
+
elements: Expression[];
|
|
244
|
+
}
|
|
245
|
+
export type Expression = Identifier | QualifiedIdentifier | BuiltIn | StringLiteral | NumberLiteral | BooleanLiteral | DateTimeLiteral | DurationLiteral | ArrayValue | ObjectValue | SetValue | MemberExpression | IndexExpression | CallExpression | UnaryExpression | BinaryExpression | InstanceOfExpression | CanPredicate | IsPredicate | RolePredicate;
|
|
246
|
+
export interface ExpressionStatement extends Node {
|
|
247
|
+
type: 'expressionStatement';
|
|
248
|
+
position: Position;
|
|
249
|
+
expression: Expression;
|
|
250
|
+
}
|
|
251
|
+
/** `target := value`. The target is an identifier, or ends in a member or an index. */
|
|
252
|
+
export interface AssignmentStatement extends Node {
|
|
253
|
+
type: 'assignment';
|
|
254
|
+
position: Position;
|
|
255
|
+
target: Identifier | MemberExpression | IndexExpression;
|
|
256
|
+
value: Expression;
|
|
257
|
+
}
|
|
258
|
+
/** `delete target`, where the target ends in a member or an index. */
|
|
259
|
+
export interface DeleteStatement extends Node {
|
|
260
|
+
type: 'delete';
|
|
261
|
+
position: Position;
|
|
262
|
+
target: MemberExpression | IndexExpression;
|
|
263
|
+
}
|
|
264
|
+
/** `ignore` before an assignment or a `delete`. */
|
|
265
|
+
export interface IgnoredStatement extends Node {
|
|
266
|
+
type: 'ignoredStatement';
|
|
267
|
+
position: Position;
|
|
268
|
+
statement: AssignmentStatement | DeleteStatement;
|
|
269
|
+
}
|
|
270
|
+
/** `return`, `return value` or `return NOTHING`. */
|
|
271
|
+
export interface ReturnStatement extends Node {
|
|
272
|
+
type: 'return';
|
|
273
|
+
position: Position;
|
|
274
|
+
argument?: Expression | Nothing;
|
|
275
|
+
}
|
|
276
|
+
/** `raise Error`, `raise Error(field := value)` or `raise Error with value`. */
|
|
277
|
+
export interface RaiseStatement extends Node {
|
|
278
|
+
type: 'raise';
|
|
279
|
+
position: Position;
|
|
280
|
+
error: Name;
|
|
281
|
+
/** The `data` model's fields, when they are given in parentheses. */
|
|
282
|
+
arguments?: Argument[];
|
|
283
|
+
/** The whole `data`, when it is given with `with`. */
|
|
284
|
+
data?: Expression;
|
|
285
|
+
}
|
|
286
|
+
/** `pass value` */
|
|
287
|
+
export interface PassStatement extends Node {
|
|
288
|
+
type: 'pass';
|
|
289
|
+
position: Position;
|
|
290
|
+
argument: Expression;
|
|
291
|
+
}
|
|
292
|
+
/** `assert condition` or `assert condition, message` */
|
|
293
|
+
export interface AssertStatement extends Node {
|
|
294
|
+
type: 'assert';
|
|
295
|
+
position: Position;
|
|
296
|
+
test: Expression;
|
|
297
|
+
message?: Expression;
|
|
298
|
+
}
|
|
299
|
+
export interface BreakStatement extends Node {
|
|
300
|
+
type: 'break';
|
|
301
|
+
position: Position;
|
|
302
|
+
}
|
|
303
|
+
export interface ContinueStatement extends Node {
|
|
304
|
+
type: 'continue';
|
|
305
|
+
position: Position;
|
|
306
|
+
}
|
|
307
|
+
/** `for item in items` followed by a block, which is held in `children`. */
|
|
308
|
+
export interface ForStatement extends Parent {
|
|
309
|
+
type: 'for';
|
|
310
|
+
position: Position;
|
|
311
|
+
variable: Identifier;
|
|
312
|
+
iterable: Expression;
|
|
313
|
+
children: Statement[];
|
|
314
|
+
}
|
|
315
|
+
/** `while test` followed by a block, which is held in `children`. */
|
|
316
|
+
export interface WhileStatement extends Parent {
|
|
317
|
+
type: 'while';
|
|
318
|
+
position: Position;
|
|
319
|
+
test: Expression;
|
|
320
|
+
children: Statement[];
|
|
321
|
+
}
|
|
322
|
+
/** The statements of one branch of an `if`. */
|
|
323
|
+
export interface Block extends Parent {
|
|
324
|
+
type: 'block';
|
|
325
|
+
position: Position;
|
|
326
|
+
children: Statement[];
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* `if test` followed by a block, and optionally `else` with a block or another `if`.
|
|
330
|
+
* `children` holds the consequent block, then the alternate if there is one.
|
|
331
|
+
*/
|
|
332
|
+
export interface IfStatement extends Parent {
|
|
333
|
+
type: 'if';
|
|
334
|
+
position: Position;
|
|
335
|
+
test: Expression;
|
|
336
|
+
children: [Block] | [Block, Block | IfStatement];
|
|
337
|
+
}
|
|
338
|
+
export type Statement = ExpressionStatement | AssignmentStatement | DeleteStatement | IgnoredStatement | ReturnStatement | RaiseStatement | PassStatement | AssertStatement | BreakStatement | ContinueStatement | ForStatement | WhileStatement | IfStatement;
|
|
339
|
+
/**
|
|
340
|
+
* A symbolic module identifier, `[<scope>::]<name>`. A missing scope means `cant`; the parser
|
|
341
|
+
* leaves it out rather than filling it in.
|
|
342
|
+
*/
|
|
343
|
+
export interface ModuleName extends Node {
|
|
344
|
+
type: 'moduleName';
|
|
345
|
+
position: Position;
|
|
346
|
+
scope?: Identifier;
|
|
347
|
+
name: Identifier;
|
|
348
|
+
}
|
|
349
|
+
/** `import IO`, `import "./lib.cant" into lib`, `import "./config.json" as "json"` */
|
|
350
|
+
export interface ImportDeclaration extends Node {
|
|
351
|
+
type: 'import';
|
|
352
|
+
position: Position;
|
|
353
|
+
/**
|
|
354
|
+
* A symbolic identifier, or a string holding a URL relative to the importing module. The
|
|
355
|
+
* string never contains interpolations.
|
|
356
|
+
*/
|
|
357
|
+
module: ModuleName | StringLiteral;
|
|
358
|
+
/** The namespace from `into`; without it, symbols go into the current namespace. */
|
|
359
|
+
namespace?: Identifier;
|
|
360
|
+
/** The module type from `as`; without it, the module is Cant source. */
|
|
361
|
+
moduleType?: StringLiteral;
|
|
362
|
+
}
|
|
363
|
+
/**
|
|
364
|
+
* `export accounts::FindUser`: a symbol the module imports, exported under its own name, or
|
|
365
|
+
* under `alias` with `as LookupUser`.
|
|
366
|
+
*/
|
|
367
|
+
export interface ReExport extends Node {
|
|
368
|
+
type: 'reExport';
|
|
369
|
+
position: Position;
|
|
370
|
+
name: Identifier | QualifiedIdentifier;
|
|
371
|
+
alias?: Identifier;
|
|
372
|
+
}
|
|
373
|
+
/** `namespace Greetings` */
|
|
374
|
+
export interface NamespaceDeclaration extends Node {
|
|
375
|
+
type: 'namespace';
|
|
376
|
+
position: Position;
|
|
377
|
+
name: Identifier;
|
|
378
|
+
}
|
|
379
|
+
/** `name?: Type := default` in an action's signature. */
|
|
380
|
+
export interface Parameter extends Node {
|
|
381
|
+
type: 'parameter';
|
|
382
|
+
position: Position;
|
|
383
|
+
name: Identifier;
|
|
384
|
+
/** Whether the name is followed by `?`. */
|
|
385
|
+
optional: boolean;
|
|
386
|
+
valueType: TypeRef;
|
|
387
|
+
defaultValue?: Expression;
|
|
388
|
+
}
|
|
389
|
+
/**
|
|
390
|
+
* An action, `action Name(parameters): ReturnType? raises A passes B` with an indented `body`
|
|
391
|
+
* block, whose statements are held in `children`, or a `native` line naming the module that
|
|
392
|
+
* implements it (docs/adr/0036-native-modules.md), in which case `children` is empty.
|
|
393
|
+
*/
|
|
394
|
+
export interface ActionDeclaration extends Parent {
|
|
395
|
+
type: 'action';
|
|
396
|
+
position: Position;
|
|
397
|
+
/** Whether the declaration starts with `export` (docs/adr/0006-imports.md). */
|
|
398
|
+
exported?: true;
|
|
399
|
+
name: Identifier;
|
|
400
|
+
parameters: Parameter[];
|
|
401
|
+
returnType: TypeRef | VoidType;
|
|
402
|
+
/** Whether the return type is followed by `?`, so the action may return `NOTHING`. */
|
|
403
|
+
optional: boolean;
|
|
404
|
+
/** The errors in the `raises` clause (docs/adr/0023-error-handling.md). */
|
|
405
|
+
raises: Name[];
|
|
406
|
+
/** The errors in the `passes` clause, which can include `@all`. */
|
|
407
|
+
passes: (Name | BuiltIn)[];
|
|
408
|
+
/** The module named by a `native` line, for an action implemented in TypeScript. */
|
|
409
|
+
native?: StringLiteral;
|
|
410
|
+
children: Statement[];
|
|
411
|
+
}
|
|
412
|
+
/** `name := value` in a trigger's `arguments` or `parameters` block. */
|
|
413
|
+
export interface NamedValue extends Node {
|
|
414
|
+
type: 'namedValue';
|
|
415
|
+
position: Position;
|
|
416
|
+
name: Identifier;
|
|
417
|
+
value: Expression;
|
|
418
|
+
}
|
|
419
|
+
/** `condition, message` in a test case's `assertions` block (docs/adr/0037-test-case-trigger-source.md). */
|
|
420
|
+
export interface Assertion extends Node {
|
|
421
|
+
type: 'assertion';
|
|
422
|
+
position: Position;
|
|
423
|
+
test: Expression;
|
|
424
|
+
message: Expression;
|
|
425
|
+
}
|
|
426
|
+
/**
|
|
427
|
+
* `trigger SayHello on Start`, with optional `auth`, `arguments`, `parameters` and
|
|
428
|
+
* `assertions` blocks.
|
|
429
|
+
*/
|
|
430
|
+
export interface TriggerDeclaration extends Node {
|
|
431
|
+
type: 'trigger';
|
|
432
|
+
position: Position;
|
|
433
|
+
action: Name;
|
|
434
|
+
source: Identifier;
|
|
435
|
+
/** The rule in the `auth` block. */
|
|
436
|
+
auth?: Expression;
|
|
437
|
+
arguments?: NamedValue[];
|
|
438
|
+
parameters?: NamedValue[];
|
|
439
|
+
assertions?: Assertion[];
|
|
440
|
+
}
|
|
441
|
+
/** `permissions group` or `permissions group has role`, with a block of permissions. */
|
|
442
|
+
export interface PermissionsDeclaration extends Node {
|
|
443
|
+
type: 'permissions';
|
|
444
|
+
position: Position;
|
|
445
|
+
group: Identifier;
|
|
446
|
+
role?: Identifier;
|
|
447
|
+
permissions: StringLiteral[];
|
|
448
|
+
}
|
|
449
|
+
/** How many of an end's entity each entity at the other end is related to. */
|
|
450
|
+
export type Cardinality = '1' | '0..1' | '0..*' | '1..*';
|
|
451
|
+
/** One end of a relation: `User[tasks]` and the cardinality written beside it. */
|
|
452
|
+
export interface RelationEnd {
|
|
453
|
+
entity: Name;
|
|
454
|
+
/** The navigation field the relation adds to `entity`, reaching the other end. */
|
|
455
|
+
field: Identifier;
|
|
456
|
+
cardinality: Cardinality;
|
|
457
|
+
}
|
|
458
|
+
/** `relation User[tasks] 1 --- 0..* Task[owner]` */
|
|
459
|
+
export interface RelationDeclaration extends Node {
|
|
460
|
+
type: 'relation';
|
|
461
|
+
position: Position;
|
|
462
|
+
left: RelationEnd;
|
|
463
|
+
right: RelationEnd;
|
|
464
|
+
}
|
|
465
|
+
/** `Name` or `Name := value` in an enum declaration. */
|
|
466
|
+
export interface EnumMember extends Node {
|
|
467
|
+
type: 'enumMember';
|
|
468
|
+
position: Position;
|
|
469
|
+
name: Identifier;
|
|
470
|
+
value?: ConstantValue;
|
|
471
|
+
}
|
|
472
|
+
export interface EnumDeclaration extends Node {
|
|
473
|
+
type: 'enumDeclaration';
|
|
474
|
+
position: Position;
|
|
475
|
+
exported?: true;
|
|
476
|
+
name: Identifier;
|
|
477
|
+
members: EnumMember[];
|
|
478
|
+
}
|
|
479
|
+
/** `name?: Type := default` in a model, or in an error's anonymous `data`. */
|
|
480
|
+
export interface Field extends Node {
|
|
481
|
+
type: 'field';
|
|
482
|
+
position: Position;
|
|
483
|
+
name: Identifier;
|
|
484
|
+
optional: boolean;
|
|
485
|
+
valueType: TypeRef;
|
|
486
|
+
defaultValue?: Expression;
|
|
487
|
+
}
|
|
488
|
+
export interface ModelDeclaration extends Node {
|
|
489
|
+
type: 'model';
|
|
490
|
+
position: Position;
|
|
491
|
+
exported?: true;
|
|
492
|
+
name: Identifier;
|
|
493
|
+
fields: Field[];
|
|
494
|
+
}
|
|
495
|
+
export interface SubjectLine extends Node {
|
|
496
|
+
type: 'subjectLine';
|
|
497
|
+
position: Position;
|
|
498
|
+
}
|
|
499
|
+
export interface IdentityLine extends Node {
|
|
500
|
+
type: 'identityLine';
|
|
501
|
+
position: Position;
|
|
502
|
+
fields: Identifier[];
|
|
503
|
+
}
|
|
504
|
+
export interface GroupLine extends Node {
|
|
505
|
+
type: 'groupLine';
|
|
506
|
+
position: Position;
|
|
507
|
+
name: Identifier;
|
|
508
|
+
}
|
|
509
|
+
export interface RoleLine extends Node {
|
|
510
|
+
type: 'roleLine';
|
|
511
|
+
position: Position;
|
|
512
|
+
name: Identifier;
|
|
513
|
+
}
|
|
514
|
+
/** `membership member in group with roles` (docs/adr/0032-authentication.md). */
|
|
515
|
+
export interface MembershipLine extends Node {
|
|
516
|
+
type: 'membershipLine';
|
|
517
|
+
position: Position;
|
|
518
|
+
/** The navigation field that reaches the member, a subject entity. */
|
|
519
|
+
member: Identifier;
|
|
520
|
+
/** The navigation field that reaches the group, a group entity. */
|
|
521
|
+
group: Identifier;
|
|
522
|
+
/** The field that holds the member's roles, after `with`. */
|
|
523
|
+
roles?: Identifier;
|
|
524
|
+
}
|
|
525
|
+
export interface ModelsBlock extends Node {
|
|
526
|
+
type: 'modelsBlock';
|
|
527
|
+
position: Position;
|
|
528
|
+
models: Name[];
|
|
529
|
+
}
|
|
530
|
+
/** `field` or `field as name` in an `expose` block. */
|
|
531
|
+
export interface ExposedField extends Node {
|
|
532
|
+
type: 'exposedField';
|
|
533
|
+
position: Position;
|
|
534
|
+
field: Identifier;
|
|
535
|
+
as?: Identifier;
|
|
536
|
+
}
|
|
537
|
+
export interface ExposeBlock extends Node {
|
|
538
|
+
type: 'exposeBlock';
|
|
539
|
+
position: Position;
|
|
540
|
+
items: (ExposedField | BuiltIn)[];
|
|
541
|
+
}
|
|
542
|
+
export interface HideBlock extends Node {
|
|
543
|
+
type: 'hideBlock';
|
|
544
|
+
position: Position;
|
|
545
|
+
items: (Identifier | BuiltIn)[];
|
|
546
|
+
}
|
|
547
|
+
export type EntityLine = SubjectLine | IdentityLine | GroupLine | RoleLine | MembershipLine | ModelsBlock | ExposeBlock | HideBlock;
|
|
548
|
+
/** An entity, whose lines are held in source order in `lines`. */
|
|
549
|
+
export interface EntityDeclaration extends Node {
|
|
550
|
+
type: 'entity';
|
|
551
|
+
position: Position;
|
|
552
|
+
exported?: true;
|
|
553
|
+
name: Identifier;
|
|
554
|
+
lines: EntityLine[];
|
|
555
|
+
}
|
|
556
|
+
export interface ErrorDeclaration extends Node {
|
|
557
|
+
type: 'errorDeclaration';
|
|
558
|
+
position: Position;
|
|
559
|
+
exported?: true;
|
|
560
|
+
name: Identifier;
|
|
561
|
+
/** A named `data` model, or the fields of an anonymous one. */
|
|
562
|
+
data?: Name | Field[];
|
|
563
|
+
}
|
|
564
|
+
export interface ConstDeclaration extends Node {
|
|
565
|
+
type: 'const';
|
|
566
|
+
position: Position;
|
|
567
|
+
exported?: true;
|
|
568
|
+
name: Identifier;
|
|
569
|
+
valueType?: TypeRef;
|
|
570
|
+
value: Expression;
|
|
571
|
+
}
|
|
572
|
+
export type Declaration = ImportDeclaration | ReExport | NamespaceDeclaration | ActionDeclaration | TriggerDeclaration | PermissionsDeclaration | RelationDeclaration | EnumDeclaration | ModelDeclaration | EntityDeclaration | ErrorDeclaration | ConstDeclaration;
|
|
573
|
+
export interface Program extends Parent {
|
|
574
|
+
type: 'program';
|
|
575
|
+
position: Position;
|
|
576
|
+
children: Declaration[];
|
|
577
|
+
}
|
|
578
|
+
export type CantNode = Program | Declaration | Parameter | NamedValue | Assertion | EnumMember | Field | EntityLine | ExposedField | Block | Statement | Expression | Argument | ObjectItem | Nothing | Text | Interpolation | TypeRef | VoidType | ErrorType;
|
|
579
|
+
//# sourceMappingURL=ast.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ast.d.ts","sourceRoot":"","sources":["../src/ast.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE7D;;;;;;;;GAQG;AAEH,MAAM,WAAW,UAAW,SAAQ,OAAO;IACzC,IAAI,EAAE,YAAY,CAAC;IACnB,QAAQ,EAAE,QA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EAAE,IAAI,GAAG,KAAK,EAAE,CAAC;CACvB;AAID,MAAM,WAAW,gBAAiB,SAAQ,IAAI;IAC5C,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,QAAQ,CAAC;IACnB,QAAQ,CAAC,EAAE,IAAI,CAAC;IAChB,IAAI,EAAE,UAAU,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,EAAE,UAAU,CAAC;CACnB;AAID,MAAM,MAAM,WAAW,GACnB,iBAAiB,GACjB,QAAQ,GACR,oBAAoB,GACpB,iBAAiB,GACjB,kBAAkB,GAClB,sBAAsB,GACtB,mBAAmB,GACnB,eAAe,GACf,gBAAgB,GAChB,iBAAiB,GACjB,gBAAgB,GAChB,gBAAgB,CAAC;AAErB,MAAM,WAAW,OAAQ,SAAQ,MAAM;IACrC,IAAI,EAAE,SAAS,CAAC;IAChB,QAAQ,EAAE,QAAQ,CAAC;IACnB,QAAQ,EAAE,WAAW,EAAE,CAAC;CACzB;AAED,MAAM,MAAM,QAAQ,GAChB,OAAO,GACP,WAAW,GACX,SAAS,GACT,UAAU,GACV,SAAS,GACT,UAAU,GACV,KAAK,GACL,UAAU,GACV,YAAY,GACZ,KAAK,GACL,SAAS,GACT,UAAU,GACV,QAAQ,GACR,UAAU,GACV,OAAO,GACP,IAAI,GACJ,aAAa,GACb,OAAO,GACP,QAAQ,GACR,SAAS,CAAC"}
|
package/dist/ast.js
ADDED
package/dist/ast.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ast.js","sourceRoot":"","sources":["../src/ast.ts"],"names":[],"mappings":""}
|