@zenstackhq/language
Advanced tools
Comparing version 2.8.0 to 2.8.1
@@ -47,2 +47,5 @@ /****************************************************************************** | ||
export declare function isTypeDeclaration(item: unknown): item is TypeDeclaration; | ||
export type TypeDefFieldTypes = Enum | TypeDef; | ||
export declare const TypeDefFieldTypes = "TypeDefFieldTypes"; | ||
export declare function isTypeDefFieldTypes(item: unknown): item is TypeDefFieldTypes; | ||
export interface Argument extends AstNode { | ||
@@ -399,3 +402,3 @@ readonly $container: InvocationExpr; | ||
optional: boolean; | ||
reference?: Reference<TypeDef>; | ||
reference?: Reference<TypeDefFieldTypes>; | ||
type?: BuiltinType; | ||
@@ -469,2 +472,3 @@ } | ||
TypeDefFieldType: TypeDefFieldType; | ||
TypeDefFieldTypes: TypeDefFieldTypes; | ||
UnaryExpr: UnaryExpr; | ||
@@ -471,0 +475,0 @@ UnsupportedFieldType: UnsupportedFieldType; |
@@ -7,4 +7,4 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.UnaryExpr = exports.TypeDefFieldType = exports.TypeDefField = exports.TypeDef = exports.ThisExpr = exports.StringLiteral = exports.ReferenceExpr = exports.ReferenceArg = exports.PluginField = exports.Plugin = exports.ObjectExpr = exports.NumberLiteral = exports.NullExpr = exports.ModelImport = exports.Model = exports.MemberAccessExpr = exports.InvocationExpr = exports.InternalAttribute = exports.GeneratorDecl = exports.FunctionParamType = exports.FunctionParam = exports.FunctionDecl = exports.FieldInitializer = exports.EnumField = exports.Enum = exports.DataSource = exports.DataModelFieldType = exports.DataModelFieldAttribute = exports.DataModelField = exports.DataModelAttribute = exports.DataModel = exports.ConfigInvocationExpr = exports.ConfigInvocationArg = exports.ConfigField = exports.ConfigArrayExpr = exports.BooleanLiteral = exports.BinaryExpr = exports.AttributeParamType = exports.AttributeParam = exports.AttributeArg = exports.Attribute = exports.ArrayExpr = exports.Argument = exports.TypeDeclaration = exports.ReferenceTarget = exports.LiteralExpr = exports.Expression = exports.ConfigExpr = exports.AbstractDeclaration = exports.ZModelTerminals = void 0; | ||
exports.reflection = exports.ZModelAstReflection = exports.UnsupportedFieldType = void 0; | ||
exports.TypeDefFieldType = exports.TypeDefField = exports.TypeDef = exports.ThisExpr = exports.StringLiteral = exports.ReferenceExpr = exports.ReferenceArg = exports.PluginField = exports.Plugin = exports.ObjectExpr = exports.NumberLiteral = exports.NullExpr = exports.ModelImport = exports.Model = exports.MemberAccessExpr = exports.InvocationExpr = exports.InternalAttribute = exports.GeneratorDecl = exports.FunctionParamType = exports.FunctionParam = exports.FunctionDecl = exports.FieldInitializer = exports.EnumField = exports.Enum = exports.DataSource = exports.DataModelFieldType = exports.DataModelFieldAttribute = exports.DataModelField = exports.DataModelAttribute = exports.DataModel = exports.ConfigInvocationExpr = exports.ConfigInvocationArg = exports.ConfigField = exports.ConfigArrayExpr = exports.BooleanLiteral = exports.BinaryExpr = exports.AttributeParamType = exports.AttributeParam = exports.AttributeArg = exports.Attribute = exports.ArrayExpr = exports.Argument = exports.TypeDefFieldTypes = exports.TypeDeclaration = exports.ReferenceTarget = exports.LiteralExpr = exports.Expression = exports.ConfigExpr = exports.AbstractDeclaration = exports.ZModelTerminals = void 0; | ||
exports.reflection = exports.ZModelAstReflection = exports.UnsupportedFieldType = exports.UnaryExpr = void 0; | ||
exports.isAbstractDeclaration = isAbstractDeclaration; | ||
@@ -21,2 +21,3 @@ exports.isBoolean = isBoolean; | ||
exports.isTypeDeclaration = isTypeDeclaration; | ||
exports.isTypeDefFieldTypes = isTypeDefFieldTypes; | ||
exports.isArgument = isArgument; | ||
@@ -118,2 +119,6 @@ exports.isArrayExpr = isArrayExpr; | ||
} | ||
exports.TypeDefFieldTypes = 'TypeDefFieldTypes'; | ||
function isTypeDefFieldTypes(item) { | ||
return exports.reflection.isInstance(item, exports.TypeDefFieldTypes); | ||
} | ||
exports.Argument = 'Argument'; | ||
@@ -297,3 +302,3 @@ function isArgument(item) { | ||
getAllTypes() { | ||
return ['AbstractDeclaration', 'Argument', 'ArrayExpr', 'Attribute', 'AttributeArg', 'AttributeParam', 'AttributeParamType', 'BinaryExpr', 'BooleanLiteral', 'ConfigArrayExpr', 'ConfigExpr', 'ConfigField', 'ConfigInvocationArg', 'ConfigInvocationExpr', 'DataModel', 'DataModelAttribute', 'DataModelField', 'DataModelFieldAttribute', 'DataModelFieldType', 'DataSource', 'Enum', 'EnumField', 'Expression', 'FieldInitializer', 'FunctionDecl', 'FunctionParam', 'FunctionParamType', 'GeneratorDecl', 'InternalAttribute', 'InvocationExpr', 'LiteralExpr', 'MemberAccessExpr', 'Model', 'ModelImport', 'NullExpr', 'NumberLiteral', 'ObjectExpr', 'Plugin', 'PluginField', 'ReferenceArg', 'ReferenceExpr', 'ReferenceTarget', 'StringLiteral', 'ThisExpr', 'TypeDeclaration', 'TypeDef', 'TypeDefField', 'TypeDefFieldType', 'UnaryExpr', 'UnsupportedFieldType']; | ||
return ['AbstractDeclaration', 'Argument', 'ArrayExpr', 'Attribute', 'AttributeArg', 'AttributeParam', 'AttributeParamType', 'BinaryExpr', 'BooleanLiteral', 'ConfigArrayExpr', 'ConfigExpr', 'ConfigField', 'ConfigInvocationArg', 'ConfigInvocationExpr', 'DataModel', 'DataModelAttribute', 'DataModelField', 'DataModelFieldAttribute', 'DataModelFieldType', 'DataSource', 'Enum', 'EnumField', 'Expression', 'FieldInitializer', 'FunctionDecl', 'FunctionParam', 'FunctionParamType', 'GeneratorDecl', 'InternalAttribute', 'InvocationExpr', 'LiteralExpr', 'MemberAccessExpr', 'Model', 'ModelImport', 'NullExpr', 'NumberLiteral', 'ObjectExpr', 'Plugin', 'PluginField', 'ReferenceArg', 'ReferenceExpr', 'ReferenceTarget', 'StringLiteral', 'ThisExpr', 'TypeDeclaration', 'TypeDef', 'TypeDefField', 'TypeDefFieldType', 'TypeDefFieldTypes', 'UnaryExpr', 'UnsupportedFieldType']; | ||
} | ||
@@ -327,5 +332,3 @@ computeIsSubtype(subtype, supertype) { | ||
} | ||
case exports.DataModel: | ||
case exports.Enum: | ||
case exports.TypeDef: { | ||
case exports.DataModel: { | ||
return this.isSubtype(exports.AbstractDeclaration, supertype) || this.isSubtype(exports.TypeDeclaration, supertype); | ||
@@ -338,2 +341,6 @@ } | ||
} | ||
case exports.Enum: | ||
case exports.TypeDef: { | ||
return this.isSubtype(exports.AbstractDeclaration, supertype) || this.isSubtype(exports.TypeDeclaration, supertype) || this.isSubtype(exports.TypeDefFieldTypes, supertype); | ||
} | ||
case exports.InvocationExpr: | ||
@@ -374,3 +381,3 @@ case exports.LiteralExpr: { | ||
case 'TypeDefFieldType:reference': { | ||
return exports.TypeDef; | ||
return exports.TypeDefFieldTypes; | ||
} | ||
@@ -377,0 +384,0 @@ default: { |
{ | ||
"name": "@zenstackhq/language", | ||
"version": "2.8.0", | ||
"version": "2.8.1", | ||
"displayName": "ZenStack modeling language compiler", | ||
@@ -5,0 +5,0 @@ "description": "ZenStack modeling language compiler", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
180709
5230