@dbml/parse 7.1.1 → 8.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/dist/dbml-parse.js +29 -19
- package/dist/dbml-parse.mjs +11960 -8292
- package/dist/src/compiler/index.d.ts +88 -52
- package/dist/src/compiler/projectLayout/index.d.ts +1 -0
- package/dist/src/compiler/projectLayout/layout.d.ts +27 -0
- package/dist/src/compiler/queries/canonicalName.d.ts +9 -0
- package/dist/src/compiler/queries/container/element.d.ts +2 -1
- package/dist/src/compiler/queries/container/scope.d.ts +3 -2
- package/dist/src/compiler/queries/container/scopeKind.d.ts +2 -1
- package/dist/src/compiler/queries/container/stack.d.ts +2 -1
- package/dist/src/compiler/queries/container/token.d.ts +2 -1
- package/dist/src/compiler/queries/files/fileDependencies.d.ts +3 -0
- package/dist/src/compiler/queries/files/reachableFiles.d.ts +3 -0
- package/dist/src/compiler/queries/files/usableMembers.d.ts +32 -0
- package/dist/src/compiler/queries/legacy/parse.d.ts +10 -9
- package/dist/src/compiler/queries/legacy/symbol.d.ts +1 -10
- package/dist/src/compiler/queries/legacy/token.d.ts +3 -2
- package/dist/src/compiler/queries/nodeAtPosition.d.ts +5 -0
- package/dist/src/compiler/queries/pipeline/bind.d.ts +5 -0
- package/dist/src/compiler/queries/pipeline/index.d.ts +2 -0
- package/dist/src/compiler/queries/pipeline/interpret.d.ts +6 -0
- package/dist/src/compiler/queries/pipeline/parse.d.ts +12 -0
- package/dist/src/compiler/queries/pipeline/validate.d.ts +4 -0
- package/dist/src/compiler/queries/resolutionIndex.d.ts +11 -0
- package/dist/src/compiler/queries/symbol/lookupMembers.d.ts +4 -0
- package/dist/src/compiler/queries/symbol/symbolAliases.d.ts +4 -0
- package/dist/src/compiler/queries/symbol/symbolUses.d.ts +4 -0
- package/dist/src/compiler/queries/transform/index.d.ts +1 -1
- package/dist/src/compiler/queries/transform/renameTable.d.ts +21 -16
- package/dist/src/compiler/queries/transform/syncDiagramView.d.ts +19 -6
- package/dist/src/compiler/queries/transform/utils.d.ts +5 -4
- package/dist/src/compiler/queries/utils.d.ts +6 -0
- package/dist/src/constants.d.ts +1 -2
- package/dist/src/core/global_modules/checks/bind.d.ts +9 -0
- package/dist/src/core/global_modules/checks/index.d.ts +2 -0
- package/dist/src/core/global_modules/checks/interpret.d.ts +10 -0
- package/dist/src/core/global_modules/diagramView/bind.d.ts +18 -0
- package/dist/src/core/global_modules/diagramView/index.d.ts +8 -0
- package/dist/src/core/global_modules/diagramView/interpret.d.ts +37 -0
- package/dist/src/core/global_modules/enum/bind.d.ts +11 -0
- package/dist/src/core/global_modules/enum/index.d.ts +8 -0
- package/dist/src/core/global_modules/enum/interpret.d.ts +15 -0
- package/dist/src/core/global_modules/index.d.ts +17 -0
- package/dist/src/core/global_modules/indexes/bind.d.ts +12 -0
- package/dist/src/core/global_modules/indexes/index.d.ts +2 -0
- package/dist/src/core/global_modules/indexes/interpret.d.ts +10 -0
- package/dist/src/core/global_modules/note/bind.d.ts +11 -0
- package/dist/src/core/global_modules/note/index.d.ts +2 -0
- package/dist/src/core/global_modules/note/interpret.d.ts +17 -0
- package/dist/src/core/global_modules/program/bind.d.ts +17 -0
- package/dist/src/core/global_modules/program/index.d.ts +2 -0
- package/dist/src/core/global_modules/program/interpret.d.ts +23 -0
- package/dist/src/core/global_modules/program/utils/constraints/fk.d.ts +13 -0
- package/dist/src/core/global_modules/program/utils/constraints/helper.d.ts +26 -0
- package/dist/src/core/global_modules/program/utils/constraints/pk.d.ts +6 -0
- package/dist/src/core/global_modules/program/utils/constraints/unique.d.ts +5 -0
- package/dist/src/core/global_modules/program/utils.d.ts +3 -0
- package/dist/src/core/global_modules/project/bind.d.ts +11 -0
- package/dist/src/core/global_modules/project/index.d.ts +2 -0
- package/dist/src/core/global_modules/project/interpret.d.ts +16 -0
- package/dist/src/core/global_modules/records/bind.d.ts +17 -0
- package/dist/src/core/global_modules/records/index.d.ts +2 -0
- package/dist/src/core/global_modules/records/interpret.d.ts +13 -0
- package/dist/src/core/{interpreter → global_modules}/records/utils/data/sqlTypes.d.ts +0 -8
- package/dist/src/core/{interpreter → global_modules}/records/utils/data/values.d.ts +1 -1
- package/dist/src/core/global_modules/records/utils/index.d.ts +1 -0
- package/dist/src/core/global_modules/ref/bind.d.ts +15 -0
- package/dist/src/core/global_modules/ref/index.d.ts +7 -0
- package/dist/src/core/global_modules/ref/interpret.d.ts +15 -0
- package/dist/src/core/global_modules/schema/index.d.ts +2 -0
- package/dist/src/core/global_modules/table/bind.d.ts +18 -0
- package/dist/src/core/global_modules/table/index.d.ts +9 -0
- package/dist/src/core/global_modules/table/interpret.d.ts +26 -0
- package/dist/src/core/global_modules/table/utils.d.ts +4 -0
- package/dist/src/core/global_modules/tableGroup/bind.d.ts +15 -0
- package/dist/src/core/global_modules/tableGroup/index.d.ts +8 -0
- package/dist/src/core/global_modules/tableGroup/interpret.d.ts +18 -0
- package/dist/src/core/global_modules/tablePartial/bind.d.ts +17 -0
- package/dist/src/core/global_modules/tablePartial/index.d.ts +7 -0
- package/dist/src/core/global_modules/tablePartial/interpret.d.ts +23 -0
- package/dist/src/core/global_modules/types.d.ts +17 -0
- package/dist/src/core/global_modules/use/index.d.ts +8 -0
- package/dist/src/core/global_modules/utils.d.ts +17 -0
- package/dist/src/core/local_modules/checks/index.d.ts +2 -0
- package/dist/src/core/local_modules/checks/validate.d.ts +17 -0
- package/dist/src/core/local_modules/custom/index.d.ts +2 -0
- package/dist/src/core/local_modules/custom/validate.d.ts +14 -0
- package/dist/src/core/local_modules/diagramView/index.d.ts +2 -0
- package/dist/src/core/local_modules/diagramView/validate.d.ts +24 -0
- package/dist/src/core/local_modules/enum/index.d.ts +2 -0
- package/dist/src/core/local_modules/enum/validate.d.ts +17 -0
- package/dist/src/core/local_modules/index.d.ts +10 -0
- package/dist/src/core/local_modules/indexes/index.d.ts +2 -0
- package/dist/src/core/local_modules/indexes/validate.d.ts +18 -0
- package/dist/src/core/local_modules/note/index.d.ts +2 -0
- package/dist/src/core/local_modules/note/validate.d.ts +16 -0
- package/dist/src/core/local_modules/program/index.d.ts +2 -0
- package/dist/src/core/local_modules/program/validate.d.ts +9 -0
- package/dist/src/core/local_modules/project/index.d.ts +2 -0
- package/dist/src/core/local_modules/project/validate.d.ts +15 -0
- package/dist/src/core/local_modules/records/index.d.ts +2 -0
- package/dist/src/core/local_modules/records/validate.d.ts +20 -0
- package/dist/src/core/local_modules/ref/index.d.ts +2 -0
- package/dist/src/core/local_modules/ref/validate.d.ts +20 -0
- package/dist/src/core/local_modules/table/index.d.ts +2 -0
- package/dist/src/core/local_modules/table/validate.d.ts +21 -0
- package/dist/src/core/local_modules/tableGroup/index.d.ts +2 -0
- package/dist/src/core/local_modules/tableGroup/validate.d.ts +19 -0
- package/dist/src/core/local_modules/tablePartial/index.d.ts +2 -0
- package/dist/src/core/local_modules/tablePartial/validate.d.ts +21 -0
- package/dist/src/core/local_modules/types.d.ts +12 -0
- package/dist/src/core/local_modules/use/index.d.ts +2 -0
- package/dist/src/core/local_modules/use/validate.d.ts +12 -0
- package/dist/src/core/parser/parser.d.ts +6 -0
- package/dist/src/core/parser/utils.d.ts +2 -49
- package/dist/src/core/types/errors.d.ts +9 -5
- package/dist/src/core/types/filepath.d.ts +8 -2
- package/dist/src/core/types/index.d.ts +2 -0
- package/dist/src/core/{analyzer/types.d.ts → types/keywords.d.ts} +6 -2
- package/dist/src/core/types/module.d.ts +1 -2
- package/dist/src/core/types/nodes.d.ts +61 -16
- package/dist/src/core/types/report.d.ts +3 -3
- package/dist/src/core/types/schemaJson.d.ts +14 -5
- package/dist/src/core/types/symbol/factory.d.ts +3 -2
- package/dist/src/core/types/symbol/index.d.ts +2 -3
- package/dist/src/core/types/symbol/metadata.d.ts +80 -0
- package/dist/src/core/types/symbol/symbols.d.ts +277 -86
- package/dist/src/core/{analyzer/utils.d.ts → utils/expression.d.ts} +10 -21
- package/dist/src/core/utils/interpret.d.ts +16 -0
- package/dist/src/core/utils/numbers.d.ts +1 -1
- package/dist/src/core/utils/span.d.ts +2 -4
- package/dist/src/core/utils/tokens.d.ts +15 -0
- package/dist/src/core/utils/validate.d.ts +103 -0
- package/dist/src/index.d.ts +13 -9
- package/dist/src/services/diagnostics/provider.d.ts +7 -6
- package/dist/src/services/index.d.ts +1 -0
- package/dist/src/services/monarch.d.ts +3 -2
- package/dist/src/services/suggestions/crossFile.d.ts +6 -0
- package/dist/src/services/suggestions/provider.d.ts +4 -1
- package/dist/src/services/suggestions/recordRowSnippet.d.ts +2 -1
- package/dist/src/services/suggestions/use.d.ts +5 -0
- package/dist/src/services/suggestions/utils/index.d.ts +10 -0
- package/dist/src/services/suggestions/utils/useMerger.d.ts +28 -0
- package/dist/src/services/types.d.ts +4 -0
- package/dist/src/services/utils.d.ts +4 -1
- package/package.json +3 -3
- package/dist/src/core/analyzer/analyzer.d.ts +0 -10
- package/dist/src/core/analyzer/binder/binder.d.ts +0 -10
- package/dist/src/core/analyzer/binder/elementBinder/checks.d.ts +0 -13
- package/dist/src/core/analyzer/binder/elementBinder/custom.d.ts +0 -16
- package/dist/src/core/analyzer/binder/elementBinder/diagramView.d.ts +0 -20
- package/dist/src/core/analyzer/binder/elementBinder/enum.d.ts +0 -16
- package/dist/src/core/analyzer/binder/elementBinder/indexes.d.ts +0 -17
- package/dist/src/core/analyzer/binder/elementBinder/note.d.ts +0 -16
- package/dist/src/core/analyzer/binder/elementBinder/project.d.ts +0 -16
- package/dist/src/core/analyzer/binder/elementBinder/records.d.ts +0 -22
- package/dist/src/core/analyzer/binder/elementBinder/ref.d.ts +0 -17
- package/dist/src/core/analyzer/binder/elementBinder/table.d.ts +0 -21
- package/dist/src/core/analyzer/binder/elementBinder/tableGroup.d.ts +0 -17
- package/dist/src/core/analyzer/binder/elementBinder/tablePartial.d.ts +0 -19
- package/dist/src/core/analyzer/binder/types.d.ts +0 -4
- package/dist/src/core/analyzer/binder/utils.d.ts +0 -33
- package/dist/src/core/analyzer/validator/elementValidators/checks.d.ts +0 -26
- package/dist/src/core/analyzer/validator/elementValidators/custom.d.ts +0 -23
- package/dist/src/core/analyzer/validator/elementValidators/diagramView.d.ts +0 -31
- package/dist/src/core/analyzer/validator/elementValidators/enum.d.ts +0 -28
- package/dist/src/core/analyzer/validator/elementValidators/indexes.d.ts +0 -27
- package/dist/src/core/analyzer/validator/elementValidators/note.d.ts +0 -25
- package/dist/src/core/analyzer/validator/elementValidators/project.d.ts +0 -24
- package/dist/src/core/analyzer/validator/elementValidators/records.d.ts +0 -29
- package/dist/src/core/analyzer/validator/elementValidators/ref.d.ts +0 -26
- package/dist/src/core/analyzer/validator/elementValidators/table.d.ts +0 -28
- package/dist/src/core/analyzer/validator/elementValidators/tableGroup.d.ts +0 -27
- package/dist/src/core/analyzer/validator/elementValidators/tablePartial.d.ts +0 -28
- package/dist/src/core/analyzer/validator/types.d.ts +0 -7
- package/dist/src/core/analyzer/validator/utils.d.ts +0 -65
- package/dist/src/core/analyzer/validator/validator.d.ts +0 -10
- package/dist/src/core/interpreter/elementInterpreter/diagramView.d.ts +0 -13
- package/dist/src/core/interpreter/elementInterpreter/enum.d.ts +0 -12
- package/dist/src/core/interpreter/elementInterpreter/project.d.ts +0 -12
- package/dist/src/core/interpreter/elementInterpreter/ref.d.ts +0 -14
- package/dist/src/core/interpreter/elementInterpreter/sticky_note.d.ts +0 -14
- package/dist/src/core/interpreter/elementInterpreter/table.d.ts +0 -22
- package/dist/src/core/interpreter/elementInterpreter/tableGroup.d.ts +0 -15
- package/dist/src/core/interpreter/elementInterpreter/tablePartial.d.ts +0 -19
- package/dist/src/core/interpreter/interpreter.d.ts +0 -10
- package/dist/src/core/interpreter/records/index.d.ts +0 -10
- package/dist/src/core/interpreter/records/utils/constraints/fk.d.ts +0 -3
- package/dist/src/core/interpreter/records/utils/constraints/helper.d.ts +0 -11
- package/dist/src/core/interpreter/records/utils/constraints/pk.d.ts +0 -3
- package/dist/src/core/interpreter/records/utils/constraints/unique.d.ts +0 -3
- package/dist/src/core/interpreter/records/utils/index.d.ts +0 -2
- package/dist/src/core/interpreter/types.d.ts +0 -47
- package/dist/src/core/interpreter/utils.d.ts +0 -37
- package/dist/src/core/types/symbol/symbolIndex.d.ts +0 -33
- package/dist/src/core/types/symbol/symbolTable.d.ts +0 -12
- package/dist/src/core/types/symbol/utils.d.ts +0 -4
- package/dist/src/core/utils/array.d.ts +0 -1
- package/dist/src/core/utils/enum.d.ts +0 -1
- package/dist/src/services/suggestions/utils.d.ts +0 -34
- /package/dist/src/core/{interpreter/records → global_modules/program}/utils/constraints/index.d.ts +0 -0
- /package/dist/src/core/{interpreter → global_modules}/records/utils/data/index.d.ts +0 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { default as Compiler } from '../../compiler';
|
|
2
|
+
import { RelationCardinality } from '../types';
|
|
3
|
+
import { PrimaryExpressionNode, SyntaxNode, VariableNode } from '../types/nodes';
|
|
4
|
+
import { default as Report } from '../types/report';
|
|
5
|
+
import { NodeSymbol } from '../types/symbol';
|
|
6
|
+
export declare function shouldInterpretNode(compiler: Compiler, node: SyntaxNode): boolean;
|
|
7
|
+
export declare function getNodeMemberSymbols(compiler: Compiler, node: SyntaxNode): Report<NodeSymbol[]>;
|
|
8
|
+
export declare function scanNonListNodeForBinding(node?: SyntaxNode): {
|
|
9
|
+
variables: (PrimaryExpressionNode & {
|
|
10
|
+
expression: VariableNode;
|
|
11
|
+
})[];
|
|
12
|
+
tupleElements: (PrimaryExpressionNode & {
|
|
13
|
+
expression: VariableNode;
|
|
14
|
+
})[];
|
|
15
|
+
}[];
|
|
16
|
+
export declare function nodeRefereeOfLeftExpression(compiler: Compiler, node: SyntaxNode): NodeSymbol | undefined;
|
|
17
|
+
export declare function getMultiplicities(op: string): [RelationCardinality, RelationCardinality] | undefined;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { default as Compiler } from '../../../compiler';
|
|
2
|
+
import { CompileError } from '../../types/errors';
|
|
3
|
+
import { ElementDeclarationNode } from '../../types/nodes';
|
|
4
|
+
export default class ChecksValidator {
|
|
5
|
+
private compiler;
|
|
6
|
+
private declarationNode;
|
|
7
|
+
constructor(compiler: Compiler, declarationNode: ElementDeclarationNode);
|
|
8
|
+
validate(): CompileError[];
|
|
9
|
+
private validateContext;
|
|
10
|
+
private validateName;
|
|
11
|
+
private validateAlias;
|
|
12
|
+
private validateSettingList;
|
|
13
|
+
private validateBody;
|
|
14
|
+
private validateFields;
|
|
15
|
+
private validateFieldSetting;
|
|
16
|
+
private validateSubElements;
|
|
17
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { default as Compiler } from '../../../compiler';
|
|
2
|
+
import { CompileError } from '../../types/errors';
|
|
3
|
+
import { BlockExpressionNode, ElementDeclarationNode, FunctionApplicationNode } from '../../types/nodes';
|
|
4
|
+
export default class CustomValidator {
|
|
5
|
+
private compiler;
|
|
6
|
+
private declarationNode;
|
|
7
|
+
constructor(compiler: Compiler, declarationNode: ElementDeclarationNode);
|
|
8
|
+
validate(): CompileError[];
|
|
9
|
+
private validateContext;
|
|
10
|
+
private validateName;
|
|
11
|
+
private validateAlias;
|
|
12
|
+
private validateSettingList;
|
|
13
|
+
validateBody(body?: FunctionApplicationNode | BlockExpressionNode): CompileError[];
|
|
14
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { default as Compiler } from '../../../compiler';
|
|
2
|
+
import { CompileError, CompileWarning } from '../../types/errors';
|
|
3
|
+
import { BlockExpressionNode, ElementDeclarationNode, FunctionApplicationNode } from '../../types/nodes';
|
|
4
|
+
export default class DiagramViewValidator {
|
|
5
|
+
private compiler;
|
|
6
|
+
private declarationNode;
|
|
7
|
+
constructor(compiler: Compiler, declarationNode: ElementDeclarationNode);
|
|
8
|
+
validate(): {
|
|
9
|
+
errors: CompileError[];
|
|
10
|
+
warnings: CompileWarning[];
|
|
11
|
+
};
|
|
12
|
+
private validateContext;
|
|
13
|
+
private validateName;
|
|
14
|
+
private validateAlias;
|
|
15
|
+
private validateSettingList;
|
|
16
|
+
validateBody(body?: FunctionApplicationNode | BlockExpressionNode): {
|
|
17
|
+
errors: CompileError[];
|
|
18
|
+
warnings: CompileWarning[];
|
|
19
|
+
};
|
|
20
|
+
validateFields(fields: FunctionApplicationNode[]): CompileError[];
|
|
21
|
+
private validateSubElements;
|
|
22
|
+
private validateSubBlock;
|
|
23
|
+
validateSubBlockFields(sub: ElementDeclarationNode): CompileError[];
|
|
24
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { default as Compiler } from '../../../compiler';
|
|
2
|
+
import { CompileError } from '../../types/errors';
|
|
3
|
+
import { ElementDeclarationNode } from '../../types/nodes';
|
|
4
|
+
export default class EnumValidator {
|
|
5
|
+
private compiler;
|
|
6
|
+
private declarationNode;
|
|
7
|
+
constructor(compiler: Compiler, declarationNode: ElementDeclarationNode);
|
|
8
|
+
validate(): CompileError[];
|
|
9
|
+
private validateContext;
|
|
10
|
+
private validateName;
|
|
11
|
+
private validateAlias;
|
|
12
|
+
private validateSettingList;
|
|
13
|
+
private validateBody;
|
|
14
|
+
private validateFields;
|
|
15
|
+
private validateFieldSettings;
|
|
16
|
+
private validateSubElements;
|
|
17
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { default as Compiler } from '../../compiler';
|
|
2
|
+
import { Unhandled } from '../types/module';
|
|
3
|
+
import { SyntaxNode } from '../types/nodes';
|
|
4
|
+
import { default as Report } from '../types/report';
|
|
5
|
+
import { LocalModule, Settings } from './types';
|
|
6
|
+
export declare const modules: LocalModule[];
|
|
7
|
+
export declare function validateNode(this: Compiler, node: SyntaxNode): Report<void> | Report<Unhandled>;
|
|
8
|
+
export declare function nodeSettings(this: Compiler, node: SyntaxNode): Report<Settings> | Report<Unhandled>;
|
|
9
|
+
export declare function nodeFullname(this: Compiler, node: SyntaxNode): Report<string[] | undefined> | Report<Unhandled>;
|
|
10
|
+
export declare function nodeAlias(this: Compiler, node: SyntaxNode): Report<string | undefined> | Report<Unhandled>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { default as Compiler } from '../../../compiler';
|
|
2
|
+
import { CompileError } from '../../types/errors';
|
|
3
|
+
import { ElementDeclarationNode, SyntaxNode } from '../../types/nodes';
|
|
4
|
+
export default class IndexesValidator {
|
|
5
|
+
private compiler;
|
|
6
|
+
private declarationNode;
|
|
7
|
+
constructor(compiler: Compiler, declarationNode: ElementDeclarationNode);
|
|
8
|
+
validate(): CompileError[];
|
|
9
|
+
private validateContext;
|
|
10
|
+
private validateName;
|
|
11
|
+
private validateAlias;
|
|
12
|
+
private validateSettingList;
|
|
13
|
+
private validateBody;
|
|
14
|
+
private validateFields;
|
|
15
|
+
private validateFieldSetting;
|
|
16
|
+
private validateSubElements;
|
|
17
|
+
}
|
|
18
|
+
export declare function isValidIndexesType(value?: SyntaxNode): boolean;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { default as Compiler } from '../../../compiler';
|
|
2
|
+
import { CompileError } from '../../types/errors';
|
|
3
|
+
import { BlockExpressionNode, ElementDeclarationNode, FunctionApplicationNode } from '../../types/nodes';
|
|
4
|
+
export default class NoteValidator {
|
|
5
|
+
private compiler;
|
|
6
|
+
private declarationNode;
|
|
7
|
+
constructor(compiler: Compiler, declarationNode: ElementDeclarationNode);
|
|
8
|
+
validate(): CompileError[];
|
|
9
|
+
private validateContext;
|
|
10
|
+
private validateName;
|
|
11
|
+
private validateAlias;
|
|
12
|
+
private validateSettingList;
|
|
13
|
+
validateBody(body?: FunctionApplicationNode | BlockExpressionNode): CompileError[];
|
|
14
|
+
validateFields(fields: FunctionApplicationNode[]): CompileError[];
|
|
15
|
+
private validateSubElements;
|
|
16
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as Compiler } from '../../../compiler';
|
|
2
|
+
import { ProgramNode } from '../../types/nodes';
|
|
3
|
+
import { default as Report } from '../../types/report';
|
|
4
|
+
export default class ProgramValidator {
|
|
5
|
+
private ast;
|
|
6
|
+
private compiler;
|
|
7
|
+
constructor(compiler: Compiler, ast: ProgramNode);
|
|
8
|
+
validate(): Report<ProgramNode>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { default as Compiler } from '../../../compiler';
|
|
2
|
+
import { CompileError } from '../../types/errors';
|
|
3
|
+
import { ElementDeclarationNode } from '../../types/nodes';
|
|
4
|
+
export default class ProjectValidator {
|
|
5
|
+
private declarationNode;
|
|
6
|
+
private compiler;
|
|
7
|
+
constructor(compiler: Compiler, declarationNode: ElementDeclarationNode);
|
|
8
|
+
validate(): CompileError[];
|
|
9
|
+
private validateContext;
|
|
10
|
+
private validateName;
|
|
11
|
+
private validateAlias;
|
|
12
|
+
private validateSettingList;
|
|
13
|
+
private validateBody;
|
|
14
|
+
private validateSubElements;
|
|
15
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { default as Compiler } from '../../../compiler';
|
|
2
|
+
import { CompileError } from '../../types/errors';
|
|
3
|
+
import { BlockExpressionNode, ElementDeclarationNode, FunctionApplicationNode } from '../../types/nodes';
|
|
4
|
+
export default class RecordsValidator {
|
|
5
|
+
private declarationNode;
|
|
6
|
+
private compiler;
|
|
7
|
+
constructor(compiler: Compiler, declarationNode: ElementDeclarationNode);
|
|
8
|
+
validate(): CompileError[];
|
|
9
|
+
private validateContext;
|
|
10
|
+
private validateName;
|
|
11
|
+
private validateTopLevelName;
|
|
12
|
+
private validateInsideTableName;
|
|
13
|
+
private validateAlias;
|
|
14
|
+
private validateSettingList;
|
|
15
|
+
validateBody(body?: FunctionApplicationNode | BlockExpressionNode): CompileError[];
|
|
16
|
+
private validateDataRows;
|
|
17
|
+
private validateDataRow;
|
|
18
|
+
private isValidRecordValue;
|
|
19
|
+
private validateSubElements;
|
|
20
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { default as Compiler } from '../../../compiler';
|
|
2
|
+
import { CompileError } from '../../types/errors';
|
|
3
|
+
import { BlockExpressionNode, ElementDeclarationNode, FunctionApplicationNode, ListExpressionNode } from '../../types/nodes';
|
|
4
|
+
import { default as Report } from '../../types/report';
|
|
5
|
+
import { Settings } from '../../utils/validate';
|
|
6
|
+
export default class RefValidator {
|
|
7
|
+
private declarationNode;
|
|
8
|
+
private compiler;
|
|
9
|
+
constructor(compiler: Compiler, declarationNode: ElementDeclarationNode);
|
|
10
|
+
validate(): CompileError[];
|
|
11
|
+
private validateContext;
|
|
12
|
+
private validateName;
|
|
13
|
+
private validateAlias;
|
|
14
|
+
private validateSettingList;
|
|
15
|
+
validateBody(body?: FunctionApplicationNode | BlockExpressionNode): CompileError[];
|
|
16
|
+
validateFields(fields: FunctionApplicationNode[]): CompileError[];
|
|
17
|
+
validateFieldSettings(settings: ListExpressionNode): CompileError[];
|
|
18
|
+
private validateSubElements;
|
|
19
|
+
}
|
|
20
|
+
export declare function validateFieldSettings(settings: ListExpressionNode): Report<Settings>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { default as Compiler } from '../../../compiler';
|
|
2
|
+
import { CompileError } from '../../types/errors';
|
|
3
|
+
import { ElementDeclarationNode, ExpressionNode, ListExpressionNode } from '../../types/nodes';
|
|
4
|
+
import { default as Report } from '../../types/report';
|
|
5
|
+
import { Settings } from '../../utils/validate';
|
|
6
|
+
export default class TableValidator {
|
|
7
|
+
private declarationNode;
|
|
8
|
+
private compiler;
|
|
9
|
+
constructor(compiler: Compiler, declarationNode: ElementDeclarationNode);
|
|
10
|
+
validate(): CompileError[];
|
|
11
|
+
private validateContext;
|
|
12
|
+
private validateName;
|
|
13
|
+
private validateAlias;
|
|
14
|
+
private validateSettingList;
|
|
15
|
+
private validateBody;
|
|
16
|
+
private validateFields;
|
|
17
|
+
private validateFieldSetting;
|
|
18
|
+
private validateSubElements;
|
|
19
|
+
}
|
|
20
|
+
export declare function validateTableSettings(settingList?: ListExpressionNode): Report<Settings>;
|
|
21
|
+
export declare function validateFieldSetting(parts: ExpressionNode[]): Report<Settings>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { default as Compiler } from '../../../compiler';
|
|
2
|
+
import { CompileError } from '../../types/errors';
|
|
3
|
+
import { BlockExpressionNode, ElementDeclarationNode, FunctionApplicationNode, ListExpressionNode } from '../../types/nodes';
|
|
4
|
+
import { default as Report } from '../../types/report';
|
|
5
|
+
import { Settings } from '../../utils/validate';
|
|
6
|
+
export default class TableGroupValidator {
|
|
7
|
+
private declarationNode;
|
|
8
|
+
private compiler;
|
|
9
|
+
constructor(compiler: Compiler, declarationNode: ElementDeclarationNode);
|
|
10
|
+
validate(): CompileError[];
|
|
11
|
+
private validateContext;
|
|
12
|
+
private validateName;
|
|
13
|
+
private validateAlias;
|
|
14
|
+
private validateSettingList;
|
|
15
|
+
validateBody(body?: FunctionApplicationNode | BlockExpressionNode): CompileError[];
|
|
16
|
+
validateFields(fields: FunctionApplicationNode[]): CompileError[];
|
|
17
|
+
private validateSubElements;
|
|
18
|
+
}
|
|
19
|
+
export declare function validateSettingList(settingList?: ListExpressionNode): Report<Settings>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { default as Compiler } from '../../../compiler';
|
|
2
|
+
import { CompileError } from '../../types/errors';
|
|
3
|
+
import { ElementDeclarationNode, ExpressionNode, ListExpressionNode } from '../../types/nodes';
|
|
4
|
+
import { default as Report } from '../../types/report';
|
|
5
|
+
import { Settings } from '../../utils/validate';
|
|
6
|
+
export default class TablePartialValidator {
|
|
7
|
+
private compiler;
|
|
8
|
+
private declarationNode;
|
|
9
|
+
constructor(compiler: Compiler, declarationNode: ElementDeclarationNode);
|
|
10
|
+
validate(): CompileError[];
|
|
11
|
+
private validateContext;
|
|
12
|
+
private validateName;
|
|
13
|
+
private validateAlias;
|
|
14
|
+
private validateSettingList;
|
|
15
|
+
private validateBody;
|
|
16
|
+
private validateFields;
|
|
17
|
+
private validateFieldSetting;
|
|
18
|
+
private validateSubElements;
|
|
19
|
+
}
|
|
20
|
+
export declare function validateTablePartialSettings(settingList?: ListExpressionNode): Report<Settings>;
|
|
21
|
+
export declare function validateFieldSetting(parts: ExpressionNode[]): Report<Settings>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { default as Compiler } from '../../compiler';
|
|
2
|
+
import { Module, PassThrough } from '../types/module';
|
|
3
|
+
import { SyntaxNode } from '../types/nodes';
|
|
4
|
+
import { default as Report } from '../types/report';
|
|
5
|
+
import { Settings } from '../utils/validate';
|
|
6
|
+
export type { Settings, };
|
|
7
|
+
export interface LocalModule extends Module {
|
|
8
|
+
validateNode?(compiler: Compiler, node: SyntaxNode): Report<void> | Report<PassThrough>;
|
|
9
|
+
nodeFullname?(compiler: Compiler, node: SyntaxNode): Report<string[] | undefined> | Report<PassThrough>;
|
|
10
|
+
nodeAlias?(compiler: Compiler, node: SyntaxNode): Report<string | undefined> | Report<PassThrough>;
|
|
11
|
+
nodeSettings?(compiler: Compiler, node: SyntaxNode): Report<Settings> | Report<PassThrough>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { default as Compiler } from '../../../compiler';
|
|
2
|
+
import { CompileError } from '../../types/errors';
|
|
3
|
+
import { UseDeclarationNode } from '../../types/nodes';
|
|
4
|
+
export default class UseDeclarationValidator {
|
|
5
|
+
private compiler;
|
|
6
|
+
private declarationNode;
|
|
7
|
+
constructor(compiler: Compiler, declarationNode: UseDeclarationNode);
|
|
8
|
+
validate(): CompileError[];
|
|
9
|
+
private validateContext;
|
|
10
|
+
private validateBody;
|
|
11
|
+
private validateSpecifier;
|
|
12
|
+
}
|
|
@@ -9,6 +9,7 @@ export default class Parser {
|
|
|
9
9
|
private contextStack;
|
|
10
10
|
private nodeFactory;
|
|
11
11
|
private source;
|
|
12
|
+
private filepath;
|
|
12
13
|
constructor(source: string, tokens: SyntaxToken[], nodeIdGenerator: SyntaxNodeIdGenerator, filepath: Filepath);
|
|
13
14
|
private isAtEnd;
|
|
14
15
|
private advance;
|
|
@@ -24,7 +25,11 @@ export default class Parser {
|
|
|
24
25
|
ast: ProgramNode;
|
|
25
26
|
tokens: SyntaxToken[];
|
|
26
27
|
}>;
|
|
28
|
+
private assignParents;
|
|
27
29
|
private program;
|
|
30
|
+
private useDeclaration;
|
|
31
|
+
private useSpecifierList;
|
|
32
|
+
private useSpecifier;
|
|
28
33
|
private synchronizeProgram;
|
|
29
34
|
private elementDeclaration;
|
|
30
35
|
private synchronizeElementDeclarationName;
|
|
@@ -39,6 +44,7 @@ export default class Parser {
|
|
|
39
44
|
private leftExpression_bp;
|
|
40
45
|
private extractOperand;
|
|
41
46
|
private functionExpression;
|
|
47
|
+
private wildcardExpression;
|
|
42
48
|
private blockExpression;
|
|
43
49
|
private canBeField;
|
|
44
50
|
private synchronizeBlock;
|
|
@@ -1,53 +1,6 @@
|
|
|
1
1
|
import { default as NodeFactory } from './factory';
|
|
2
|
-
import { CommaExpressionNode, ElementDeclarationNode, ExpressionNode,
|
|
3
|
-
import { SyntaxToken
|
|
2
|
+
import { CommaExpressionNode, ElementDeclarationNode, ExpressionNode, NormalExpressionNode, SyntaxNode } from '../types/nodes';
|
|
3
|
+
import { SyntaxToken } from '../types/tokens';
|
|
4
4
|
export declare function convertFuncAppToElem(_callee: ExpressionNode | CommaExpressionNode | undefined, _args: (NormalExpressionNode | CommaExpressionNode)[], factory: NodeFactory): ElementDeclarationNode | undefined;
|
|
5
|
-
export declare function isAsKeyword(token?: SyntaxToken): token is SyntaxToken & {
|
|
6
|
-
kind: SyntaxTokenKind.IDENTIFIER;
|
|
7
|
-
value: 'as';
|
|
8
|
-
};
|
|
9
5
|
export declare function markInvalid(nodeOrToken?: SyntaxNode | SyntaxToken): void;
|
|
10
|
-
export declare function isInvalidToken(token?: SyntaxToken): boolean;
|
|
11
6
|
export declare function getMemberChain(node: SyntaxNode): Readonly<(SyntaxNode | SyntaxToken)[]>;
|
|
12
|
-
export declare function extractVariableNode(value?: unknown): SyntaxToken | undefined;
|
|
13
|
-
export declare function isExpressionAQuotedString(value?: unknown): value is PrimaryExpressionNode & ({
|
|
14
|
-
expression: VariableNode & {
|
|
15
|
-
variable: SyntaxToken & {
|
|
16
|
-
kind: SyntaxTokenKind.QUOTED_STRING;
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
} | {
|
|
20
|
-
expression: LiteralNode & {
|
|
21
|
-
literal: SyntaxToken & {
|
|
22
|
-
kind: SyntaxTokenKind.STRING_LITERAL;
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
});
|
|
26
|
-
export declare function isExpressionAVariableNode(value?: unknown): value is PrimaryExpressionNode & {
|
|
27
|
-
expression: VariableNode & {
|
|
28
|
-
variable: SyntaxToken;
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
export declare function isWildcardExpression(node: SyntaxNode | undefined): boolean;
|
|
32
|
-
export declare function isExpressionAnIdentifierNode(value?: unknown): value is PrimaryExpressionNode & {
|
|
33
|
-
expression: VariableNode & {
|
|
34
|
-
variable: {
|
|
35
|
-
kind: SyntaxTokenKind.IDENTIFIER;
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
|
-
type AccessExpression = InfixExpressionNode & {
|
|
40
|
-
leftExpression: SyntaxNode;
|
|
41
|
-
rightExpression: SyntaxNode;
|
|
42
|
-
op: SyntaxToken & {
|
|
43
|
-
value: '.';
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
type DotDelimitedIdentifier = PrimaryExpressionNode | (AccessExpression & {
|
|
47
|
-
rightExpression: AccessExpression | PrimaryExpressionNode;
|
|
48
|
-
});
|
|
49
|
-
export declare function isAccessExpression(node?: SyntaxNode): node is AccessExpression;
|
|
50
|
-
export declare function isDotDelimitedIdentifier(node?: SyntaxNode): node is DotDelimitedIdentifier;
|
|
51
|
-
export declare function extractStringFromIdentifierStream(stream?: IdentiferStreamNode): string | undefined;
|
|
52
|
-
export declare function getElementNameString(element?: ElementDeclarationNode): string | undefined;
|
|
53
|
-
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { Filepath } from './filepath';
|
|
1
2
|
import { SyntaxNode } from './nodes';
|
|
2
3
|
import { SyntaxToken } from './tokens';
|
|
3
|
-
import { Filepath } from './filepath';
|
|
4
4
|
export declare enum CompileErrorCode {
|
|
5
5
|
UNKNOWN_SYMBOL = 1000,
|
|
6
6
|
UNEXPECTED_SYMBOL = 1001,
|
|
@@ -96,11 +96,15 @@ export declare enum CompileErrorCode {
|
|
|
96
96
|
INVALID_RECORDS_FIELD = 3079,
|
|
97
97
|
DUPLICATE_COLUMN_REFERENCES_IN_RECORDS = 3080,
|
|
98
98
|
DUPLICATE_RECORDS_FOR_TABLE = 3081,
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
99
|
+
INVALID_USE_CONTEXT = 3082,
|
|
100
|
+
INVALID_USE_SPECIFIER_KIND = 3083,
|
|
101
|
+
INVALID_USE_SPECIFIER_NAME = 3084,
|
|
102
|
+
INVALID_DIAGRAMVIEW_CONTEXT = 3085,
|
|
103
|
+
DUPLICATE_DIAGRAMVIEW_NAME = 3086,
|
|
104
|
+
INVALID_DIAGRAMVIEW_FIELD = 3087,
|
|
105
|
+
DUPLICATE_DIAGRAMVIEW_FIELD = 3088,
|
|
103
106
|
BINDING_ERROR = 4000,
|
|
107
|
+
NONEXISTENT_MODULE = 4001,
|
|
104
108
|
UNSUPPORTED = 5000,
|
|
105
109
|
CIRCULAR_REF = 5001,
|
|
106
110
|
SAME_ENDPOINT = 5002,
|
|
@@ -4,8 +4,11 @@ export type FilepathId = string & {
|
|
|
4
4
|
[__filepathIdBrand]: true;
|
|
5
5
|
};
|
|
6
6
|
export declare class Filepath implements Internable<FilepathId> {
|
|
7
|
+
private readonly protocol?;
|
|
7
8
|
private readonly path;
|
|
8
|
-
constructor(absolutePath: string
|
|
9
|
+
constructor(absolutePath: string, options?: {
|
|
10
|
+
protocol?: string;
|
|
11
|
+
});
|
|
9
12
|
intern(): FilepathId;
|
|
10
13
|
static from(absolutePath: string): Filepath;
|
|
11
14
|
static resolve(fromDir: string, relativePath: string): Filepath;
|
|
@@ -19,7 +22,10 @@ export declare class Filepath implements Internable<FilepathId> {
|
|
|
19
22
|
relativeTo(baseDir: string): string;
|
|
20
23
|
toString(): string;
|
|
21
24
|
equals(other: Filepath): boolean;
|
|
22
|
-
|
|
25
|
+
isParentOf(other: Filepath): boolean;
|
|
26
|
+
toUri(options?: {
|
|
27
|
+
protocol?: string;
|
|
28
|
+
}): string;
|
|
23
29
|
static isRelative(p: string): boolean;
|
|
24
30
|
}
|
|
25
31
|
export declare function resolveImportFilepath(currentFilepath: Filepath, relativePath: string): Filepath | undefined;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export * from './module';
|
|
1
2
|
export * from './errors';
|
|
2
3
|
export * from './report';
|
|
3
4
|
export * from './position';
|
|
@@ -5,3 +6,4 @@ export * from './filepath';
|
|
|
5
6
|
export * from './internable';
|
|
6
7
|
export * from './symbol';
|
|
7
8
|
export * from './schemaJson';
|
|
9
|
+
export * from './keywords';
|
|
@@ -7,9 +7,13 @@ export declare enum ElementKind {
|
|
|
7
7
|
Indexes = "indexes",
|
|
8
8
|
TableGroup = "tablegroup",
|
|
9
9
|
TablePartial = "tablepartial",
|
|
10
|
-
|
|
10
|
+
Checks = "checks",
|
|
11
11
|
Records = "records",
|
|
12
|
-
DiagramView = "diagramview"
|
|
12
|
+
DiagramView = "diagramview",
|
|
13
|
+
DiagramViewTables = "tables",
|
|
14
|
+
DiagramViewNotes = "notes",
|
|
15
|
+
DiagramViewTableGroups = "tablegroups",
|
|
16
|
+
DiagramViewSchemas = "schemas"
|
|
13
17
|
}
|
|
14
18
|
export declare enum SettingName {
|
|
15
19
|
Color = "color",
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { default as Compiler } from '../../compiler';
|
|
2
|
-
import { default as Report } from './report';
|
|
3
2
|
export declare const PASS_THROUGH: unique symbol;
|
|
4
3
|
export type PassThrough = typeof PASS_THROUGH;
|
|
5
4
|
export declare const UNHANDLED: unique symbol;
|
|
6
5
|
export type Unhandled = typeof UNHANDLED;
|
|
7
6
|
export interface Module {
|
|
8
|
-
[index: string]: undefined | ((compiler: Compiler, ...args: any[]) =>
|
|
7
|
+
[index: string]: undefined | ((compiler: Compiler, ...args: any[]) => any);
|
|
9
8
|
}
|