This commit is contained in:
nik
2025-10-03 22:27:28 +03:00
parent 829fad0e17
commit 871cf7e792
16520 changed files with 2967597 additions and 3 deletions

View File

@@ -0,0 +1,32 @@
/******************************************************************************
* Copyright 2022 TypeFox GmbH
* This program and the accompanying materials are made available under the
* terms of the MIT License, which is available in the project root.
******************************************************************************/
import type { LangiumDocument } from '../../workspace/documents.js';
import type { Action, Grammar, Interface, ParserRule, Type } from '../../languages/generated/ast.js';
import type { Property, TypeOption } from '../type-system/type-collector/types.js';
/**
* A Langium document holds the parse result (AST and CST) and any additional state that is derived
* from the AST, e.g. the result of scope precomputation.
*/
export interface LangiumGrammarDocument extends LangiumDocument<Grammar> {
validationResources?: ValidationResources;
}
export type ValidationResources = {
typeToValidationInfo: TypeToValidationInfo;
typeToSuperProperties: Map<string, Property[]>;
};
export type TypeToValidationInfo = Map<string, InferredInfo | DeclaredInfo | InferredInfo & DeclaredInfo>;
export type InferredInfo = {
inferred: TypeOption;
inferredNodes: ReadonlyArray<ParserRule | Action>;
};
export type DeclaredInfo = {
declared: TypeOption;
declaredNode: Type | Interface;
};
export declare function isDeclared(type: InferredInfo | DeclaredInfo | InferredInfo & DeclaredInfo): type is DeclaredInfo;
export declare function isInferred(type: InferredInfo | DeclaredInfo | InferredInfo & DeclaredInfo): type is InferredInfo;
export declare function isInferredAndDeclared(type: InferredInfo | DeclaredInfo | InferredInfo & DeclaredInfo): type is InferredInfo & DeclaredInfo;
//# sourceMappingURL=documents.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"documents.d.ts","sourceRoot":"","sources":["../../../src/grammar/workspace/documents.ts"],"names":[],"mappings":"AAAA;;;;gFAIgF;AAEhF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,kCAAkC,CAAC;AACrG,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAEnF;;;GAGG;AACH,MAAM,WAAW,sBAAuB,SAAQ,eAAe,CAAC,OAAO,CAAC;IACpE,mBAAmB,CAAC,EAAE,mBAAmB,CAAA;CAC5C;AAED,MAAM,MAAM,mBAAmB,GAAG;IAC9B,oBAAoB,EAAE,oBAAoB,CAAC;IAC3C,qBAAqB,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;CAClD,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG,GAAG,CAAC,MAAM,EAAE,YAAY,GAAG,YAAY,GAAG,YAAY,GAAG,YAAY,CAAC,CAAC;AAE1G,MAAM,MAAM,YAAY,GAAG;IACvB,QAAQ,EAAE,UAAU,CAAC;IACrB,aAAa,EAAE,aAAa,CAAC,UAAU,GAAG,MAAM,CAAC,CAAA;CACpD,CAAA;AAED,MAAM,MAAM,YAAY,GAAG;IACvB,QAAQ,EAAE,UAAU,CAAC;IACrB,YAAY,EAAE,IAAI,GAAG,SAAS,CAAC;CAClC,CAAA;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,YAAY,GAAG,YAAY,GAAG,YAAY,GAAG,YAAY,GAAG,IAAI,IAAI,YAAY,CAEhH;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,YAAY,GAAG,YAAY,GAAG,YAAY,GAAG,YAAY,GAAG,IAAI,IAAI,YAAY,CAEhH;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,YAAY,GAAG,YAAY,GAAG,YAAY,GAAG,YAAY,GAAG,IAAI,IAAI,YAAY,GAAG,YAAY,CAE1I"}

View File

@@ -0,0 +1,15 @@
/******************************************************************************
* Copyright 2022 TypeFox GmbH
* This program and the accompanying materials are made available under the
* terms of the MIT License, which is available in the project root.
******************************************************************************/
export function isDeclared(type) {
return type && 'declared' in type;
}
export function isInferred(type) {
return type && 'inferred' in type;
}
export function isInferredAndDeclared(type) {
return type && 'inferred' in type && 'declared' in type;
}
//# sourceMappingURL=documents.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"documents.js","sourceRoot":"","sources":["../../../src/grammar/workspace/documents.ts"],"names":[],"mappings":"AAAA;;;;gFAIgF;AA+BhF,MAAM,UAAU,UAAU,CAAC,IAA+D;IACtF,OAAO,IAAI,IAAI,UAAU,IAAI,IAAI,CAAC;AACtC,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,IAA+D;IACtF,OAAO,IAAI,IAAI,UAAU,IAAI,IAAI,CAAC;AACtC,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,IAA+D;IACjG,OAAO,IAAI,IAAI,UAAU,IAAI,IAAI,IAAI,UAAU,IAAI,IAAI,CAAC;AAC5D,CAAC"}