Skip to content

Commit e17acc7

Browse files
authored
merge dev to main (#340)
2 parents e3993c5 + d996d09 commit e17acc7

39 files changed

+1046
-405
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "zenstack-monorepo",
3-
"version": "1.0.0-alpha.98",
3+
"version": "1.0.0-alpha.99",
44
"description": "",
55
"scripts": {
66
"build": "pnpm -r build",

packages/language/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@zenstackhq/language",
3-
"version": "1.0.0-alpha.98",
3+
"version": "1.0.0-alpha.99",
44
"displayName": "ZenStack modeling language compiler",
55
"description": "ZenStack modeling language compiler",
66
"homepage": "https://zenstack.dev",

packages/language/src/generated/ast.ts

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ export function isReferenceTarget(item: unknown): item is ReferenceTarget {
4444
return reflection.isInstance(item, ReferenceTarget);
4545
}
4646

47+
export type RegularID = 'in' | string;
48+
4749
export type TypeDeclaration = DataModel | Enum;
4850

4951
export const TypeDeclaration = 'TypeDeclaration';
@@ -55,7 +57,7 @@ export function isTypeDeclaration(item: unknown): item is TypeDeclaration {
5557
export interface Argument extends AstNode {
5658
readonly $container: InvocationExpr;
5759
readonly $type: 'Argument';
58-
name?: string
60+
name?: RegularID
5961
value: Expression
6062
}
6163

@@ -94,7 +96,7 @@ export function isAttribute(item: unknown): item is Attribute {
9496
export interface AttributeArg extends AstNode {
9597
readonly $container: AttributeAttribute | DataModelAttribute | DataModelFieldAttribute;
9698
readonly $type: 'AttributeArg';
97-
name?: string
99+
name?: RegularID
98100
value: Expression
99101
}
100102

@@ -121,7 +123,7 @@ export interface AttributeParam extends AstNode {
121123
readonly $container: Attribute;
122124
readonly $type: 'AttributeParam';
123125
default: boolean
124-
name: string
126+
name: RegularID
125127
type: AttributeParamType
126128
}
127129

@@ -166,7 +168,7 @@ export interface DataModel extends AstNode {
166168
attributes: Array<DataModelAttribute>
167169
comments: Array<string>
168170
fields: Array<DataModelField>
169-
name: string
171+
name: RegularID
170172
}
171173

172174
export const DataModel = 'DataModel';
@@ -193,7 +195,7 @@ export interface DataModelField extends AstNode {
193195
readonly $type: 'DataModelField';
194196
attributes: Array<DataModelFieldAttribute>
195197
comments: Array<string>
196-
name: string
198+
name: RegularID
197199
type: DataModelFieldType
198200
}
199201

@@ -235,7 +237,7 @@ export interface DataSource extends AstNode {
235237
readonly $container: Model;
236238
readonly $type: 'DataSource';
237239
fields: Array<DataSourceField>
238-
name: string
240+
name: RegularID
239241
}
240242

241243
export const DataSource = 'DataSource';
@@ -247,7 +249,7 @@ export function isDataSource(item: unknown): item is DataSource {
247249
export interface DataSourceField extends AstNode {
248250
readonly $container: DataSource;
249251
readonly $type: 'DataSourceField';
250-
name: string
252+
name: RegularID
251253
value: ArrayExpr | InvocationExpr | LiteralExpr
252254
}
253255

@@ -263,7 +265,7 @@ export interface Enum extends AstNode {
263265
attributes: Array<DataModelAttribute>
264266
comments: Array<string>
265267
fields: Array<EnumField>
266-
name: string
268+
name: RegularID
267269
}
268270

269271
export const Enum = 'Enum';
@@ -277,7 +279,7 @@ export interface EnumField extends AstNode {
277279
readonly $type: 'EnumField';
278280
attributes: Array<DataModelFieldAttribute>
279281
comments: Array<string>
280-
name: string
282+
name: RegularID
281283
}
282284

283285
export const EnumField = 'EnumField';
@@ -289,7 +291,7 @@ export function isEnumField(item: unknown): item is EnumField {
289291
export interface FieldInitializer extends AstNode {
290292
readonly $container: ObjectExpr;
291293
readonly $type: 'FieldInitializer';
292-
name: string
294+
name: RegularID
293295
value: Expression
294296
}
295297

@@ -303,7 +305,7 @@ export interface FunctionDecl extends AstNode {
303305
readonly $container: Model;
304306
readonly $type: 'FunctionDecl';
305307
expression?: Expression
306-
name: string
308+
name: RegularID
307309
params: Array<FunctionParam>
308310
returnType: FunctionParamType
309311
}
@@ -317,7 +319,7 @@ export function isFunctionDecl(item: unknown): item is FunctionDecl {
317319
export interface FunctionParam extends AstNode {
318320
readonly $container: DataModel | Enum | FunctionDecl;
319321
readonly $type: 'FunctionParam';
320-
name: string
322+
name: RegularID
321323
optional: boolean
322324
type: FunctionParamType
323325
}
@@ -346,7 +348,7 @@ export interface GeneratorDecl extends AstNode {
346348
readonly $container: Model;
347349
readonly $type: 'GeneratorDecl';
348350
fields: Array<GeneratorField>
349-
name: string
351+
name: RegularID
350352
}
351353

352354
export const GeneratorDecl = 'GeneratorDecl';
@@ -358,7 +360,7 @@ export function isGeneratorDecl(item: unknown): item is GeneratorDecl {
358360
export interface GeneratorField extends AstNode {
359361
readonly $container: GeneratorDecl;
360362
readonly $type: 'GeneratorField';
361-
name: string
363+
name: RegularID
362364
value: ArrayExpr | LiteralExpr
363365
}
364366

@@ -445,7 +447,7 @@ export interface Plugin extends AstNode {
445447
readonly $container: Model;
446448
readonly $type: 'Plugin';
447449
fields: Array<PluginField>
448-
name: string
450+
name: RegularID
449451
}
450452

451453
export const Plugin = 'Plugin';
@@ -457,8 +459,8 @@ export function isPlugin(item: unknown): item is Plugin {
457459
export interface PluginField extends AstNode {
458460
readonly $container: Plugin;
459461
readonly $type: 'PluginField';
460-
name: string
461-
value: ArrayExpr | LiteralExpr
462+
name: RegularID
463+
value: ArrayExpr | LiteralExpr | ObjectExpr
462464
}
463465

464466
export const PluginField = 'PluginField';

0 commit comments

Comments
 (0)