@sdkgen/parser 0.0.0-dev.20211129132842 → 0.0.0-dev.20211213231653
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/spec/parser.spec.js +71 -0
- package/dist/src/ast.d.ts +10 -5
- package/dist/src/ast.js +14 -6
- package/dist/src/json.js +1 -1
- package/dist/src/parser.js +60 -27
- package/dist/src/semantic/04_expand_spreads.d.ts +9 -0
- package/dist/src/semantic/04_expand_spreads.js +60 -0
- package/dist/src/semantic/05_check_empty_struct_or_enum.js +1 -1
- package/dist/src/semantic/{04_give_struct_and_enum_names.d.ts → 06_give_struct_and_enum_names.d.ts} +0 -0
- package/dist/src/semantic/{04_give_struct_and_enum_names.js → 06_give_struct_and_enum_names.js} +0 -0
- package/dist/src/semantic/{06_collect_struct_and_enum_types.d.ts → 07_collect_struct_and_enum_types.d.ts} +0 -0
- package/dist/src/semantic/{06_collect_struct_and_enum_types.js → 07_collect_struct_and_enum_types.js} +0 -0
- package/dist/src/semantic/analyser.js +6 -6
- package/dist/src/semantic/visitor.js +8 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/src/semantic/07_apply_struct_spreads.d.ts +0 -7
- package/dist/src/semantic/07_apply_struct_spreads.js +0 -42
package/dist/spec/parser.spec.js
CHANGED
|
@@ -196,6 +196,51 @@ describe(parser_1.Parser, () => {
|
|
|
196
196
|
},
|
|
197
197
|
},
|
|
198
198
|
});
|
|
199
|
+
expectParses(`
|
|
200
|
+
type Bar {
|
|
201
|
+
aa: string
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
type Foo {
|
|
205
|
+
...Bar
|
|
206
|
+
aa: int
|
|
207
|
+
}
|
|
208
|
+
`, {
|
|
209
|
+
annotations: {},
|
|
210
|
+
errors: ["Fatal"],
|
|
211
|
+
functionTable: {},
|
|
212
|
+
typeTable: {
|
|
213
|
+
Bar: {
|
|
214
|
+
aa: "string",
|
|
215
|
+
},
|
|
216
|
+
Foo: {
|
|
217
|
+
aa: "int",
|
|
218
|
+
},
|
|
219
|
+
},
|
|
220
|
+
});
|
|
221
|
+
expectParses(`
|
|
222
|
+
type Bar {
|
|
223
|
+
aa: string
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
type Foo {
|
|
227
|
+
...Bar
|
|
228
|
+
aa: int
|
|
229
|
+
...Bar
|
|
230
|
+
}
|
|
231
|
+
`, {
|
|
232
|
+
annotations: {},
|
|
233
|
+
errors: ["Fatal"],
|
|
234
|
+
functionTable: {},
|
|
235
|
+
typeTable: {
|
|
236
|
+
Bar: {
|
|
237
|
+
aa: "string",
|
|
238
|
+
},
|
|
239
|
+
Foo: {
|
|
240
|
+
aa: "string",
|
|
241
|
+
},
|
|
242
|
+
},
|
|
243
|
+
});
|
|
199
244
|
});
|
|
200
245
|
test("handles functions with arguments", () => {
|
|
201
246
|
expectParses(`
|
|
@@ -223,6 +268,32 @@ describe(parser_1.Parser, () => {
|
|
|
223
268
|
},
|
|
224
269
|
});
|
|
225
270
|
});
|
|
271
|
+
test("handles spreads in function arguments", () => {
|
|
272
|
+
expectParses(`
|
|
273
|
+
type Bar {
|
|
274
|
+
aa: string
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
fn doIt(foo: int, ...Bar): string
|
|
278
|
+
`, {
|
|
279
|
+
annotations: {},
|
|
280
|
+
errors: ["Fatal"],
|
|
281
|
+
functionTable: {
|
|
282
|
+
doIt: {
|
|
283
|
+
args: {
|
|
284
|
+
aa: "string",
|
|
285
|
+
foo: "int",
|
|
286
|
+
},
|
|
287
|
+
ret: "string",
|
|
288
|
+
},
|
|
289
|
+
},
|
|
290
|
+
typeTable: {
|
|
291
|
+
Bar: {
|
|
292
|
+
aa: "string",
|
|
293
|
+
},
|
|
294
|
+
},
|
|
295
|
+
});
|
|
296
|
+
});
|
|
226
297
|
test("handles functions with annotations", () => {
|
|
227
298
|
expectParses(`
|
|
228
299
|
@description does it
|
package/dist/src/ast.d.ts
CHANGED
|
@@ -133,16 +133,20 @@ export declare class Field extends AstNode {
|
|
|
133
133
|
annotations: Annotation[];
|
|
134
134
|
constructor(name: string, type: Type, secret?: boolean);
|
|
135
135
|
}
|
|
136
|
+
export declare class Spread extends AstNode {
|
|
137
|
+
typeReference: TypeReference;
|
|
138
|
+
constructor(typeReference: TypeReference);
|
|
139
|
+
}
|
|
136
140
|
export declare class TypeReference extends Type {
|
|
137
141
|
name: string;
|
|
138
142
|
type: Type;
|
|
139
143
|
constructor(name: string);
|
|
140
144
|
}
|
|
141
145
|
export declare class StructType extends Type {
|
|
142
|
-
|
|
143
|
-
spreads: TypeReference[];
|
|
146
|
+
fieldsAndSpreads: Array<Field | Spread>;
|
|
144
147
|
name: string;
|
|
145
|
-
|
|
148
|
+
fields: Field[];
|
|
149
|
+
constructor(fieldsAndSpreads: Array<Field | Spread>);
|
|
146
150
|
}
|
|
147
151
|
export declare class TypeDefinition extends AstNode {
|
|
148
152
|
name: string;
|
|
@@ -152,10 +156,11 @@ export declare class TypeDefinition extends AstNode {
|
|
|
152
156
|
}
|
|
153
157
|
export declare class FunctionOperation extends AstNode {
|
|
154
158
|
name: string;
|
|
155
|
-
|
|
159
|
+
fieldsAndSpreads: Array<Field | Spread>;
|
|
156
160
|
returnType: Type;
|
|
157
161
|
annotations: Annotation[];
|
|
158
|
-
|
|
162
|
+
args: Field[];
|
|
163
|
+
constructor(name: string, fieldsAndSpreads: Array<Field | Spread>, returnType: Type);
|
|
159
164
|
}
|
|
160
165
|
export declare class AstRoot {
|
|
161
166
|
typeDefinitions: TypeDefinition[];
|
package/dist/src/ast.js
CHANGED
|
@@ -11,7 +11,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
return t;
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.AstRoot = exports.FunctionOperation = exports.TypeDefinition = exports.StructType = exports.TypeReference = exports.Field = exports.EnumType = exports.EnumValue = exports.ArrayType = exports.OptionalType = exports.JsonPrimitiveType = exports.XmlPrimitiveType = exports.Base64PrimitiveType = exports.HtmlPrimitiveType = exports.HexPrimitiveType = exports.UuidPrimitiveType = exports.UrlPrimitiveType = exports.EmailPrimitiveType = exports.CnpjPrimitiveType = exports.CpfPrimitiveType = exports.MoneyPrimitiveType = exports.VoidPrimitiveType = exports.BytesPrimitiveType = exports.BoolPrimitiveType = exports.DateTimePrimitiveType = exports.DatePrimitiveType = exports.BigIntPrimitiveType = exports.FloatPrimitiveType = exports.UIntPrimitiveType = exports.IntPrimitiveType = exports.StringPrimitiveType = exports.PrimitiveType = exports.HiddenAnnotation = exports.RestAnnotation = exports.ArgDescriptionAnnotation = exports.ThrowsAnnotation = exports.DescriptionAnnotation = exports.Annotation = exports.ErrorNode = exports.Type = exports.AstNode = void 0;
|
|
14
|
+
exports.AstRoot = exports.FunctionOperation = exports.TypeDefinition = exports.StructType = exports.TypeReference = exports.Spread = exports.Field = exports.EnumType = exports.EnumValue = exports.ArrayType = exports.OptionalType = exports.JsonPrimitiveType = exports.XmlPrimitiveType = exports.Base64PrimitiveType = exports.HtmlPrimitiveType = exports.HexPrimitiveType = exports.UuidPrimitiveType = exports.UrlPrimitiveType = exports.EmailPrimitiveType = exports.CnpjPrimitiveType = exports.CpfPrimitiveType = exports.MoneyPrimitiveType = exports.VoidPrimitiveType = exports.BytesPrimitiveType = exports.BoolPrimitiveType = exports.DateTimePrimitiveType = exports.DatePrimitiveType = exports.BigIntPrimitiveType = exports.FloatPrimitiveType = exports.UIntPrimitiveType = exports.IntPrimitiveType = exports.StringPrimitiveType = exports.PrimitiveType = exports.HiddenAnnotation = exports.RestAnnotation = exports.ArgDescriptionAnnotation = exports.ThrowsAnnotation = exports.DescriptionAnnotation = exports.Annotation = exports.ErrorNode = exports.Type = exports.AstNode = void 0;
|
|
15
15
|
const token_1 = require("./token");
|
|
16
16
|
class AstNode {
|
|
17
17
|
constructor() {
|
|
@@ -278,6 +278,13 @@ class Field extends AstNode {
|
|
|
278
278
|
}
|
|
279
279
|
}
|
|
280
280
|
exports.Field = Field;
|
|
281
|
+
class Spread extends AstNode {
|
|
282
|
+
constructor(typeReference) {
|
|
283
|
+
super();
|
|
284
|
+
this.typeReference = typeReference;
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
exports.Spread = Spread;
|
|
281
288
|
class TypeReference extends Type {
|
|
282
289
|
constructor(name) {
|
|
283
290
|
super();
|
|
@@ -286,10 +293,10 @@ class TypeReference extends Type {
|
|
|
286
293
|
}
|
|
287
294
|
exports.TypeReference = TypeReference;
|
|
288
295
|
class StructType extends Type {
|
|
289
|
-
constructor(
|
|
296
|
+
constructor(fieldsAndSpreads) {
|
|
290
297
|
super();
|
|
291
|
-
this.
|
|
292
|
-
this.
|
|
298
|
+
this.fieldsAndSpreads = fieldsAndSpreads;
|
|
299
|
+
this.fields = [];
|
|
293
300
|
}
|
|
294
301
|
}
|
|
295
302
|
exports.StructType = StructType;
|
|
@@ -303,12 +310,13 @@ class TypeDefinition extends AstNode {
|
|
|
303
310
|
}
|
|
304
311
|
exports.TypeDefinition = TypeDefinition;
|
|
305
312
|
class FunctionOperation extends AstNode {
|
|
306
|
-
constructor(name,
|
|
313
|
+
constructor(name, fieldsAndSpreads, returnType) {
|
|
307
314
|
super();
|
|
308
315
|
this.name = name;
|
|
309
|
-
this.
|
|
316
|
+
this.fieldsAndSpreads = fieldsAndSpreads;
|
|
310
317
|
this.returnType = returnType;
|
|
311
318
|
this.annotations = [];
|
|
319
|
+
this.args = [];
|
|
312
320
|
}
|
|
313
321
|
}
|
|
314
322
|
exports.FunctionOperation = FunctionOperation;
|
package/dist/src/json.js
CHANGED
|
@@ -146,7 +146,7 @@ function jsonToAst(json) {
|
|
|
146
146
|
}
|
|
147
147
|
fields.push(field);
|
|
148
148
|
}
|
|
149
|
-
return new ast_1.StructType(fields
|
|
149
|
+
return new ast_1.StructType(fields);
|
|
150
150
|
}
|
|
151
151
|
for (const [typeName, description] of Object.entries(json.typeTable)) {
|
|
152
152
|
const type = processType(description, typeName);
|
package/dist/src/parser.js
CHANGED
|
@@ -158,7 +158,7 @@ class Parser {
|
|
|
158
158
|
const nameToken = this.expect(token_1.IdentifierToken);
|
|
159
159
|
const name = nameToken.value;
|
|
160
160
|
if (!/[A-Z]/u.test(name[0])) {
|
|
161
|
-
throw new ParserError(`The custom type name must start with an uppercase letter, but found
|
|
161
|
+
throw new ParserError(`The custom type name must start with an uppercase letter, but found ${JSON.stringify(name)} at ${nameToken.location}`);
|
|
162
162
|
}
|
|
163
163
|
this.nextToken();
|
|
164
164
|
const { annotations } = this;
|
|
@@ -175,7 +175,7 @@ class Parser {
|
|
|
175
175
|
const nameToken = this.expect(token_1.IdentifierToken);
|
|
176
176
|
const name = nameToken.value;
|
|
177
177
|
if (!/[A-Z]/u.test(name[0])) {
|
|
178
|
-
throw new ParserError(`Error name must start with an uppercase letter, but found
|
|
178
|
+
throw new ParserError(`Error name must start with an uppercase letter, but found ${JSON.stringify(name)} at ${nameToken.location}`);
|
|
179
179
|
}
|
|
180
180
|
this.nextToken();
|
|
181
181
|
let type = new ast_1.VoidPrimitiveType();
|
|
@@ -197,24 +197,60 @@ class Parser {
|
|
|
197
197
|
this.expect(token_1.ParensOpenSymbolToken);
|
|
198
198
|
this.nextToken();
|
|
199
199
|
const argNames = new Set();
|
|
200
|
-
const
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
200
|
+
const fieldsAndSpreads = [];
|
|
201
|
+
let finished = false;
|
|
202
|
+
let parensCloseToken;
|
|
203
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
204
|
+
while (!finished) {
|
|
205
|
+
this.acceptAnnotations();
|
|
206
|
+
this.multiExpect({
|
|
207
|
+
ParensCloseSymbolToken: token => {
|
|
208
|
+
this.checkCannotHaveAnnotationsHere();
|
|
209
|
+
this.nextToken();
|
|
210
|
+
finished = true;
|
|
211
|
+
parensCloseToken = token;
|
|
212
|
+
},
|
|
213
|
+
IdentifierToken: () => {
|
|
214
|
+
const field = this.parseField();
|
|
215
|
+
if (argNames.has(field.name)) {
|
|
216
|
+
throw new ParserError(`Cannot redeclare argument '${field.name}'`);
|
|
217
|
+
}
|
|
218
|
+
argNames.add(field.name);
|
|
219
|
+
fieldsAndSpreads.push(field);
|
|
220
|
+
this.multiExpect({
|
|
221
|
+
ParensCloseSymbolToken: token => {
|
|
222
|
+
this.checkCannotHaveAnnotationsHere();
|
|
223
|
+
this.nextToken();
|
|
224
|
+
finished = true;
|
|
225
|
+
parensCloseToken = token;
|
|
226
|
+
},
|
|
227
|
+
CommaSymbolToken: () => this.nextToken(),
|
|
228
|
+
});
|
|
229
|
+
},
|
|
230
|
+
SpreadSymbolToken: () => {
|
|
231
|
+
this.checkCannotHaveAnnotationsHere();
|
|
232
|
+
this.nextToken();
|
|
233
|
+
const identToken = this.expect(token_1.IdentifierToken);
|
|
234
|
+
this.nextToken();
|
|
235
|
+
if (!/[A-Z]/u.test(identToken.value[0])) {
|
|
236
|
+
throw new ParserError(`Expected a type but found ${JSON.stringify(identToken.value)} at ${identToken.location}`);
|
|
237
|
+
}
|
|
238
|
+
fieldsAndSpreads.push(new ast_1.Spread(new ast_1.TypeReference(identToken.value).at(identToken)).at(identToken));
|
|
239
|
+
this.multiExpect({
|
|
240
|
+
ParensCloseSymbolToken: token => {
|
|
241
|
+
this.checkCannotHaveAnnotationsHere();
|
|
242
|
+
this.nextToken();
|
|
243
|
+
finished = true;
|
|
244
|
+
parensCloseToken = token;
|
|
245
|
+
},
|
|
246
|
+
CommaSymbolToken: () => this.nextToken(),
|
|
247
|
+
});
|
|
248
|
+
},
|
|
249
|
+
});
|
|
214
250
|
}
|
|
215
251
|
for (const annotation of annotations) {
|
|
216
252
|
if (annotation instanceof ast_1.ArgDescriptionAnnotation) {
|
|
217
|
-
const arg =
|
|
253
|
+
const arg = fieldsAndSpreads.find(x => x instanceof ast_1.Field && x.name === annotation.argName);
|
|
218
254
|
if (!arg) {
|
|
219
255
|
throw new ParserError(`Argument '${annotation.argName}' not found, at ${annotation.location}`);
|
|
220
256
|
}
|
|
@@ -222,14 +258,12 @@ class Parser {
|
|
|
222
258
|
}
|
|
223
259
|
}
|
|
224
260
|
annotations = annotations.filter(ann => !(ann instanceof ast_1.ArgDescriptionAnnotation));
|
|
225
|
-
const parensCloseToken = this.expect(token_1.ParensCloseSymbolToken);
|
|
226
|
-
this.nextToken();
|
|
227
261
|
let returnType = new ast_1.VoidPrimitiveType().at(parensCloseToken);
|
|
228
262
|
if (this.token instanceof token_1.ColonSymbolToken) {
|
|
229
263
|
this.nextToken();
|
|
230
264
|
returnType = this.parseType();
|
|
231
265
|
}
|
|
232
|
-
const op = new ast_1.FunctionOperation(name,
|
|
266
|
+
const op = new ast_1.FunctionOperation(name, fieldsAndSpreads, returnType);
|
|
233
267
|
op.annotations = annotations;
|
|
234
268
|
return op;
|
|
235
269
|
}
|
|
@@ -287,8 +321,7 @@ class Parser {
|
|
|
287
321
|
parseStruct() {
|
|
288
322
|
const openingToken = this.expect(token_1.CurlyOpenSymbolToken);
|
|
289
323
|
this.nextToken();
|
|
290
|
-
const
|
|
291
|
-
const spreads = [];
|
|
324
|
+
const fieldsAndSpreads = [];
|
|
292
325
|
const fieldNames = new Set();
|
|
293
326
|
let finished = false;
|
|
294
327
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
@@ -306,7 +339,7 @@ class Parser {
|
|
|
306
339
|
throw new ParserError(`Cannot redeclare field '${field.name}'`);
|
|
307
340
|
}
|
|
308
341
|
fieldNames.add(field.name);
|
|
309
|
-
|
|
342
|
+
fieldsAndSpreads.push(field);
|
|
310
343
|
},
|
|
311
344
|
SpreadSymbolToken: () => {
|
|
312
345
|
this.checkCannotHaveAnnotationsHere();
|
|
@@ -314,13 +347,13 @@ class Parser {
|
|
|
314
347
|
const identToken = this.expect(token_1.IdentifierToken);
|
|
315
348
|
this.nextToken();
|
|
316
349
|
if (!/[A-Z]/u.test(identToken.value[0])) {
|
|
317
|
-
throw new ParserError(`Expected a type but found
|
|
350
|
+
throw new ParserError(`Expected a type but found ${JSON.stringify(identToken.value)} at ${identToken.location}`);
|
|
318
351
|
}
|
|
319
|
-
|
|
352
|
+
fieldsAndSpreads.push(new ast_1.Spread(new ast_1.TypeReference(identToken.value).at(identToken)).at(identToken));
|
|
320
353
|
},
|
|
321
354
|
});
|
|
322
355
|
}
|
|
323
|
-
return new ast_1.StructType(
|
|
356
|
+
return new ast_1.StructType(fieldsAndSpreads).at(openingToken);
|
|
324
357
|
}
|
|
325
358
|
parseType() {
|
|
326
359
|
this.checkCannotHaveAnnotationsHere();
|
|
@@ -330,7 +363,7 @@ class Parser {
|
|
|
330
363
|
IdentifierToken: token => {
|
|
331
364
|
this.nextToken();
|
|
332
365
|
if (!/[A-Z]/u.test(token.value[0])) {
|
|
333
|
-
throw new ParserError(`Expected a type but found
|
|
366
|
+
throw new ParserError(`Expected a type but found ${JSON.stringify(token.value)} at ${token.location}`);
|
|
334
367
|
}
|
|
335
368
|
return new ast_1.TypeReference(token.value).at(token);
|
|
336
369
|
},
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Spread } from "..";
|
|
2
|
+
import type { AstNode } from "../ast";
|
|
3
|
+
import { Field, StructType } from "../ast";
|
|
4
|
+
import { Visitor } from "./visitor";
|
|
5
|
+
export declare class ExpandSpreadsVisitor extends Visitor {
|
|
6
|
+
processed: Set<StructType>;
|
|
7
|
+
expandSpread(fields: Field[], fieldsAndSpreads: Array<Field | Spread>): void;
|
|
8
|
+
visit(node: AstNode): void;
|
|
9
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ExpandSpreadsVisitor = void 0;
|
|
4
|
+
const ast_1 = require("../ast");
|
|
5
|
+
const visitor_1 = require("./visitor");
|
|
6
|
+
class ExpandSpreadsVisitor extends visitor_1.Visitor {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
/*
|
|
10
|
+
* Here we may visit the same struct multiple times
|
|
11
|
+
* We must make sure we only process each one once
|
|
12
|
+
*/
|
|
13
|
+
this.processed = new Set();
|
|
14
|
+
}
|
|
15
|
+
expandSpread(fields, fieldsAndSpreads) {
|
|
16
|
+
const fieldIndex = new Map();
|
|
17
|
+
for (const fieldOrSpread of fieldsAndSpreads) {
|
|
18
|
+
let fieldsToAdd;
|
|
19
|
+
if (fieldOrSpread instanceof ast_1.Field) {
|
|
20
|
+
fieldsToAdd = [fieldOrSpread];
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
const struct = fieldOrSpread.typeReference.type;
|
|
24
|
+
if (!(struct instanceof ast_1.StructType)) {
|
|
25
|
+
throw new visitor_1.SemanticError(`A spread operator can't refer to something that is not a struct, in '${fieldOrSpread.typeReference.name}' at ${fieldOrSpread.location}.`);
|
|
26
|
+
}
|
|
27
|
+
this.visit(struct); // Recursion!
|
|
28
|
+
fieldsToAdd = struct.fields;
|
|
29
|
+
}
|
|
30
|
+
for (const field of fieldsToAdd) {
|
|
31
|
+
const index = fieldIndex.get(field.name);
|
|
32
|
+
if (index) {
|
|
33
|
+
fields[index] = field;
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
fieldIndex.set(field.name, fields.length);
|
|
37
|
+
fields.push(field);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
visit(node) {
|
|
43
|
+
if (node instanceof ast_1.StructType) {
|
|
44
|
+
if (this.processed.has(node)) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
this.processed.add(node);
|
|
48
|
+
}
|
|
49
|
+
super.visit(node);
|
|
50
|
+
if (node instanceof ast_1.StructType) {
|
|
51
|
+
this.expandSpread(node.fields, node.fieldsAndSpreads);
|
|
52
|
+
node.fieldsAndSpreads = [];
|
|
53
|
+
}
|
|
54
|
+
else if (node instanceof ast_1.FunctionOperation) {
|
|
55
|
+
this.expandSpread(node.args, node.fieldsAndSpreads);
|
|
56
|
+
node.fieldsAndSpreads = [];
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
exports.ExpandSpreadsVisitor = ExpandSpreadsVisitor;
|
|
@@ -12,7 +12,7 @@ class CheckEmptyStructOrEnumVisitor extends visitor_1.Visitor {
|
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
if (node instanceof ast_1.StructType) {
|
|
15
|
-
if (node.fields.length === 0
|
|
15
|
+
if (node.fields.length === 0) {
|
|
16
16
|
throw new visitor_1.SemanticError(`Struct '${node.name}' at ${node.location} is empty`);
|
|
17
17
|
}
|
|
18
18
|
}
|
package/dist/src/semantic/{04_give_struct_and_enum_names.d.ts → 06_give_struct_and_enum_names.d.ts}
RENAMED
|
File without changes
|
package/dist/src/semantic/{04_give_struct_and_enum_names.js → 06_give_struct_and_enum_names.js}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -5,10 +5,10 @@ const ast_1 = require("../ast");
|
|
|
5
5
|
const _01_check_multiple_declaration_1 = require("./01_check_multiple_declaration");
|
|
6
6
|
const _02_match_type_definitions_1 = require("./02_match_type_definitions");
|
|
7
7
|
const _03_check_dont_return_secret_1 = require("./03_check_dont_return_secret");
|
|
8
|
-
const
|
|
8
|
+
const _04_expand_spreads_1 = require("./04_expand_spreads");
|
|
9
9
|
const _05_check_empty_struct_or_enum_1 = require("./05_check_empty_struct_or_enum");
|
|
10
|
-
const
|
|
11
|
-
const
|
|
10
|
+
const _06_give_struct_and_enum_names_1 = require("./06_give_struct_and_enum_names");
|
|
11
|
+
const _07_collect_struct_and_enum_types_1 = require("./07_collect_struct_and_enum_types");
|
|
12
12
|
const _08_validate_annotations_1 = require("./08_validate_annotations");
|
|
13
13
|
const _09_validate_recursive_types_1 = require("./09_validate_recursive_types");
|
|
14
14
|
function analyse(root) {
|
|
@@ -18,10 +18,10 @@ function analyse(root) {
|
|
|
18
18
|
new _01_check_multiple_declaration_1.CheckMultipleDeclarationVisitor(root).process();
|
|
19
19
|
new _02_match_type_definitions_1.MatchTypeDefinitionsVisitor(root).process();
|
|
20
20
|
new _03_check_dont_return_secret_1.CheckDontReturnSecretVisitor(root).process();
|
|
21
|
-
new
|
|
21
|
+
new _04_expand_spreads_1.ExpandSpreadsVisitor(root).process();
|
|
22
22
|
new _05_check_empty_struct_or_enum_1.CheckEmptyStructOrEnumVisitor(root).process();
|
|
23
|
-
new
|
|
24
|
-
new
|
|
23
|
+
new _06_give_struct_and_enum_names_1.GiveStructAndEnumNamesVisitor(root).process();
|
|
24
|
+
new _07_collect_struct_and_enum_types_1.CollectStructAndEnumTypesVisitor(root).process();
|
|
25
25
|
new _08_validate_annotations_1.ValidateAnnotationsVisitor(root).process();
|
|
26
26
|
new _09_validate_recursive_types_1.ValidateRecursiveTypes(root).process();
|
|
27
27
|
}
|
|
@@ -25,6 +25,9 @@ class Visitor {
|
|
|
25
25
|
for (const arg of node.args) {
|
|
26
26
|
this.visit(arg);
|
|
27
27
|
}
|
|
28
|
+
for (const arg of node.fieldsAndSpreads) {
|
|
29
|
+
this.visit(arg);
|
|
30
|
+
}
|
|
28
31
|
this.visit(node.returnType);
|
|
29
32
|
}
|
|
30
33
|
else if (node instanceof ast_1.Field || node instanceof ast_1.TypeDefinition) {
|
|
@@ -34,8 +37,8 @@ class Visitor {
|
|
|
34
37
|
for (const field of node.fields) {
|
|
35
38
|
this.visit(field);
|
|
36
39
|
}
|
|
37
|
-
for (const
|
|
38
|
-
this.visit(
|
|
40
|
+
for (const field of node.fieldsAndSpreads) {
|
|
41
|
+
this.visit(field);
|
|
39
42
|
}
|
|
40
43
|
}
|
|
41
44
|
else if (node instanceof ast_1.ArrayType || node instanceof ast_1.OptionalType) {
|
|
@@ -44,6 +47,9 @@ class Visitor {
|
|
|
44
47
|
else if (node instanceof ast_1.ErrorNode) {
|
|
45
48
|
this.visit(node.dataType);
|
|
46
49
|
}
|
|
50
|
+
else if (node instanceof ast_1.Spread) {
|
|
51
|
+
this.visit(node.typeReference);
|
|
52
|
+
}
|
|
47
53
|
}
|
|
48
54
|
}
|
|
49
55
|
exports.Visitor = Visitor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"program":{"fileNames":["../node_modules/typescript/lib/lib.es5.d.ts","../node_modules/typescript/lib/lib.es2015.d.ts","../node_modules/typescript/lib/lib.es2016.d.ts","../node_modules/typescript/lib/lib.es2017.d.ts","../node_modules/typescript/lib/lib.es2018.d.ts","../node_modules/typescript/lib/lib.es2019.d.ts","../node_modules/typescript/lib/lib.es2020.d.ts","../node_modules/typescript/lib/lib.dom.d.ts","../node_modules/typescript/lib/lib.dom.iterable.d.ts","../node_modules/typescript/lib/lib.webworker.importscripts.d.ts","../node_modules/typescript/lib/lib.scripthost.d.ts","../node_modules/typescript/lib/lib.es2015.core.d.ts","../node_modules/typescript/lib/lib.es2015.collection.d.ts","../node_modules/typescript/lib/lib.es2015.generator.d.ts","../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../node_modules/typescript/lib/lib.es2015.promise.d.ts","../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../node_modules/typescript/lib/lib.es2017.object.d.ts","../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2017.string.d.ts","../node_modules/typescript/lib/lib.es2017.intl.d.ts","../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../node_modules/typescript/lib/lib.es2018.intl.d.ts","../node_modules/typescript/lib/lib.es2018.promise.d.ts","../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../node_modules/typescript/lib/lib.es2019.array.d.ts","../node_modules/typescript/lib/lib.es2019.object.d.ts","../node_modules/typescript/lib/lib.es2019.string.d.ts","../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../node_modules/typescript/lib/lib.es2020.promise.d.ts","../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2020.string.d.ts","../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2020.intl.d.ts","../node_modules/typescript/lib/lib.esnext.intl.d.ts","../node_modules/typescript/lib/lib.es2017.full.d.ts","../src/token.ts","../src/lexer.ts","../spec/lexer.spec.ts","../src/ast.ts","../src/semantic/visitor.ts","../src/semantic/01_check_multiple_declaration.ts","../src/semantic/02_match_type_definitions.ts","../src/semantic/03_check_dont_return_secret.ts","../src/semantic/04_give_struct_and_enum_names.ts","../src/semantic/05_check_empty_struct_or_enum.ts","../src/semantic/06_collect_struct_and_enum_types.ts","../src/semantic/07_apply_struct_spreads.ts","../src/semantic/08_validate_annotations.ts","../src/semantic/09_validate_recursive_types.ts","../src/semantic/analyser.ts","../src/utils.ts","../src/json.ts","../src/restparser.ts","../src/parser.ts","../spec/parser.spec.ts","../src/compatibility/index.ts","../src/index.ts","../node_modules/@babel/types/lib/index.d.ts","../node_modules/@types/babel__generator/index.d.ts","../node_modules/@babel/parser/typings/babel-parser.d.ts","../node_modules/@types/babel__template/index.d.ts","../node_modules/@types/babel__traverse/index.d.ts","../node_modules/@types/babel__core/index.d.ts","../node_modules/@types/node/assert.d.ts","../node_modules/@types/node/assert/strict.d.ts","../node_modules/@types/node/globals.d.ts","../node_modules/@types/node/async_hooks.d.ts","../node_modules/@types/node/buffer.d.ts","../node_modules/@types/node/child_process.d.ts","../node_modules/@types/node/cluster.d.ts","../node_modules/@types/node/console.d.ts","../node_modules/@types/node/constants.d.ts","../node_modules/@types/node/crypto.d.ts","../node_modules/@types/node/dgram.d.ts","../node_modules/@types/node/diagnostics_channel.d.ts","../node_modules/@types/node/dns.d.ts","../node_modules/@types/node/dns/promises.d.ts","../node_modules/@types/node/domain.d.ts","../node_modules/@types/node/events.d.ts","../node_modules/@types/node/fs.d.ts","../node_modules/@types/node/fs/promises.d.ts","../node_modules/@types/node/http.d.ts","../node_modules/@types/node/http2.d.ts","../node_modules/@types/node/https.d.ts","../node_modules/@types/node/inspector.d.ts","../node_modules/@types/node/module.d.ts","../node_modules/@types/node/net.d.ts","../node_modules/@types/node/os.d.ts","../node_modules/@types/node/path.d.ts","../node_modules/@types/node/perf_hooks.d.ts","../node_modules/@types/node/process.d.ts","../node_modules/@types/node/punycode.d.ts","../node_modules/@types/node/querystring.d.ts","../node_modules/@types/node/readline.d.ts","../node_modules/@types/node/repl.d.ts","../node_modules/@types/node/stream.d.ts","../node_modules/@types/node/stream/promises.d.ts","../node_modules/@types/node/stream/consumers.d.ts","../node_modules/@types/node/stream/web.d.ts","../node_modules/@types/node/string_decoder.d.ts","../node_modules/@types/node/timers.d.ts","../node_modules/@types/node/timers/promises.d.ts","../node_modules/@types/node/tls.d.ts","../node_modules/@types/node/trace_events.d.ts","../node_modules/@types/node/tty.d.ts","../node_modules/@types/node/url.d.ts","../node_modules/@types/node/util.d.ts","../node_modules/@types/node/v8.d.ts","../node_modules/@types/node/vm.d.ts","../node_modules/@types/node/wasi.d.ts","../node_modules/@types/node/worker_threads.d.ts","../node_modules/@types/node/zlib.d.ts","../node_modules/@types/node/globals.global.d.ts","../node_modules/@types/node/index.d.ts","../node_modules/@types/graceful-fs/index.d.ts","../node_modules/@types/istanbul-lib-coverage/index.d.ts","../node_modules/@types/istanbul-lib-report/index.d.ts","../node_modules/@types/istanbul-reports/index.d.ts","../node_modules/jest-diff/build/cleanupSemantic.d.ts","../node_modules/jest-diff/build/types.d.ts","../node_modules/jest-diff/build/diffLines.d.ts","../node_modules/jest-diff/build/printDiffs.d.ts","../node_modules/jest-diff/build/index.d.ts","../node_modules/pretty-format/build/types.d.ts","../node_modules/pretty-format/build/index.d.ts","../node_modules/@types/jest/index.d.ts","../node_modules/@types/json-schema/index.d.ts","../node_modules/@types/json5/index.d.ts","../node_modules/@types/prettier/index.d.ts","../node_modules/@types/stack-utils/index.d.ts","../node_modules/@types/yargs-parser/index.d.ts","../node_modules/@types/yargs/index.d.ts"],"fileInfos":[{"version":"6adbf5efd0e374ff5f427a4f26a5a413e9734eee5067a0e86da69aea41910b52","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84","e21c071ca3e1b4a815d5f04a7475adcaeea5d64367e840dd0154096d705c3940",{"version":"abba1071bfd89e55e88a054b0c851ea3e8a494c340d0f3fab19eb18f6afb0c9e","affectsGlobalScope":true},{"version":"927cb2b60048e1395b183bf74b2b80a75bdb1dbe384e1d9fac654313ea2fb136","affectsGlobalScope":true},{"version":"7fac8cb5fc820bc2a59ae11ef1c5b38d3832c6d0dfaec5acdb5569137d09a481","affectsGlobalScope":true},{"version":"097a57355ded99c68e6df1b738990448e0bf170e606707df5a7c0481ff2427cd","affectsGlobalScope":true},{"version":"d8996609230d17e90484a2dd58f22668f9a05a3bfe00bfb1d6271171e54a31fb","affectsGlobalScope":true},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"4378fc8122ec9d1a685b01eb66c46f62aba6b239ca7228bb6483bcf8259ee493","affectsGlobalScope":true},{"version":"0d5f52b3174bee6edb81260ebcd792692c32c81fd55499d69531496f3f2b25e7","affectsGlobalScope":true},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","affectsGlobalScope":true},{"version":"62d80405c46c3f4c527ee657ae9d43fda65a0bf582292429aea1e69144a522a6","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"1b3fe904465430e030c93239a348f05e1be80640d91f2f004c3512c2c2c89f34","affectsGlobalScope":true},{"version":"3787b83e297de7c315d55d4a7c546ae28e5f6c0a361b7a1dcec1f1f50a54ef11","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"d071129cba6a5f2700be09c86c07ad2791ab67d4e5ed1eb301d6746c62745ea4","affectsGlobalScope":true},{"version":"10bbdc1981b8d9310ee75bfac28ee0477bb2353e8529da8cff7cb26c409cb5e8","affectsGlobalScope":true},"d2f31f19e1ba6ed59be9259d660a239d9a3fcbbc8e038c6b2009bde34b175fed","abcce357d43321346018f0a447aae8396df4b6e3c8a71a07a698852c010659e6","bb859947a395dfe951fa360bcf2fc4c118e97811ae04b811ecabcf066b658299","6327bd2eac3fd3f5c7162a87420cffe58f8c7ba2972ad47e12cef928bd926e29","cf7a93d2d9837d0300ac7f45a7ce4e250eebd132ee5023a8981ab70e0803dcba","ed0580d425a3550468748f47e2297f0ea4285b7bc9a2af1c8d29d8e2c3dd443f","32e2cd21e5b2b1f554c8b78d526790c53aebde93764ca0a62198a3fafd702ced","481a4131dcbf468c936b2101e8b57aa2e6e06132f6cab7b2da37a346b10e0aef","ec1b879eff21a88a63438fdcba018128906ed10d59929679b2c62b63af87e6ec","5c6e80bb32d1a9b7c7651b23b33603a269a27b1b4d0772ef7a3c3d7d81ff8278","ce4e2f6d6bd0ce7eb49106a34cf013d9a126e574668b3657853b0e1b591727e7","22316de0c4d000dc53e1f1739b84eacc9690466f7904efb124efb459d1cf20b5","22799907c4404db2d5b70857a10befc1719e9b07f2556515d72d064111ef16a6","fc591e99fea917fa85a6df89a530aced1814fa9ddaab578b926aa3da106e6ce4","cec07e0118924c9394ea46459011fc2531d6f8b6022696ea09d89bcdac6fdf62","6eb274763aa341646fc88435e7de6f0bd983eeebc96fc90bef143bf049a3cef6","1d69af3250560dc6bc0384c8defb9476c782acc635dec27b775d2bfa4020ed1e","3b775f1726361892964db338a15637f3fa3f98b188596d20c05048922768e093","31b7510503d7ed5a8a7c45c1f0e7ab1c9eedd0c674131fd797b371d4285ed518","6678485e9350922e0da008b8a2c305b3054cbe46ceea3889f60d1f20cac8f24b","c50a0799b5a5fad6ba881c838aaa0c81d6da52b44fe3733ab27fe5754b37b8a4","1166bf3922f51e926c85bbcf218c191350c4558a91c831e8183b36b781982100","ce9361120cf8dab14f969006c491ee03309022d27a194b9e7822eb2fc3f510cf","272c2dac4baaf7fdd2d7efeef0fa2547af54cc21883c5e138b8c4d1661697a54","8dfed5c91ad36e69e6da6b7e49be929d4e19666db2b651aa839c485170a2902c","64b867c61effed7b5bc0cc06b3d8eac23b067a3fba581fc7d3c292fa593e6a45","93de1c6dab503f053efe8d304cb522bb3a89feab8c98f307a674a4fae04773e9","3b043cf9a81854a72963fdb57d1884fc4da1cf5be69b5e0a4c5b751e58cb6d88","d0b0a00cf31968a33baeaadf974ce4e5e7edf58cea5288765293f41ba5e72b3a","0d5a2ee1fdfa82740e0103389b9efd6bfe145a20018a2da3c02b89666181f4d9","a69c09dbea52352f479d3e7ac949fde3d17b195abe90b045d619f747b38d6d1a",{"version":"92d63add669d18ebc349efbacd88966d6f2ccdddfb1b880b2db98ae3aa7bf7c4","affectsGlobalScope":true},"ccc94049a9841fe47abe5baef6be9a38fc6228807974ae675fb15dc22531b4be",{"version":"9acfe4d1ff027015151ce81d60797b04b52bffe97ad8310bb0ec2e8fd61e1303","affectsGlobalScope":true},"95843d5cfafced8f3f8a5ce57d2335f0bcd361b9483587d12a25e4bd403b8216","afc6e96061af46bcff47246158caee7e056f5288783f2d83d6858cd25be1c565",{"version":"34f5bcac12b36d70304b73de5f5aab3bb91bd9919f984be80579ebcad03a624e","affectsGlobalScope":true},"82408ed3e959ddc60d3e9904481b5a8dc16469928257af22a3f7d1a3bc7fd8c4","2f520601649a893e6a49a8851ebfcf4be8ce090dc1281c2a08a871cb04e8251f","f50c975ab7b50e25a69e3d8a3773894125b44e9698924105f23b812bf7488baf","2b8c764f856a1dd0a9a2bf23e5efddbff157de8138b0754010be561ae5fcaa90","76650408392bf49a8fbf3e2b6b302712a92d76af77b06e2da1cc8077359c4409","0af3121e68297b2247dd331c0d24dba599e50736a7517a5622d5591aae4a3122","6972fca26f6e9bd56197568d4379f99071a90766e06b4fcb5920a0130a9202be",{"version":"4a2628e95962c8ab756121faa3ac2ed348112ff7a87b5c286dd2cc3326546b4c","affectsGlobalScope":true},"80793b2277f31baa199234daed806fff0fb11491d1ebd3357e520c3558063f00","a049a59a02009fc023684fcfaf0ac526fe36c35dcc5d2b7d620c1750ba11b083","5533392c50c51b1a5c32b89f13145db929c574ef1c5949cf67a074a05ea107d9","b287b810b5035d5685f1df6e1e418f1ca452a3ed4f59fd5cc081dbf2045f0d9b","4b9a003b5c556c96784132945bb41c655ea11273b1917f5c8d0c154dd5fd20dd","a458dc78104cc80048ac24fdc02fe6dce254838094c2f25641b3f954d9721241",{"version":"e8b18c6385ff784228a6f369694fcf1a6b475355ba89090a88de13587a9391d5","affectsGlobalScope":true},"902cd98bf46e95caf4118a0733fb801e9e90eec3edaed6abdad77124afec9ca2","abc1c425b2ad6720433f40f1877abfa4223f0f3dd486c9c28c492179ca183cb6","cd4854d38f4eb5592afd98ab95ca17389a7dfe38013d9079e802d739bdbcc939","94eed4cc2f5f658d5e229ff1ccd38860bddf4233e347bf78edd2154dee1f2b99",{"version":"bd1a08e30569b0fb2f0b21035eb9b039871f68faa9b98accf847e9c878c5e0a9","affectsGlobalScope":true},"9f1069b9e2c051737b1f9b4f1baf50e4a63385a6a89c32235549ae87fc3d5492","ee18f2da7a037c6ceeb112a084e485aead9ea166980bf433474559eac1b46553","29c2706fa0cc49a2bd90c83234da33d08bb9554ecec675e91c1f85087f5a5324","0acbf26bf958f9e80c1ffa587b74749d2697b75b484062d36e103c137c562bc3","d7838022c7dab596357a9604b9c6adffe37dc34085ce0779c958ce9545bd7139","1b952304137851e45bc009785de89ada562d9376177c97e37702e39e60c2f1ff",{"version":"806ef4cac3b3d9fa4a48d849c8e084d7c72fcd7b16d76e06049a9ed742ff79c0","affectsGlobalScope":true},"a279435e7813d1f061c0cab6ab77b1b9377e8d96851e5ed4a76a1ce6eb6e628f","c33a6ea7147af60d8e98f1ac127047f4b0d4e2ce28b8f08ff3de07ca7cc00637",{"version":"b42b47e17b8ece2424ae8039feb944c2e3ba4b262986aebd582e51efbdca93dc","affectsGlobalScope":true},"664d8f2d59164f2e08c543981453893bc7e003e4dfd29651ce09db13e9457980","2408611d9b4146e35d1dbd1f443ccd8e187c74614a54b80300728277529dbf11","998a3de5237518c0b3ac00a11b3b4417affb008aa20aedee52f3fdae3cb86151","ad41008ffe077206e1811fc873f4d9005b5fd7f6ab52bb6118fef600815a5cb4","d88ecca73348e7c337541c4b8b60a50aca5e87384f6b8a422fc6603c637e4c21","badae0df9a8016ac36994b0a0e7b82ba6aaa3528e175a8c3cb161e4683eec03e","c3db860bcaaaeb3bbc23f353bbda1f8ab82756c8d5e973bebb3953cb09ea68f2","235a53595bd20b0b0eeb1a29cb2887c67c48375e92f03749b2488fbd46d0b1a0","bc09393cd4cd13f69cf1366d4236fbae5359bb550f0de4e15767e9a91d63dfb1","9c266243b01545e11d2733a55ad02b4c00ecdbda99c561cd1674f96e89cdc958","c71155c05fc76ff948a4759abc1cb9feec036509f500174bc18dad4c7827a60c",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"1cdb8f094b969dcc183745dc88404e2d8fcf2a858c6e7cc2441011476573238e","3ebae8c00411116a66fca65b08228ea0cf0b72724701f9b854442100aab55aba","de18acda71730bac52f4b256ce7511bb56cc21f6f114c59c46782eff2f632857","7eb06594824ada538b1d8b48c3925a83e7db792f47a081a62cf3e5c4e23cf0ee","f5638f7c2f12a9a1a57b5c41b3c1ea7db3876c003bab68e6a57afd6bcc169af0","d8aab31ba8e618cc3eea10b0945de81cb93b7e8150a013a482332263b9305322","69da61a7b5093dac77fa3bec8be95dcf9a74c95a0e9161edb98bb24e30e439d2","561eca7a381b96d6ccac6e4061e6d2ae53f5bc44203f3fd9f5b26864c32ae6e9","62ea38627e3ebab429f7616812a9394d327c2bc271003dfba985de9b4137369f","8a8a96898906f065f296665e411f51010b51372fa260d5373bf9f64356703190","f014d6d053cb1840965952268a589c9e2a74d66c8c88286562d5699350e28e19","66851b263230decb3684072b2cb777f70ea3e52d4489b88f78f185618d4d398e",{"version":"e9f2cdc4e98e73a606ff68c470a8cb4f23cd638c47649d71b90a2d9413102080","affectsGlobalScope":true},"0359682c54e487c4cab2b53b2b4d35cc8dea4d9914bc6abcdb5701f8b8e745a4","96d14f21b7652903852eef49379d04dbda28c16ed36468f8c9fa08f7c14c9538","9d9e658d1d5b805562749ce383ef8c67ccb796394d8734d9c138788d7dab6ee3","b0d10e46cfe3f6c476b69af02eaa38e4ccc7430221ce3109ae84bb9fb8282298","f7e133b20ee2669b6c0e5d7f0cd510868c57cd64b283e68c7f598e30ce9d76d2","6ba73232c9d3267ca36ddb83e335d474d2c0e167481e3dec416c782894e11438"],"options":{"composite":true,"declaration":true,"esModuleInterop":true,"module":1,"outDir":"./","strict":true,"target":4},"fileIdsList":[[66,115],[115],[66,67,68,69,70,115],[66,68,115],[88,115,122],[115,124],[115,125],[115,131,133],[72,115],[75,115],[76,81,115],[77,87,88,95,104,114,115],[77,78,87,95,115],[79,115],[80,81,88,96,115],[81,104,111,115],[82,84,87,95,115],[83,115],[84,85,115],[86,87,115],[87,115],[87,88,89,104,114,115],[87,88,89,104,115],[90,95,104,114,115],[87,88,90,91,95,104,111,114,115],[90,92,104,111,114,115],[72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121],[87,93,115],[94,114,115],[84,87,95,104,115],[96,115],[97,115],[75,98,115],[99,113,115,119],[100,115],[101,115],[87,102,115],[102,103,115,117],[87,104,105,106,115],[104,106,115],[104,105,115],[107,115],[108,115],[87,109,110,115],[109,110,115],[81,95,111,115],[112,115],[95,113,115],[76,90,101,114,115],[81,115],[104,115,116],[115,117],[115,118],[76,81,87,89,98,104,114,115,117,119],[104,115,120],[115,139],[115,127,128],[115,127,128,129,130],[115,132],[44,45,115],[45,60,62,115],[44,115],[47,115],[44,45,47,60,62,64,115],[47,58,59,115],[44,45,47,58,59,61,115],[47,48,115],[47,49,50,51,52,53,54,55,56,57,115]],"referencedMap":[[68,1],[66,2],[71,3],[67,1],[69,4],[70,1],[123,5],[124,2],[125,6],[126,7],[134,8],[135,2],[136,2],[72,9],[73,9],[75,10],[76,11],[77,12],[78,13],[79,14],[80,15],[81,16],[82,17],[83,18],[84,19],[85,19],[86,20],[87,21],[88,22],[89,23],[74,2],[121,2],[90,24],[91,25],[92,26],[122,27],[93,28],[94,29],[95,30],[96,31],[97,32],[98,33],[99,34],[100,35],[101,36],[102,37],[103,38],[104,39],[106,40],[105,41],[107,42],[108,43],[109,44],[110,45],[111,46],[112,47],[113,48],[114,49],[115,50],[116,51],[117,52],[118,53],[119,54],[120,55],[137,2],[138,2],[139,2],[140,56],[127,2],[129,57],[131,58],[130,57],[128,2],[133,59],[132,2],[8,2],[9,2],[13,2],[12,2],[2,2],[14,2],[15,2],[16,2],[17,2],[18,2],[19,2],[20,2],[21,2],[3,2],[4,2],[43,2],[25,2],[22,2],[23,2],[24,2],[26,2],[27,2],[28,2],[5,2],[29,2],[30,2],[31,2],[32,2],[6,2],[33,2],[34,2],[35,2],[36,2],[7,2],[41,2],[37,2],[38,2],[39,2],[40,2],[1,2],[42,2],[11,2],[10,2],[46,60],[63,61],[47,62],[64,63],[65,64],[60,65],[45,62],[62,66],[61,63],[49,67],[50,67],[51,67],[52,67],[53,67],[54,67],[55,67],[56,67],[57,67],[58,68],[48,63],[44,2],[59,63]],"exportedModulesMap":[[68,1],[66,2],[71,3],[67,1],[69,4],[70,1],[123,5],[124,2],[125,6],[126,7],[134,8],[135,2],[136,2],[72,9],[73,9],[75,10],[76,11],[77,12],[78,13],[79,14],[80,15],[81,16],[82,17],[83,18],[84,19],[85,19],[86,20],[87,21],[88,22],[89,23],[74,2],[121,2],[90,24],[91,25],[92,26],[122,27],[93,28],[94,29],[95,30],[96,31],[97,32],[98,33],[99,34],[100,35],[101,36],[102,37],[103,38],[104,39],[106,40],[105,41],[107,42],[108,43],[109,44],[110,45],[111,46],[112,47],[113,48],[114,49],[115,50],[116,51],[117,52],[118,53],[119,54],[120,55],[137,2],[138,2],[139,2],[140,56],[127,2],[129,57],[131,58],[130,57],[128,2],[133,59],[132,2],[8,2],[9,2],[13,2],[12,2],[2,2],[14,2],[15,2],[16,2],[17,2],[18,2],[19,2],[20,2],[21,2],[3,2],[4,2],[43,2],[25,2],[22,2],[23,2],[24,2],[26,2],[27,2],[28,2],[5,2],[29,2],[30,2],[31,2],[32,2],[6,2],[33,2],[34,2],[35,2],[36,2],[7,2],[41,2],[37,2],[38,2],[39,2],[40,2],[1,2],[42,2],[11,2],[10,2],[46,60],[63,61],[47,62],[64,63],[65,64],[60,65],[45,62],[62,66],[61,63],[49,67],[50,67],[51,67],[52,67],[53,67],[54,67],[55,67],[56,67],[57,67],[58,68],[48,63],[44,2],[59,63]],"semanticDiagnosticsPerFile":[68,66,71,67,69,70,123,124,125,126,134,135,136,72,73,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,74,121,90,91,92,122,93,94,95,96,97,98,99,100,101,102,103,104,106,105,107,108,109,110,111,112,113,114,115,116,117,118,119,120,137,138,139,140,127,129,131,130,128,133,132,8,9,13,12,2,14,15,16,17,18,19,20,21,3,4,43,25,22,23,24,26,27,28,5,29,30,31,32,6,33,34,35,36,7,41,37,38,39,40,1,42,11,10,46,63,47,64,65,60,45,62,61,49,50,51,52,53,54,55,56,57,58,48,44,59]},"version":"4.5.2"}
|
|
1
|
+
{"program":{"fileNames":["../node_modules/typescript/lib/lib.es5.d.ts","../node_modules/typescript/lib/lib.es2015.d.ts","../node_modules/typescript/lib/lib.es2016.d.ts","../node_modules/typescript/lib/lib.es2017.d.ts","../node_modules/typescript/lib/lib.es2018.d.ts","../node_modules/typescript/lib/lib.es2019.d.ts","../node_modules/typescript/lib/lib.es2020.d.ts","../node_modules/typescript/lib/lib.dom.d.ts","../node_modules/typescript/lib/lib.dom.iterable.d.ts","../node_modules/typescript/lib/lib.webworker.importscripts.d.ts","../node_modules/typescript/lib/lib.scripthost.d.ts","../node_modules/typescript/lib/lib.es2015.core.d.ts","../node_modules/typescript/lib/lib.es2015.collection.d.ts","../node_modules/typescript/lib/lib.es2015.generator.d.ts","../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../node_modules/typescript/lib/lib.es2015.promise.d.ts","../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../node_modules/typescript/lib/lib.es2017.object.d.ts","../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2017.string.d.ts","../node_modules/typescript/lib/lib.es2017.intl.d.ts","../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../node_modules/typescript/lib/lib.es2018.intl.d.ts","../node_modules/typescript/lib/lib.es2018.promise.d.ts","../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../node_modules/typescript/lib/lib.es2019.array.d.ts","../node_modules/typescript/lib/lib.es2019.object.d.ts","../node_modules/typescript/lib/lib.es2019.string.d.ts","../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../node_modules/typescript/lib/lib.es2020.promise.d.ts","../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2020.string.d.ts","../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2020.intl.d.ts","../node_modules/typescript/lib/lib.esnext.intl.d.ts","../node_modules/typescript/lib/lib.es2017.full.d.ts","../src/token.ts","../src/lexer.ts","../spec/lexer.spec.ts","../src/ast.ts","../src/semantic/visitor.ts","../src/semantic/01_check_multiple_declaration.ts","../src/semantic/02_match_type_definitions.ts","../src/semantic/03_check_dont_return_secret.ts","../src/compatibility/index.ts","../src/restparser.ts","../src/utils.ts","../src/parser.ts","../src/index.ts","../src/semantic/04_expand_spreads.ts","../src/semantic/05_check_empty_struct_or_enum.ts","../src/semantic/06_give_struct_and_enum_names.ts","../src/semantic/07_collect_struct_and_enum_types.ts","../src/semantic/08_validate_annotations.ts","../src/semantic/09_validate_recursive_types.ts","../src/semantic/analyser.ts","../src/json.ts","../spec/parser.spec.ts","../node_modules/@babel/types/lib/index.d.ts","../node_modules/@types/babel__generator/index.d.ts","../node_modules/@babel/parser/typings/babel-parser.d.ts","../node_modules/@types/babel__template/index.d.ts","../node_modules/@types/babel__traverse/index.d.ts","../node_modules/@types/babel__core/index.d.ts","../node_modules/@types/node/assert.d.ts","../node_modules/@types/node/assert/strict.d.ts","../node_modules/@types/node/globals.d.ts","../node_modules/@types/node/async_hooks.d.ts","../node_modules/@types/node/buffer.d.ts","../node_modules/@types/node/child_process.d.ts","../node_modules/@types/node/cluster.d.ts","../node_modules/@types/node/console.d.ts","../node_modules/@types/node/constants.d.ts","../node_modules/@types/node/crypto.d.ts","../node_modules/@types/node/dgram.d.ts","../node_modules/@types/node/diagnostics_channel.d.ts","../node_modules/@types/node/dns.d.ts","../node_modules/@types/node/dns/promises.d.ts","../node_modules/@types/node/domain.d.ts","../node_modules/@types/node/events.d.ts","../node_modules/@types/node/fs.d.ts","../node_modules/@types/node/fs/promises.d.ts","../node_modules/@types/node/http.d.ts","../node_modules/@types/node/http2.d.ts","../node_modules/@types/node/https.d.ts","../node_modules/@types/node/inspector.d.ts","../node_modules/@types/node/module.d.ts","../node_modules/@types/node/net.d.ts","../node_modules/@types/node/os.d.ts","../node_modules/@types/node/path.d.ts","../node_modules/@types/node/perf_hooks.d.ts","../node_modules/@types/node/process.d.ts","../node_modules/@types/node/punycode.d.ts","../node_modules/@types/node/querystring.d.ts","../node_modules/@types/node/readline.d.ts","../node_modules/@types/node/repl.d.ts","../node_modules/@types/node/stream.d.ts","../node_modules/@types/node/stream/promises.d.ts","../node_modules/@types/node/stream/consumers.d.ts","../node_modules/@types/node/stream/web.d.ts","../node_modules/@types/node/string_decoder.d.ts","../node_modules/@types/node/timers.d.ts","../node_modules/@types/node/timers/promises.d.ts","../node_modules/@types/node/tls.d.ts","../node_modules/@types/node/trace_events.d.ts","../node_modules/@types/node/tty.d.ts","../node_modules/@types/node/url.d.ts","../node_modules/@types/node/util.d.ts","../node_modules/@types/node/v8.d.ts","../node_modules/@types/node/vm.d.ts","../node_modules/@types/node/wasi.d.ts","../node_modules/@types/node/worker_threads.d.ts","../node_modules/@types/node/zlib.d.ts","../node_modules/@types/node/globals.global.d.ts","../node_modules/@types/node/index.d.ts","../node_modules/@types/graceful-fs/index.d.ts","../node_modules/@types/istanbul-lib-coverage/index.d.ts","../node_modules/@types/istanbul-lib-report/index.d.ts","../node_modules/@types/istanbul-reports/index.d.ts","../node_modules/jest-diff/build/cleanupSemantic.d.ts","../node_modules/pretty-format/build/types.d.ts","../node_modules/pretty-format/build/index.d.ts","../node_modules/jest-diff/build/types.d.ts","../node_modules/jest-diff/build/diffLines.d.ts","../node_modules/jest-diff/build/printDiffs.d.ts","../node_modules/jest-diff/build/index.d.ts","../node_modules/@types/jest/index.d.ts","../node_modules/@types/json-schema/index.d.ts","../node_modules/@types/json5/index.d.ts","../node_modules/@types/prettier/index.d.ts","../node_modules/@types/stack-utils/index.d.ts","../node_modules/@types/yargs-parser/index.d.ts","../node_modules/@types/yargs/index.d.ts"],"fileInfos":[{"version":"89f78430e422a0f06d13019d60d5a45b37ec2d28e67eb647f73b1b0d19a46b72","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84","e21c071ca3e1b4a815d5f04a7475adcaeea5d64367e840dd0154096d705c3940",{"version":"abba1071bfd89e55e88a054b0c851ea3e8a494c340d0f3fab19eb18f6afb0c9e","affectsGlobalScope":true},{"version":"927cb2b60048e1395b183bf74b2b80a75bdb1dbe384e1d9fac654313ea2fb136","affectsGlobalScope":true},{"version":"7fac8cb5fc820bc2a59ae11ef1c5b38d3832c6d0dfaec5acdb5569137d09a481","affectsGlobalScope":true},{"version":"097a57355ded99c68e6df1b738990448e0bf170e606707df5a7c0481ff2427cd","affectsGlobalScope":true},{"version":"d8996609230d17e90484a2dd58f22668f9a05a3bfe00bfb1d6271171e54a31fb","affectsGlobalScope":true},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"4378fc8122ec9d1a685b01eb66c46f62aba6b239ca7228bb6483bcf8259ee493","affectsGlobalScope":true},{"version":"0d5f52b3174bee6edb81260ebcd792692c32c81fd55499d69531496f3f2b25e7","affectsGlobalScope":true},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","affectsGlobalScope":true},{"version":"62d80405c46c3f4c527ee657ae9d43fda65a0bf582292429aea1e69144a522a6","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"1b3fe904465430e030c93239a348f05e1be80640d91f2f004c3512c2c2c89f34","affectsGlobalScope":true},{"version":"3787b83e297de7c315d55d4a7c546ae28e5f6c0a361b7a1dcec1f1f50a54ef11","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"d071129cba6a5f2700be09c86c07ad2791ab67d4e5ed1eb301d6746c62745ea4","affectsGlobalScope":true},{"version":"10bbdc1981b8d9310ee75bfac28ee0477bb2353e8529da8cff7cb26c409cb5e8","affectsGlobalScope":true},"d2f31f19e1ba6ed59be9259d660a239d9a3fcbbc8e038c6b2009bde34b175fed","abcce357d43321346018f0a447aae8396df4b6e3c8a71a07a698852c010659e6","bb859947a395dfe951fa360bcf2fc4c118e97811ae04b811ecabcf066b658299","6327bd2eac3fd3f5c7162a87420cffe58f8c7ba2972ad47e12cef928bd926e29","ece4e030d37b8e3e78f0401d3468251d0ff22ac376c791fb161ca812070b63e6","e1900dd2646a9c2a2360d6aa1ab824aa52350ed4360c6153f030468be39280ca","32e2cd21e5b2b1f554c8b78d526790c53aebde93764ca0a62198a3fafd702ced","481a4131dcbf468c936b2101e8b57aa2e6e06132f6cab7b2da37a346b10e0aef","ec1b879eff21a88a63438fdcba018128906ed10d59929679b2c62b63af87e6ec","1166bf3922f51e926c85bbcf218c191350c4558a91c831e8183b36b781982100","31b7510503d7ed5a8a7c45c1f0e7ab1c9eedd0c674131fd797b371d4285ed518","1d69af3250560dc6bc0384c8defb9476c782acc635dec27b775d2bfa4020ed1e","cd77036919fbfd79beee4883e51cbea06c4f5e9dd61dd636ccf8c6dc03962b3e","ce9361120cf8dab14f969006c491ee03309022d27a194b9e7822eb2fc3f510cf","71b016c31de70df11b74578155fbf01b7b3f2a007ee2a3f664a16e0e3db07a0a","c9a25578762ca94acd867137a9db5466a0d33e8ab037e4f77d9bc077b4c2f831","5c6e80bb32d1a9b7c7651b23b33603a269a27b1b4d0772ef7a3c3d7d81ff8278","22316de0c4d000dc53e1f1739b84eacc9690466f7904efb124efb459d1cf20b5","fc591e99fea917fa85a6df89a530aced1814fa9ddaab578b926aa3da106e6ce4","cec07e0118924c9394ea46459011fc2531d6f8b6022696ea09d89bcdac6fdf62","1b3b9f67d49bcabb897ca45bd81bcc14a1315ee063f2a67848e6463a1c36f787","5c161878b150e2ae1dd3515745873869a94dddc8a5d48635e16e7961ac2e8f50","5f5ce0786dd0036001479787f28bbe7f5a8cb164c40cd6e196ffc387d3acd1a4","272c2dac4baaf7fdd2d7efeef0fa2547af54cc21883c5e138b8c4d1661697a54","8dfed5c91ad36e69e6da6b7e49be929d4e19666db2b651aa839c485170a2902c","64b867c61effed7b5bc0cc06b3d8eac23b067a3fba581fc7d3c292fa593e6a45","93de1c6dab503f053efe8d304cb522bb3a89feab8c98f307a674a4fae04773e9","3b043cf9a81854a72963fdb57d1884fc4da1cf5be69b5e0a4c5b751e58cb6d88","80164ffebe1723a50e020a648e0623c026ff39be13c5cd45e6a82d0fcc06e2d0","0d5a2ee1fdfa82740e0103389b9efd6bfe145a20018a2da3c02b89666181f4d9","a69c09dbea52352f479d3e7ac949fde3d17b195abe90b045d619f747b38d6d1a",{"version":"92d63add669d18ebc349efbacd88966d6f2ccdddfb1b880b2db98ae3aa7bf7c4","affectsGlobalScope":true},"ccc94049a9841fe47abe5baef6be9a38fc6228807974ae675fb15dc22531b4be",{"version":"9acfe4d1ff027015151ce81d60797b04b52bffe97ad8310bb0ec2e8fd61e1303","affectsGlobalScope":true},"95843d5cfafced8f3f8a5ce57d2335f0bcd361b9483587d12a25e4bd403b8216","afc6e96061af46bcff47246158caee7e056f5288783f2d83d6858cd25be1c565",{"version":"34f5bcac12b36d70304b73de5f5aab3bb91bd9919f984be80579ebcad03a624e","affectsGlobalScope":true},"82408ed3e959ddc60d3e9904481b5a8dc16469928257af22a3f7d1a3bc7fd8c4","2f520601649a893e6a49a8851ebfcf4be8ce090dc1281c2a08a871cb04e8251f","f50c975ab7b50e25a69e3d8a3773894125b44e9698924105f23b812bf7488baf","2b8c764f856a1dd0a9a2bf23e5efddbff157de8138b0754010be561ae5fcaa90","76650408392bf49a8fbf3e2b6b302712a92d76af77b06e2da1cc8077359c4409","0af3121e68297b2247dd331c0d24dba599e50736a7517a5622d5591aae4a3122","6972fca26f6e9bd56197568d4379f99071a90766e06b4fcb5920a0130a9202be",{"version":"4a2628e95962c8ab756121faa3ac2ed348112ff7a87b5c286dd2cc3326546b4c","affectsGlobalScope":true},"80793b2277f31baa199234daed806fff0fb11491d1ebd3357e520c3558063f00","a049a59a02009fc023684fcfaf0ac526fe36c35dcc5d2b7d620c1750ba11b083","b9b963043551b034abd9e7c6d859f7a81d99479fde938d983114d167d0644a78","b287b810b5035d5685f1df6e1e418f1ca452a3ed4f59fd5cc081dbf2045f0d9b","4b9a003b5c556c96784132945bb41c655ea11273b1917f5c8d0c154dd5fd20dd","a458dc78104cc80048ac24fdc02fe6dce254838094c2f25641b3f954d9721241",{"version":"e8b18c6385ff784228a6f369694fcf1a6b475355ba89090a88de13587a9391d5","affectsGlobalScope":true},"902cd98bf46e95caf4118a0733fb801e9e90eec3edaed6abdad77124afec9ca2","abc1c425b2ad6720433f40f1877abfa4223f0f3dd486c9c28c492179ca183cb6","cd4854d38f4eb5592afd98ab95ca17389a7dfe38013d9079e802d739bdbcc939","94eed4cc2f5f658d5e229ff1ccd38860bddf4233e347bf78edd2154dee1f2b99",{"version":"bd1a08e30569b0fb2f0b21035eb9b039871f68faa9b98accf847e9c878c5e0a9","affectsGlobalScope":true},"9f1069b9e2c051737b1f9b4f1baf50e4a63385a6a89c32235549ae87fc3d5492","ee18f2da7a037c6ceeb112a084e485aead9ea166980bf433474559eac1b46553","29c2706fa0cc49a2bd90c83234da33d08bb9554ecec675e91c1f85087f5a5324","0acbf26bf958f9e80c1ffa587b74749d2697b75b484062d36e103c137c562bc3","d7838022c7dab596357a9604b9c6adffe37dc34085ce0779c958ce9545bd7139","1b952304137851e45bc009785de89ada562d9376177c97e37702e39e60c2f1ff",{"version":"806ef4cac3b3d9fa4a48d849c8e084d7c72fcd7b16d76e06049a9ed742ff79c0","affectsGlobalScope":true},"a7971f9fb2a32ec7788ec6cda9d7a33c02023dfe9a62db2030ad1359649d8050","c33a6ea7147af60d8e98f1ac127047f4b0d4e2ce28b8f08ff3de07ca7cc00637",{"version":"b42b47e17b8ece2424ae8039feb944c2e3ba4b262986aebd582e51efbdca93dc","affectsGlobalScope":true},"664d8f2d59164f2e08c543981453893bc7e003e4dfd29651ce09db13e9457980","2408611d9b4146e35d1dbd1f443ccd8e187c74614a54b80300728277529dbf11","998a3de5237518c0b3ac00a11b3b4417affb008aa20aedee52f3fdae3cb86151","ad41008ffe077206e1811fc873f4d9005b5fd7f6ab52bb6118fef600815a5cb4","d88ecca73348e7c337541c4b8b60a50aca5e87384f6b8a422fc6603c637e4c21","badae0df9a8016ac36994b0a0e7b82ba6aaa3528e175a8c3cb161e4683eec03e","c3db860bcaaaeb3bbc23f353bbda1f8ab82756c8d5e973bebb3953cb09ea68f2","235a53595bd20b0b0eeb1a29cb2887c67c48375e92f03749b2488fbd46d0b1a0","bc09393cd4cd13f69cf1366d4236fbae5359bb550f0de4e15767e9a91d63dfb1","9c266243b01545e11d2733a55ad02b4c00ecdbda99c561cd1674f96e89cdc958","c71155c05fc76ff948a4759abc1cb9feec036509f500174bc18dad4c7827a60c",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"1cdb8f094b969dcc183745dc88404e2d8fcf2a858c6e7cc2441011476573238e","3ebae8c00411116a66fca65b08228ea0cf0b72724701f9b854442100aab55aba","de18acda71730bac52f4b256ce7511bb56cc21f6f114c59c46782eff2f632857","7eb06594824ada538b1d8b48c3925a83e7db792f47a081a62cf3e5c4e23cf0ee","f5638f7c2f12a9a1a57b5c41b3c1ea7db3876c003bab68e6a57afd6bcc169af0","d8aab31ba8e618cc3eea10b0945de81cb93b7e8150a013a482332263b9305322","462bccdf75fcafc1ae8c30400c9425e1a4681db5d605d1a0edb4f990a54d8094","5923d8facbac6ecf7c84739a5c701a57af94a6f6648d6229a6c768cf28f0f8cb","7adecb2c3238794c378d336a8182d4c3dd2c4fa6fa1785e2797a3db550edea62","dc12dc0e5aa06f4e1a7692149b78f89116af823b9e1f1e4eae140cd3e0e674e6","1bfc6565b90c8771615cd8cfcf9b36efc0275e5e83ac7d9181307e96eb495161","8a8a96898906f065f296665e411f51010b51372fa260d5373bf9f64356703190",{"version":"e9f2cdc4e98e73a606ff68c470a8cb4f23cd638c47649d71b90a2d9413102080","affectsGlobalScope":true},"0359682c54e487c4cab2b53b2b4d35cc8dea4d9914bc6abcdb5701f8b8e745a4","96d14f21b7652903852eef49379d04dbda28c16ed36468f8c9fa08f7c14c9538","9d9e658d1d5b805562749ce383ef8c67ccb796394d8734d9c138788d7dab6ee3","b0d10e46cfe3f6c476b69af02eaa38e4ccc7430221ce3109ae84bb9fb8282298","f7e133b20ee2669b6c0e5d7f0cd510868c57cd64b283e68c7f598e30ce9d76d2","6ba73232c9d3267ca36ddb83e335d474d2c0e167481e3dec416c782894e11438"],"options":{"composite":true,"declaration":true,"esModuleInterop":true,"module":1,"outDir":"./","strict":true,"target":4},"fileIdsList":[[66,115],[115],[66,67,68,69,70,115],[66,68,115],[88,115,122],[115,124],[115,125],[115,129,133],[72,115],[75,115],[76,81,115],[77,87,88,95,104,114,115],[77,78,87,95,115],[79,115],[80,81,88,96,115],[81,104,111,115],[82,84,87,95,115],[83,115],[84,85,115],[86,87,115],[87,115],[87,88,89,104,114,115],[87,88,89,104,115],[90,95,104,114,115],[87,88,90,91,95,104,111,114,115],[90,92,104,111,114,115],[72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121],[87,93,115],[94,114,115],[84,87,95,104,115],[96,115],[97,115],[75,98,115],[99,113,115,119],[100,115],[101,115],[87,102,115],[102,103,115,117],[87,104,105,106,115],[104,106,115],[104,105,115],[107,115],[108,115],[87,109,110,115],[109,110,115],[81,95,111,115],[112,115],[95,113,115],[76,90,101,114,115],[81,115],[104,115,116],[115,117],[115,118],[76,81,87,89,98,104,114,115,117,119],[104,115,120],[115,139],[115,127,130],[115,127,130,131,132],[115,129],[115,128],[44,45,115],[45,55,64,115],[44,115],[47,115],[44,45,47,52,55,64,115],[47,54,63,115],[44,45,47,53,54,63,115],[47,48,115],[47,48,56,115],[47,49,50,51,57,58,59,60,61,62,115]],"referencedMap":[[68,1],[66,2],[71,3],[67,1],[69,4],[70,1],[123,5],[124,2],[125,6],[126,7],[134,8],[135,2],[136,2],[72,9],[73,9],[75,10],[76,11],[77,12],[78,13],[79,14],[80,15],[81,16],[82,17],[83,18],[84,19],[85,19],[86,20],[87,21],[88,22],[89,23],[74,2],[121,2],[90,24],[91,25],[92,26],[122,27],[93,28],[94,29],[95,30],[96,31],[97,32],[98,33],[99,34],[100,35],[101,36],[102,37],[103,38],[104,39],[106,40],[105,41],[107,42],[108,43],[109,44],[110,45],[111,46],[112,47],[113,48],[114,49],[115,50],[116,51],[117,52],[118,53],[119,54],[120,55],[137,2],[138,2],[139,2],[140,56],[127,2],[131,57],[133,58],[132,57],[130,59],[129,60],[128,2],[8,2],[9,2],[13,2],[12,2],[2,2],[14,2],[15,2],[16,2],[17,2],[18,2],[19,2],[20,2],[21,2],[3,2],[4,2],[43,2],[25,2],[22,2],[23,2],[24,2],[26,2],[27,2],[28,2],[5,2],[29,2],[30,2],[31,2],[32,2],[6,2],[33,2],[34,2],[35,2],[36,2],[7,2],[41,2],[37,2],[38,2],[39,2],[40,2],[1,2],[42,2],[11,2],[10,2],[46,61],[65,62],[47,63],[52,64],[56,65],[64,66],[45,63],[55,67],[53,64],[49,68],[50,68],[51,68],[57,69],[58,68],[59,68],[60,68],[61,68],[62,68],[63,70],[48,64],[44,2],[54,64]],"exportedModulesMap":[[68,1],[66,2],[71,3],[67,1],[69,4],[70,1],[123,5],[124,2],[125,6],[126,7],[134,8],[135,2],[136,2],[72,9],[73,9],[75,10],[76,11],[77,12],[78,13],[79,14],[80,15],[81,16],[82,17],[83,18],[84,19],[85,19],[86,20],[87,21],[88,22],[89,23],[74,2],[121,2],[90,24],[91,25],[92,26],[122,27],[93,28],[94,29],[95,30],[96,31],[97,32],[98,33],[99,34],[100,35],[101,36],[102,37],[103,38],[104,39],[106,40],[105,41],[107,42],[108,43],[109,44],[110,45],[111,46],[112,47],[113,48],[114,49],[115,50],[116,51],[117,52],[118,53],[119,54],[120,55],[137,2],[138,2],[139,2],[140,56],[127,2],[131,57],[133,58],[132,57],[130,59],[129,60],[128,2],[8,2],[9,2],[13,2],[12,2],[2,2],[14,2],[15,2],[16,2],[17,2],[18,2],[19,2],[20,2],[21,2],[3,2],[4,2],[43,2],[25,2],[22,2],[23,2],[24,2],[26,2],[27,2],[28,2],[5,2],[29,2],[30,2],[31,2],[32,2],[6,2],[33,2],[34,2],[35,2],[36,2],[7,2],[41,2],[37,2],[38,2],[39,2],[40,2],[1,2],[42,2],[11,2],[10,2],[46,61],[65,62],[47,63],[52,64],[56,65],[64,66],[45,63],[55,67],[53,64],[49,68],[50,68],[51,68],[57,69],[58,68],[59,68],[60,68],[61,68],[62,68],[63,70],[48,64],[44,2],[54,64]],"semanticDiagnosticsPerFile":[68,66,71,67,69,70,123,124,125,126,134,135,136,72,73,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,74,121,90,91,92,122,93,94,95,96,97,98,99,100,101,102,103,104,106,105,107,108,109,110,111,112,113,114,115,116,117,118,119,120,137,138,139,140,127,131,133,132,130,129,128,8,9,13,12,2,14,15,16,17,18,19,20,21,3,4,43,25,22,23,24,26,27,28,5,29,30,31,32,6,33,34,35,36,7,41,37,38,39,40,1,42,11,10,46,65,47,52,56,64,45,55,53,49,50,51,57,58,59,60,61,62,63,48,44,54]},"version":"4.5.4"}
|
package/package.json
CHANGED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ApplyStructSpreadsVisitor = void 0;
|
|
4
|
-
const ast_1 = require("../ast");
|
|
5
|
-
const visitor_1 = require("./visitor");
|
|
6
|
-
class ApplyStructSpreadsVisitor extends visitor_1.Visitor {
|
|
7
|
-
constructor() {
|
|
8
|
-
super(...arguments);
|
|
9
|
-
/*
|
|
10
|
-
* Here we may visit the same struct multiple times
|
|
11
|
-
* We must make sure we only process each one once
|
|
12
|
-
*/
|
|
13
|
-
this.processed = new Set();
|
|
14
|
-
}
|
|
15
|
-
visit(node) {
|
|
16
|
-
if (node instanceof ast_1.StructType) {
|
|
17
|
-
if (this.processed.has(node)) {
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
this.processed.add(node);
|
|
21
|
-
}
|
|
22
|
-
super.visit(node);
|
|
23
|
-
if (node instanceof ast_1.StructType) {
|
|
24
|
-
for (const other of node.spreads.map(t => t.type)) {
|
|
25
|
-
if (!(other instanceof ast_1.StructType)) {
|
|
26
|
-
throw new visitor_1.SemanticError(`A spread operator in a struct can't refer to something that is not a struct, in '${node.name}' at ${node.location}.`);
|
|
27
|
-
}
|
|
28
|
-
this.visit(other); // Recursion!
|
|
29
|
-
for (const otherField of other.fields) {
|
|
30
|
-
const existingIdx = node.fields.findIndex(f => f.name === otherField.name);
|
|
31
|
-
if (existingIdx >= 0) {
|
|
32
|
-
node.fields[existingIdx] = otherField;
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
node.fields.push(otherField);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
exports.ApplyStructSpreadsVisitor = ApplyStructSpreadsVisitor;
|