@@ -44,6 +44,8 @@ export function isReferenceTarget(item: unknown): item is ReferenceTarget {
44
44
return reflection . isInstance ( item , ReferenceTarget ) ;
45
45
}
46
46
47
+ export type RegularID = 'in' | string ;
48
+
47
49
export type TypeDeclaration = DataModel | Enum ;
48
50
49
51
export const TypeDeclaration = 'TypeDeclaration' ;
@@ -55,7 +57,7 @@ export function isTypeDeclaration(item: unknown): item is TypeDeclaration {
55
57
export interface Argument extends AstNode {
56
58
readonly $container : InvocationExpr ;
57
59
readonly $type : 'Argument' ;
58
- name ?: string
60
+ name ?: RegularID
59
61
value : Expression
60
62
}
61
63
@@ -94,7 +96,7 @@ export function isAttribute(item: unknown): item is Attribute {
94
96
export interface AttributeArg extends AstNode {
95
97
readonly $container : AttributeAttribute | DataModelAttribute | DataModelFieldAttribute ;
96
98
readonly $type : 'AttributeArg' ;
97
- name ?: string
99
+ name ?: RegularID
98
100
value : Expression
99
101
}
100
102
@@ -121,7 +123,7 @@ export interface AttributeParam extends AstNode {
121
123
readonly $container : Attribute ;
122
124
readonly $type : 'AttributeParam' ;
123
125
default : boolean
124
- name : string
126
+ name : RegularID
125
127
type : AttributeParamType
126
128
}
127
129
@@ -166,7 +168,7 @@ export interface DataModel extends AstNode {
166
168
attributes : Array < DataModelAttribute >
167
169
comments : Array < string >
168
170
fields : Array < DataModelField >
169
- name : string
171
+ name : RegularID
170
172
}
171
173
172
174
export const DataModel = 'DataModel' ;
@@ -193,7 +195,7 @@ export interface DataModelField extends AstNode {
193
195
readonly $type : 'DataModelField' ;
194
196
attributes : Array < DataModelFieldAttribute >
195
197
comments : Array < string >
196
- name : string
198
+ name : RegularID
197
199
type : DataModelFieldType
198
200
}
199
201
@@ -235,7 +237,7 @@ export interface DataSource extends AstNode {
235
237
readonly $container : Model ;
236
238
readonly $type : 'DataSource' ;
237
239
fields : Array < DataSourceField >
238
- name : string
240
+ name : RegularID
239
241
}
240
242
241
243
export const DataSource = 'DataSource' ;
@@ -247,7 +249,7 @@ export function isDataSource(item: unknown): item is DataSource {
247
249
export interface DataSourceField extends AstNode {
248
250
readonly $container : DataSource ;
249
251
readonly $type : 'DataSourceField' ;
250
- name : string
252
+ name : RegularID
251
253
value : ArrayExpr | InvocationExpr | LiteralExpr
252
254
}
253
255
@@ -263,7 +265,7 @@ export interface Enum extends AstNode {
263
265
attributes : Array < DataModelAttribute >
264
266
comments : Array < string >
265
267
fields : Array < EnumField >
266
- name : string
268
+ name : RegularID
267
269
}
268
270
269
271
export const Enum = 'Enum' ;
@@ -277,7 +279,7 @@ export interface EnumField extends AstNode {
277
279
readonly $type : 'EnumField' ;
278
280
attributes : Array < DataModelFieldAttribute >
279
281
comments : Array < string >
280
- name : string
282
+ name : RegularID
281
283
}
282
284
283
285
export const EnumField = 'EnumField' ;
@@ -289,7 +291,7 @@ export function isEnumField(item: unknown): item is EnumField {
289
291
export interface FieldInitializer extends AstNode {
290
292
readonly $container : ObjectExpr ;
291
293
readonly $type : 'FieldInitializer' ;
292
- name : string
294
+ name : RegularID
293
295
value : Expression
294
296
}
295
297
@@ -303,7 +305,7 @@ export interface FunctionDecl extends AstNode {
303
305
readonly $container : Model ;
304
306
readonly $type : 'FunctionDecl' ;
305
307
expression ?: Expression
306
- name : string
308
+ name : RegularID
307
309
params : Array < FunctionParam >
308
310
returnType : FunctionParamType
309
311
}
@@ -317,7 +319,7 @@ export function isFunctionDecl(item: unknown): item is FunctionDecl {
317
319
export interface FunctionParam extends AstNode {
318
320
readonly $container : DataModel | Enum | FunctionDecl ;
319
321
readonly $type : 'FunctionParam' ;
320
- name : string
322
+ name : RegularID
321
323
optional : boolean
322
324
type : FunctionParamType
323
325
}
@@ -346,7 +348,7 @@ export interface GeneratorDecl extends AstNode {
346
348
readonly $container : Model ;
347
349
readonly $type : 'GeneratorDecl' ;
348
350
fields : Array < GeneratorField >
349
- name : string
351
+ name : RegularID
350
352
}
351
353
352
354
export const GeneratorDecl = 'GeneratorDecl' ;
@@ -358,7 +360,7 @@ export function isGeneratorDecl(item: unknown): item is GeneratorDecl {
358
360
export interface GeneratorField extends AstNode {
359
361
readonly $container : GeneratorDecl ;
360
362
readonly $type : 'GeneratorField' ;
361
- name : string
363
+ name : RegularID
362
364
value : ArrayExpr | LiteralExpr
363
365
}
364
366
@@ -445,7 +447,7 @@ export interface Plugin extends AstNode {
445
447
readonly $container : Model ;
446
448
readonly $type : 'Plugin' ;
447
449
fields : Array < PluginField >
448
- name : string
450
+ name : RegularID
449
451
}
450
452
451
453
export const Plugin = 'Plugin' ;
@@ -457,8 +459,8 @@ export function isPlugin(item: unknown): item is Plugin {
457
459
export interface PluginField extends AstNode {
458
460
readonly $container : Plugin ;
459
461
readonly $type : 'PluginField' ;
460
- name : string
461
- value : ArrayExpr | LiteralExpr
462
+ name : RegularID
463
+ value : ArrayExpr | LiteralExpr | ObjectExpr
462
464
}
463
465
464
466
export const PluginField = 'PluginField' ;
0 commit comments