@zenstackhq/language 2.15.1 → 3.0.0-alpha.0
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/LICENSE +1 -1
- package/dist/ast.cjs +1472 -0
- package/dist/ast.cjs.map +1 -0
- package/dist/ast.d.cts +566 -0
- package/dist/ast.d.ts +566 -0
- package/dist/ast.js +1331 -0
- package/dist/ast.js.map +1 -0
- package/dist/index.cjs +7790 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +94 -0
- package/dist/index.d.ts +94 -0
- package/dist/index.js +7755 -0
- package/dist/index.js.map +1 -0
- package/package.json +52 -33
- package/res/stdlib.zmodel +721 -0
- package/README.md +0 -5
- package/ast.d.ts +0 -55
- package/ast.js +0 -37
- package/ast.js.map +0 -1
- package/generated/ast.d.ts +0 -485
- package/generated/ast.js +0 -640
- package/generated/ast.js.map +0 -1
- package/generated/grammar.d.ts +0 -6
- package/generated/grammar.js +0 -3941
- package/generated/grammar.js.map +0 -1
- package/generated/module.d.ts +0 -12
- package/generated/module.js +0 -23
- package/generated/module.js.map +0 -1
- package/module.d.ts +0 -1
- package/module.js +0 -18
- package/module.js.map +0 -1
- package/syntaxes/zmodel.tmLanguage +0 -113
- package/syntaxes/zmodel.tmLanguage.json +0 -71
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { ValidationAcceptor, Module, DeepPartial } from 'langium';
|
|
2
|
+
import * as langium_lsp from 'langium/lsp';
|
|
3
|
+
import { LangiumServices, PartialLangiumServices, LangiumSharedServices, DefaultSharedModuleContext } from 'langium/lsp';
|
|
4
|
+
import { Model, DataSource, DataModel, TypeDef, Enum, Attribute, Expression, InvocationExpr, FunctionDecl } from './ast.cjs';
|
|
5
|
+
|
|
6
|
+
/******************************************************************************
|
|
7
|
+
* This file was generated by langium-cli 3.3.0.
|
|
8
|
+
* DO NOT EDIT MANUALLY!
|
|
9
|
+
******************************************************************************/
|
|
10
|
+
|
|
11
|
+
declare const ZModelLanguageMetaData: {
|
|
12
|
+
readonly languageId: "zmodel";
|
|
13
|
+
readonly fileExtensions: readonly [".zmodel"];
|
|
14
|
+
readonly caseInsensitive: false;
|
|
15
|
+
readonly mode: "development";
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Implementation of custom validations.
|
|
20
|
+
*/
|
|
21
|
+
declare class ZModelValidator {
|
|
22
|
+
protected readonly services: ZModelServices;
|
|
23
|
+
constructor(services: ZModelServices);
|
|
24
|
+
private shouldCheck;
|
|
25
|
+
checkModel(node: Model, accept: ValidationAcceptor): void;
|
|
26
|
+
checkDataSource(node: DataSource, accept: ValidationAcceptor): void;
|
|
27
|
+
checkDataModel(node: DataModel, accept: ValidationAcceptor): void;
|
|
28
|
+
checkTypeDef(node: TypeDef, accept: ValidationAcceptor): void;
|
|
29
|
+
checkEnum(node: Enum, accept: ValidationAcceptor): void;
|
|
30
|
+
checkAttribute(node: Attribute, accept: ValidationAcceptor): void;
|
|
31
|
+
checkExpression(node: Expression, accept: ValidationAcceptor): void;
|
|
32
|
+
checkFunctionInvocation(node: InvocationExpr, accept: ValidationAcceptor): void;
|
|
33
|
+
checkFunctionDecl(node: FunctionDecl, accept: ValidationAcceptor): void;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Declaration of custom services - add your own service classes here.
|
|
38
|
+
*/
|
|
39
|
+
type ZModelAddedServices = {
|
|
40
|
+
validation: {
|
|
41
|
+
ZModelValidator: ZModelValidator;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Union of Langium default services and your custom services - use this as constructor parameter
|
|
46
|
+
* of custom service classes.
|
|
47
|
+
*/
|
|
48
|
+
type ZModelServices = LangiumServices & ZModelAddedServices;
|
|
49
|
+
/**
|
|
50
|
+
* Dependency injection module that overrides Langium default services and contributes the
|
|
51
|
+
* declared custom services. The Langium defaults can be partially specified to override only
|
|
52
|
+
* selected services, while the custom services must be fully specified.
|
|
53
|
+
*/
|
|
54
|
+
declare const ZModelLanguageModule: Module<ZModelServices, PartialLangiumServices & ZModelAddedServices>;
|
|
55
|
+
type ZModelSharedServices = LangiumSharedServices;
|
|
56
|
+
declare const ZModelSharedModule: Module<ZModelSharedServices, DeepPartial<ZModelSharedServices>>;
|
|
57
|
+
/**
|
|
58
|
+
* Create the full set of services required by Langium.
|
|
59
|
+
*
|
|
60
|
+
* First inject the shared services by merging two modules:
|
|
61
|
+
* - Langium default shared services
|
|
62
|
+
* - Services generated by langium-cli
|
|
63
|
+
*
|
|
64
|
+
* Then inject the language-specific services by merging three modules:
|
|
65
|
+
* - Langium default language-specific services
|
|
66
|
+
* - Services generated by langium-cli
|
|
67
|
+
* - Services specified in this file
|
|
68
|
+
*
|
|
69
|
+
* @param context Optional module context with the LSP connection
|
|
70
|
+
* @returns An object wrapping the shared services and the language-specific services
|
|
71
|
+
*/
|
|
72
|
+
declare function createZModelLanguageServices(context: DefaultSharedModuleContext): {
|
|
73
|
+
shared: LangiumSharedServices;
|
|
74
|
+
ZModelLanguage: ZModelServices;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
declare function createZModelServices(): {
|
|
78
|
+
shared: langium_lsp.LangiumSharedServices;
|
|
79
|
+
ZModelLanguage: ZModelServices;
|
|
80
|
+
};
|
|
81
|
+
declare class DocumentLoadError extends Error {
|
|
82
|
+
constructor(message: string);
|
|
83
|
+
}
|
|
84
|
+
declare function loadDocument(fileName: string, pluginModelFiles?: string[]): Promise<{
|
|
85
|
+
success: true;
|
|
86
|
+
model: Model;
|
|
87
|
+
warnings: string[];
|
|
88
|
+
} | {
|
|
89
|
+
success: false;
|
|
90
|
+
errors: string[];
|
|
91
|
+
warnings: string[];
|
|
92
|
+
}>;
|
|
93
|
+
|
|
94
|
+
export { DocumentLoadError, type ZModelAddedServices, ZModelLanguageMetaData, ZModelLanguageModule, type ZModelServices, ZModelSharedModule, type ZModelSharedServices, createZModelLanguageServices, createZModelServices, loadDocument };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { ValidationAcceptor, Module, DeepPartial } from 'langium';
|
|
2
|
+
import * as langium_lsp from 'langium/lsp';
|
|
3
|
+
import { LangiumServices, PartialLangiumServices, LangiumSharedServices, DefaultSharedModuleContext } from 'langium/lsp';
|
|
4
|
+
import { Model, DataSource, DataModel, TypeDef, Enum, Attribute, Expression, InvocationExpr, FunctionDecl } from './ast.js';
|
|
5
|
+
|
|
6
|
+
/******************************************************************************
|
|
7
|
+
* This file was generated by langium-cli 3.3.0.
|
|
8
|
+
* DO NOT EDIT MANUALLY!
|
|
9
|
+
******************************************************************************/
|
|
10
|
+
|
|
11
|
+
declare const ZModelLanguageMetaData: {
|
|
12
|
+
readonly languageId: "zmodel";
|
|
13
|
+
readonly fileExtensions: readonly [".zmodel"];
|
|
14
|
+
readonly caseInsensitive: false;
|
|
15
|
+
readonly mode: "development";
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Implementation of custom validations.
|
|
20
|
+
*/
|
|
21
|
+
declare class ZModelValidator {
|
|
22
|
+
protected readonly services: ZModelServices;
|
|
23
|
+
constructor(services: ZModelServices);
|
|
24
|
+
private shouldCheck;
|
|
25
|
+
checkModel(node: Model, accept: ValidationAcceptor): void;
|
|
26
|
+
checkDataSource(node: DataSource, accept: ValidationAcceptor): void;
|
|
27
|
+
checkDataModel(node: DataModel, accept: ValidationAcceptor): void;
|
|
28
|
+
checkTypeDef(node: TypeDef, accept: ValidationAcceptor): void;
|
|
29
|
+
checkEnum(node: Enum, accept: ValidationAcceptor): void;
|
|
30
|
+
checkAttribute(node: Attribute, accept: ValidationAcceptor): void;
|
|
31
|
+
checkExpression(node: Expression, accept: ValidationAcceptor): void;
|
|
32
|
+
checkFunctionInvocation(node: InvocationExpr, accept: ValidationAcceptor): void;
|
|
33
|
+
checkFunctionDecl(node: FunctionDecl, accept: ValidationAcceptor): void;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Declaration of custom services - add your own service classes here.
|
|
38
|
+
*/
|
|
39
|
+
type ZModelAddedServices = {
|
|
40
|
+
validation: {
|
|
41
|
+
ZModelValidator: ZModelValidator;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Union of Langium default services and your custom services - use this as constructor parameter
|
|
46
|
+
* of custom service classes.
|
|
47
|
+
*/
|
|
48
|
+
type ZModelServices = LangiumServices & ZModelAddedServices;
|
|
49
|
+
/**
|
|
50
|
+
* Dependency injection module that overrides Langium default services and contributes the
|
|
51
|
+
* declared custom services. The Langium defaults can be partially specified to override only
|
|
52
|
+
* selected services, while the custom services must be fully specified.
|
|
53
|
+
*/
|
|
54
|
+
declare const ZModelLanguageModule: Module<ZModelServices, PartialLangiumServices & ZModelAddedServices>;
|
|
55
|
+
type ZModelSharedServices = LangiumSharedServices;
|
|
56
|
+
declare const ZModelSharedModule: Module<ZModelSharedServices, DeepPartial<ZModelSharedServices>>;
|
|
57
|
+
/**
|
|
58
|
+
* Create the full set of services required by Langium.
|
|
59
|
+
*
|
|
60
|
+
* First inject the shared services by merging two modules:
|
|
61
|
+
* - Langium default shared services
|
|
62
|
+
* - Services generated by langium-cli
|
|
63
|
+
*
|
|
64
|
+
* Then inject the language-specific services by merging three modules:
|
|
65
|
+
* - Langium default language-specific services
|
|
66
|
+
* - Services generated by langium-cli
|
|
67
|
+
* - Services specified in this file
|
|
68
|
+
*
|
|
69
|
+
* @param context Optional module context with the LSP connection
|
|
70
|
+
* @returns An object wrapping the shared services and the language-specific services
|
|
71
|
+
*/
|
|
72
|
+
declare function createZModelLanguageServices(context: DefaultSharedModuleContext): {
|
|
73
|
+
shared: LangiumSharedServices;
|
|
74
|
+
ZModelLanguage: ZModelServices;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
declare function createZModelServices(): {
|
|
78
|
+
shared: langium_lsp.LangiumSharedServices;
|
|
79
|
+
ZModelLanguage: ZModelServices;
|
|
80
|
+
};
|
|
81
|
+
declare class DocumentLoadError extends Error {
|
|
82
|
+
constructor(message: string);
|
|
83
|
+
}
|
|
84
|
+
declare function loadDocument(fileName: string, pluginModelFiles?: string[]): Promise<{
|
|
85
|
+
success: true;
|
|
86
|
+
model: Model;
|
|
87
|
+
warnings: string[];
|
|
88
|
+
} | {
|
|
89
|
+
success: false;
|
|
90
|
+
errors: string[];
|
|
91
|
+
warnings: string[];
|
|
92
|
+
}>;
|
|
93
|
+
|
|
94
|
+
export { DocumentLoadError, type ZModelAddedServices, ZModelLanguageMetaData, ZModelLanguageModule, type ZModelServices, ZModelSharedModule, type ZModelSharedServices, createZModelLanguageServices, createZModelServices, loadDocument };
|