@dbml/parse 6.5.0 → 7.0.0-alpha.1
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 +0 -0
- package/dist/__tests__/examples/binder/binder.test.d.ts +0 -0
- package/dist/__tests__/examples/binder/records.test.d.ts +0 -0
- package/dist/__tests__/examples/compiler/applyTextEdits.test.d.ts +0 -0
- package/dist/__tests__/examples/compiler/identifierUtils.test.d.ts +0 -0
- package/dist/__tests__/examples/compiler/renameTable.test.d.ts +0 -0
- package/dist/__tests__/examples/compiler/splitQualifiedIdentifier.test.d.ts +0 -0
- package/dist/__tests__/examples/compiler/stringUtils.test.d.ts +0 -0
- package/dist/__tests__/examples/compiler/syncDiagramView.test.d.ts +1 -0
- package/dist/__tests__/examples/interpreter/interpreter.test.d.ts +0 -0
- package/dist/__tests__/examples/interpreter/record/data.test.d.ts +0 -0
- package/dist/__tests__/examples/interpreter/record/fk.test.d.ts +0 -0
- package/dist/__tests__/examples/interpreter/record/increment.test.d.ts +0 -0
- package/dist/__tests__/examples/interpreter/record/multi_records.test.d.ts +0 -0
- package/dist/__tests__/examples/interpreter/record/pk.test.d.ts +0 -0
- package/dist/__tests__/examples/interpreter/record/table_partial.test.d.ts +0 -0
- package/dist/__tests__/examples/interpreter/record/type_compatibility.test.d.ts +0 -0
- package/dist/__tests__/examples/interpreter/record/unique.test.d.ts +0 -0
- package/dist/__tests__/examples/lexer/lexer.test.d.ts +0 -0
- package/dist/__tests__/examples/lexer/scientific-notation.test.d.ts +0 -0
- package/dist/__tests__/examples/parser/parser.test.d.ts +0 -0
- package/dist/__tests__/examples/services/definition/general.test.d.ts +0 -0
- package/dist/__tests__/examples/services/definition/records.test.d.ts +0 -0
- package/dist/__tests__/examples/services/references/general.test.d.ts +0 -0
- package/dist/__tests__/examples/services/references/records.test.d.ts +0 -0
- package/dist/__tests__/examples/services/service_utils.test.d.ts +0 -0
- package/dist/__tests__/examples/services/suggestions/general.test.d.ts +0 -0
- package/dist/__tests__/examples/services/suggestions/suggestions_diagramview.test.d.ts +1 -0
- package/dist/__tests__/examples/services/suggestions/suggestions_records.test.d.ts +0 -0
- package/dist/__tests__/examples/validator/records.test.d.ts +0 -0
- package/dist/__tests__/examples/validator/validator.test.d.ts +0 -0
- package/dist/__tests__/examples/wildcard/wildcard.test.d.ts +1 -0
- package/dist/__tests__/fuzz/interpreter.test.d.ts +0 -0
- package/dist/__tests__/fuzz/parser.test.d.ts +0 -0
- package/dist/__tests__/fuzz/services.test.d.ts +0 -0
- package/dist/__tests__/properties/lexer.test.d.ts +0 -0
- package/dist/__tests__/properties/parser.test.d.ts +0 -0
- package/dist/__tests__/snapshots/binder/binder.test.d.ts +0 -0
- package/dist/__tests__/snapshots/interpreter/interpreter.test.d.ts +0 -0
- package/dist/__tests__/snapshots/lexer/lexer.test.d.ts +0 -0
- package/dist/__tests__/snapshots/nan/nan.test.d.ts +0 -0
- package/dist/__tests__/snapshots/parser/parser.test.d.ts +0 -0
- package/dist/__tests__/snapshots/validator/validator.test.d.ts +0 -0
- package/dist/__tests__/utils/arbitraries/grammars.d.ts +1 -1
- package/dist/__tests__/utils/arbitraries/index.d.ts +0 -0
- package/dist/__tests__/utils/arbitraries/tokens.d.ts +0 -0
- package/dist/__tests__/utils/arbitraries/utils.d.ts +0 -0
- package/dist/__tests__/utils/compiler.d.ts +0 -0
- package/dist/__tests__/utils/index.d.ts +0 -0
- package/dist/__tests__/utils/mocks.d.ts +0 -0
- package/dist/__tests__/utils/testHelpers.d.ts +0 -0
- package/dist/dbml-parse.js +19 -11
- package/dist/dbml-parse.mjs +868 -133
- package/dist/index.d.ts +0 -0
- package/dist/src/compiler/index.d.ts +7 -2
- package/dist/src/compiler/queries/container/element.d.ts +0 -0
- package/dist/src/compiler/queries/container/index.d.ts +0 -0
- package/dist/src/compiler/queries/container/scope.d.ts +0 -0
- package/dist/src/compiler/queries/container/scopeKind.d.ts +0 -0
- package/dist/src/compiler/queries/container/stack.d.ts +0 -0
- package/dist/src/compiler/queries/container/token.d.ts +0 -0
- package/dist/src/compiler/queries/parse.d.ts +0 -0
- package/dist/src/compiler/queries/symbol.d.ts +0 -0
- package/dist/src/compiler/queries/token.d.ts +0 -0
- package/dist/src/compiler/queries/transform/applyTextEdits.d.ts +1 -1
- package/dist/src/compiler/queries/transform/index.d.ts +1 -0
- package/dist/src/compiler/queries/transform/renameTable.d.ts +0 -0
- package/dist/src/compiler/queries/transform/syncDiagramView.d.ts +39 -0
- package/dist/src/compiler/queries/transform/utils.d.ts +0 -0
- package/dist/src/compiler/queries/utils.d.ts +0 -0
- package/dist/src/compiler/types.d.ts +2 -1
- package/dist/src/constants.d.ts +0 -0
- package/dist/src/core/analyzer/analyzer.d.ts +0 -0
- package/dist/src/core/analyzer/binder/binder.d.ts +0 -0
- package/dist/src/core/analyzer/binder/elementBinder/checks.d.ts +0 -0
- package/dist/src/core/analyzer/binder/elementBinder/custom.d.ts +0 -0
- package/dist/src/core/analyzer/binder/elementBinder/diagramView.d.ts +20 -0
- package/dist/src/core/analyzer/binder/elementBinder/enum.d.ts +0 -0
- package/dist/src/core/analyzer/binder/elementBinder/indexes.d.ts +0 -0
- package/dist/src/core/analyzer/binder/elementBinder/note.d.ts +0 -0
- package/dist/src/core/analyzer/binder/elementBinder/project.d.ts +0 -0
- package/dist/src/core/analyzer/binder/elementBinder/records.d.ts +0 -0
- package/dist/src/core/analyzer/binder/elementBinder/ref.d.ts +0 -0
- package/dist/src/core/analyzer/binder/elementBinder/table.d.ts +0 -0
- package/dist/src/core/analyzer/binder/elementBinder/tableGroup.d.ts +0 -0
- package/dist/src/core/analyzer/binder/elementBinder/tablePartial.d.ts +0 -0
- package/dist/src/core/analyzer/binder/types.d.ts +0 -0
- package/dist/src/core/analyzer/binder/utils.d.ts +2 -1
- package/dist/src/core/analyzer/symbol/factory.d.ts +0 -0
- package/dist/src/core/analyzer/symbol/symbolIndex.d.ts +5 -1
- package/dist/src/core/analyzer/symbol/symbolTable.d.ts +0 -0
- package/dist/src/core/analyzer/symbol/symbols.d.ts +26 -0
- package/dist/src/core/analyzer/symbol/utils.d.ts +0 -0
- package/dist/src/core/analyzer/types.d.ts +2 -1
- package/dist/src/core/analyzer/utils.d.ts +0 -0
- package/dist/src/core/analyzer/validator/elementValidators/checks.d.ts +5 -2
- package/dist/src/core/analyzer/validator/elementValidators/custom.d.ts +5 -2
- package/dist/src/core/analyzer/validator/elementValidators/diagramView.d.ts +31 -0
- package/dist/src/core/analyzer/validator/elementValidators/enum.d.ts +5 -2
- package/dist/src/core/analyzer/validator/elementValidators/indexes.d.ts +5 -2
- package/dist/src/core/analyzer/validator/elementValidators/note.d.ts +5 -2
- package/dist/src/core/analyzer/validator/elementValidators/project.d.ts +5 -2
- package/dist/src/core/analyzer/validator/elementValidators/records.d.ts +5 -2
- package/dist/src/core/analyzer/validator/elementValidators/ref.d.ts +5 -2
- package/dist/src/core/analyzer/validator/elementValidators/table.d.ts +5 -2
- package/dist/src/core/analyzer/validator/elementValidators/tableGroup.d.ts +5 -2
- package/dist/src/core/analyzer/validator/elementValidators/tablePartial.d.ts +5 -2
- package/dist/src/core/analyzer/validator/types.d.ts +5 -2
- package/dist/src/core/analyzer/validator/utils.d.ts +2 -1
- package/dist/src/core/analyzer/validator/validator.d.ts +0 -0
- package/dist/src/core/errors.d.ts +4 -0
- package/dist/src/core/interpreter/elementInterpreter/diagramView.d.ts +13 -0
- package/dist/src/core/interpreter/elementInterpreter/enum.d.ts +0 -0
- package/dist/src/core/interpreter/elementInterpreter/project.d.ts +0 -0
- package/dist/src/core/interpreter/elementInterpreter/ref.d.ts +0 -0
- package/dist/src/core/interpreter/elementInterpreter/sticky_note.d.ts +0 -0
- package/dist/src/core/interpreter/elementInterpreter/table.d.ts +0 -0
- package/dist/src/core/interpreter/elementInterpreter/tableGroup.d.ts +0 -0
- package/dist/src/core/interpreter/elementInterpreter/tablePartial.d.ts +0 -0
- package/dist/src/core/interpreter/interpreter.d.ts +0 -0
- package/dist/src/core/interpreter/records/index.d.ts +0 -0
- package/dist/src/core/interpreter/records/utils/constraints/fk.d.ts +0 -0
- package/dist/src/core/interpreter/records/utils/constraints/helper.d.ts +0 -0
- package/dist/src/core/interpreter/records/utils/constraints/index.d.ts +0 -0
- package/dist/src/core/interpreter/records/utils/constraints/pk.d.ts +0 -0
- package/dist/src/core/interpreter/records/utils/constraints/unique.d.ts +0 -0
- package/dist/src/core/interpreter/records/utils/data/index.d.ts +0 -0
- package/dist/src/core/interpreter/records/utils/data/sqlTypes.d.ts +0 -0
- package/dist/src/core/interpreter/records/utils/data/values.d.ts +0 -0
- package/dist/src/core/interpreter/records/utils/index.d.ts +0 -0
- package/dist/src/core/interpreter/types.d.ts +31 -0
- package/dist/src/core/interpreter/utils.d.ts +0 -0
- package/dist/src/core/lexer/lexer.d.ts +0 -0
- package/dist/src/core/lexer/tokens.d.ts +2 -1
- package/dist/src/core/lexer/utils.d.ts +0 -0
- package/dist/src/core/option.d.ts +0 -0
- package/dist/src/core/parser/contextStack.d.ts +0 -0
- package/dist/src/core/parser/factory.d.ts +0 -0
- package/dist/src/core/parser/nodes.d.ts +7 -0
- package/dist/src/core/parser/parser.d.ts +0 -0
- package/dist/src/core/parser/utils.d.ts +1 -0
- package/dist/src/core/report.d.ts +0 -0
- package/dist/src/core/types.d.ts +0 -0
- package/dist/src/core/utils.d.ts +0 -0
- package/dist/src/index.d.ts +4 -1
- package/dist/src/services/definition/provider.d.ts +0 -0
- package/dist/src/services/diagnostics/provider.d.ts +0 -0
- package/dist/src/services/index.d.ts +1 -0
- package/dist/src/services/monarch.d.ts +3 -0
- package/dist/src/services/references/provider.d.ts +0 -0
- package/dist/src/services/suggestions/provider.d.ts +0 -0
- package/dist/src/services/suggestions/recordRowSnippet.d.ts +0 -0
- package/dist/src/services/suggestions/utils.d.ts +0 -0
- package/dist/src/services/types.d.ts +0 -0
- package/dist/src/services/utils.d.ts +0 -0
- package/package.json +2 -3
package/dist/index.d.ts
CHANGED
|
File without changes
|
|
@@ -3,10 +3,10 @@ import { SyntaxToken } from '../core/lexer/tokens';
|
|
|
3
3
|
import { Database } from '../core/interpreter/types';
|
|
4
4
|
import { default as Report } from '../core/report';
|
|
5
5
|
import { DBMLCompletionItemProvider, DBMLDefinitionProvider, DBMLReferencesProvider, DBMLDiagnosticsProvider } from '../services/index';
|
|
6
|
-
import { TextEdit, TableNameInput } from './queries/transform';
|
|
6
|
+
import { TextEdit, TableNameInput, DiagramViewSyncOperation, DiagramViewBlock } from './queries/transform';
|
|
7
7
|
import { splitQualifiedIdentifier, unescapeString, escapeString, formatRecordValue, isValidIdentifier, addDoubleQuoteIfNeeded } from './queries/utils';
|
|
8
8
|
export { ScopeKind } from './types';
|
|
9
|
-
export type { TextEdit, TableNameInput };
|
|
9
|
+
export type { TextEdit, TableNameInput, DiagramViewSyncOperation, DiagramViewBlock };
|
|
10
10
|
export { splitQualifiedIdentifier, unescapeString, escapeString, formatRecordValue, isValidIdentifier, addDoubleQuoteIfNeeded };
|
|
11
11
|
export default class Compiler {
|
|
12
12
|
private source;
|
|
@@ -17,6 +17,11 @@ export default class Compiler {
|
|
|
17
17
|
private query;
|
|
18
18
|
private interpret;
|
|
19
19
|
renameTable(oldName: TableNameInput, newName: TableNameInput): string;
|
|
20
|
+
syncDiagramView(operations: DiagramViewSyncOperation[], blocks?: DiagramViewBlock[]): {
|
|
21
|
+
newDbml: string;
|
|
22
|
+
edits: TextEdit[];
|
|
23
|
+
};
|
|
24
|
+
findDiagramViewBlocks(): DiagramViewBlock[];
|
|
20
25
|
applyTextEdits(edits: TextEdit[]): string;
|
|
21
26
|
readonly token: {
|
|
22
27
|
invalidStream: () => readonly SyntaxToken[];
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -10,4 +10,4 @@ export interface TextEdit {
|
|
|
10
10
|
* @param edits - Array of text edits to apply
|
|
11
11
|
* @returns The modified source string with all edits applied
|
|
12
12
|
*/
|
|
13
|
-
export declare function applyTextEdits(source: string, edits: TextEdit[]): string;
|
|
13
|
+
export declare function applyTextEdits(source: string, edits: TextEdit[], sorted?: boolean): string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { renameTable } from './renameTable';
|
|
2
2
|
export { applyTextEdits, type TextEdit } from './applyTextEdits';
|
|
3
3
|
export { type TableNameInput } from './utils';
|
|
4
|
+
export { syncDiagramView, findDiagramViewBlocks, type DiagramViewSyncOperation, type DiagramViewBlock } from './syncDiagramView';
|
|
File without changes
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { TextEdit } from './applyTextEdits';
|
|
2
|
+
export interface DiagramViewSyncOperation {
|
|
3
|
+
operation: 'create' | 'update' | 'delete';
|
|
4
|
+
name: string;
|
|
5
|
+
newName?: string;
|
|
6
|
+
visibleEntities?: {
|
|
7
|
+
tables?: Array<{
|
|
8
|
+
name: string;
|
|
9
|
+
schemaName: string;
|
|
10
|
+
}> | null;
|
|
11
|
+
stickyNotes?: Array<{
|
|
12
|
+
name: string;
|
|
13
|
+
}> | null;
|
|
14
|
+
tableGroups?: Array<{
|
|
15
|
+
name: string;
|
|
16
|
+
}> | null;
|
|
17
|
+
schemas?: Array<{
|
|
18
|
+
name: string;
|
|
19
|
+
}> | null;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export interface DiagramViewBlock {
|
|
23
|
+
name: string;
|
|
24
|
+
startIndex: number;
|
|
25
|
+
endIndex: number;
|
|
26
|
+
}
|
|
27
|
+
export declare function findDiagramViewBlocks(source: string): DiagramViewBlock[];
|
|
28
|
+
/**
|
|
29
|
+
* Synchronizes DiagramView blocks in DBML source code.
|
|
30
|
+
*
|
|
31
|
+
* @param dbml - The original DBML source code
|
|
32
|
+
* @param operations - Array of operations to apply (create, update, delete)
|
|
33
|
+
* @param blocks - Optional pre-parsed blocks from findDiagramViewBlocks. If not provided, parses internally.
|
|
34
|
+
* @returns Object containing the new DBML source code and the text edits applied
|
|
35
|
+
*/
|
|
36
|
+
export declare function syncDiagramView(dbml: string, operations: DiagramViewSyncOperation[], blocks?: DiagramViewBlock[]): {
|
|
37
|
+
newDbml: string;
|
|
38
|
+
edits: TextEdit[];
|
|
39
|
+
};
|
|
File without changes
|
|
File without changes
|
package/dist/src/constants.d.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ElementDeclarationNode, ProgramNode } from '../../../parser/nodes';
|
|
2
|
+
import { ElementBinder } from '../types';
|
|
3
|
+
import { SyntaxToken } from '../../../lexer/tokens';
|
|
4
|
+
import { CompileError } from '../../../errors';
|
|
5
|
+
import { default as SymbolFactory } from '../../symbol/factory';
|
|
6
|
+
export default class DiagramViewBinder implements ElementBinder {
|
|
7
|
+
private symbolFactory;
|
|
8
|
+
private declarationNode;
|
|
9
|
+
private ast;
|
|
10
|
+
constructor(declarationNode: ElementDeclarationNode & {
|
|
11
|
+
type: SyntaxToken;
|
|
12
|
+
}, ast: ProgramNode, symbolFactory: SymbolFactory);
|
|
13
|
+
bind(): CompileError[];
|
|
14
|
+
private bindBody;
|
|
15
|
+
private bindSubElements;
|
|
16
|
+
private bindTableReferences;
|
|
17
|
+
private bindNoteReferences;
|
|
18
|
+
private bindTableGroupReferences;
|
|
19
|
+
private bindSchemaReferences;
|
|
20
|
+
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -2,6 +2,7 @@ import { SyntaxToken } from '../../lexer/tokens';
|
|
|
2
2
|
import { ElementDeclarationNode, PrimaryExpressionNode, ProgramNode, SyntaxNode, VariableNode } from '../../parser/nodes';
|
|
3
3
|
import { default as ChecksBinder } from './elementBinder/checks';
|
|
4
4
|
import { default as CustomBinder } from './elementBinder/custom';
|
|
5
|
+
import { default as DiagramViewBinder } from './elementBinder/diagramView';
|
|
5
6
|
import { default as EnumBinder } from './elementBinder/enum';
|
|
6
7
|
import { default as IndexesBinder } from './elementBinder/indexes';
|
|
7
8
|
import { default as NoteBinder } from './elementBinder/note';
|
|
@@ -15,7 +16,7 @@ import { CompileError } from '../../errors';
|
|
|
15
16
|
import { default as RecordsBinder } from './elementBinder/records';
|
|
16
17
|
export declare function pickBinder(element: ElementDeclarationNode & {
|
|
17
18
|
type: SyntaxToken;
|
|
18
|
-
}): typeof ChecksBinder | typeof CustomBinder | typeof EnumBinder | typeof TableBinder | typeof TableGroupBinder | typeof ProjectBinder | typeof RefBinder | typeof NoteBinder | typeof IndexesBinder | typeof TablePartialBinder | typeof RecordsBinder;
|
|
19
|
+
}): typeof ChecksBinder | typeof CustomBinder | typeof EnumBinder | typeof TableBinder | typeof TableGroupBinder | typeof ProjectBinder | typeof RefBinder | typeof NoteBinder | typeof IndexesBinder | typeof TablePartialBinder | typeof RecordsBinder | typeof DiagramViewBinder;
|
|
19
20
|
export declare function scanNonListNodeForBinding(node?: SyntaxNode): {
|
|
20
21
|
variables: (PrimaryExpressionNode & {
|
|
21
22
|
expression: VariableNode;
|
|
File without changes
|
|
@@ -10,7 +10,9 @@ export declare enum SymbolKind {
|
|
|
10
10
|
EnumField = "Enum field",
|
|
11
11
|
Note = "Note",
|
|
12
12
|
TablePartial = "TablePartial",
|
|
13
|
-
PartialInjection = "PartialInjection"
|
|
13
|
+
PartialInjection = "PartialInjection",
|
|
14
|
+
DiagramView = "DiagramView",
|
|
15
|
+
DiagramViewField = "DiagramView field"
|
|
14
16
|
}
|
|
15
17
|
export declare function createSchemaSymbolIndex(key: string): NodeSymbolIndex;
|
|
16
18
|
export declare function createTableSymbolIndex(key: string): NodeSymbolIndex;
|
|
@@ -22,6 +24,8 @@ export declare function createTableGroupFieldSymbolIndex(key: string): NodeSymbo
|
|
|
22
24
|
export declare function createStickyNoteSymbolIndex(key: string): NodeSymbolIndex;
|
|
23
25
|
export declare function createTablePartialSymbolIndex(key: string): NodeSymbolIndex;
|
|
24
26
|
export declare function createPartialInjectionSymbolIndex(key: string): NodeSymbolIndex;
|
|
27
|
+
export declare function createDiagramViewSymbolIndex(key: string): NodeSymbolIndex;
|
|
28
|
+
export declare function createDiagramViewFieldSymbolIndex(key: string): NodeSymbolIndex;
|
|
25
29
|
export declare function createNodeSymbolIndex(key: string, symbolKind: SymbolKind): NodeSymbolIndex;
|
|
26
30
|
export declare function destructureIndex(id: NodeSymbolIndex): Option<{
|
|
27
31
|
name: string;
|
|
File without changes
|
|
@@ -74,6 +74,32 @@ export declare class TableGroupFieldSymbol implements NodeSymbol {
|
|
|
74
74
|
declaration: SyntaxNode;
|
|
75
75
|
}, id: NodeSymbolId);
|
|
76
76
|
}
|
|
77
|
+
export declare class DiagramViewSymbol implements NodeSymbol {
|
|
78
|
+
id: NodeSymbolId;
|
|
79
|
+
symbolTable: SymbolTable;
|
|
80
|
+
declaration: SyntaxNode;
|
|
81
|
+
references: SyntaxNode[];
|
|
82
|
+
constructor({ symbolTable, declaration }: {
|
|
83
|
+
symbolTable: SymbolTable;
|
|
84
|
+
declaration: SyntaxNode;
|
|
85
|
+
}, id: NodeSymbolId);
|
|
86
|
+
}
|
|
87
|
+
export declare class DiagramViewFieldSymbol implements NodeSymbol {
|
|
88
|
+
id: NodeSymbolId;
|
|
89
|
+
declaration: SyntaxNode;
|
|
90
|
+
references: SyntaxNode[];
|
|
91
|
+
constructor({ declaration }: {
|
|
92
|
+
declaration: SyntaxNode;
|
|
93
|
+
}, id: NodeSymbolId);
|
|
94
|
+
}
|
|
95
|
+
export declare class StickyNoteSymbol implements NodeSymbol {
|
|
96
|
+
id: NodeSymbolId;
|
|
97
|
+
declaration: SyntaxNode;
|
|
98
|
+
references: SyntaxNode[];
|
|
99
|
+
constructor({ declaration }: {
|
|
100
|
+
declaration: SyntaxNode;
|
|
101
|
+
}, id: NodeSymbolId);
|
|
102
|
+
}
|
|
77
103
|
export declare class TablePartialSymbol implements NodeSymbol {
|
|
78
104
|
id: NodeSymbolId;
|
|
79
105
|
symbolTable: SymbolTable;
|
|
File without changes
|
|
File without changes
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as SymbolFactory } from '../../symbol/factory';
|
|
2
|
-
import { CompileError } from '../../../errors';
|
|
2
|
+
import { CompileError, CompileWarning } from '../../../errors';
|
|
3
3
|
import { ElementDeclarationNode } from '../../../parser/nodes';
|
|
4
4
|
import { SyntaxToken } from '../../../lexer/tokens';
|
|
5
5
|
import { ElementValidator } from '../types';
|
|
@@ -11,7 +11,10 @@ export default class ChecksValidator implements ElementValidator {
|
|
|
11
11
|
constructor(declarationNode: ElementDeclarationNode & {
|
|
12
12
|
type: SyntaxToken;
|
|
13
13
|
}, publicSymbolTable: SymbolTable, symbolFactory: SymbolFactory);
|
|
14
|
-
validate():
|
|
14
|
+
validate(): {
|
|
15
|
+
errors: CompileError[];
|
|
16
|
+
warnings: CompileWarning[];
|
|
17
|
+
};
|
|
15
18
|
private validateContext;
|
|
16
19
|
private validateName;
|
|
17
20
|
private validateAlias;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CompileError } from '../../../errors';
|
|
1
|
+
import { CompileError, CompileWarning } from '../../../errors';
|
|
2
2
|
import { BlockExpressionNode, ElementDeclarationNode, FunctionApplicationNode } from '../../../parser/nodes';
|
|
3
3
|
import { default as SymbolFactory } from '../../symbol/factory';
|
|
4
4
|
import { SyntaxToken } from '../../../lexer/tokens';
|
|
@@ -11,7 +11,10 @@ export default class CustomValidator implements ElementValidator {
|
|
|
11
11
|
constructor(declarationNode: ElementDeclarationNode & {
|
|
12
12
|
type: SyntaxToken;
|
|
13
13
|
}, publicSymbolTable: SymbolTable, symbolFactory: SymbolFactory);
|
|
14
|
-
validate():
|
|
14
|
+
validate(): {
|
|
15
|
+
errors: CompileError[];
|
|
16
|
+
warnings: CompileWarning[];
|
|
17
|
+
};
|
|
15
18
|
private validateContext;
|
|
16
19
|
private validateName;
|
|
17
20
|
private validateAlias;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { CompileError, CompileWarning } from '../../../errors';
|
|
2
|
+
import { ElementValidator } from '../types';
|
|
3
|
+
import { default as SymbolTable } from '../../symbol/symbolTable';
|
|
4
|
+
import { SyntaxToken } from '../../../lexer/tokens';
|
|
5
|
+
import { BlockExpressionNode, ElementDeclarationNode, FunctionApplicationNode } from '../../../parser/nodes';
|
|
6
|
+
import { default as SymbolFactory } from '../../symbol/factory';
|
|
7
|
+
export default class DiagramViewValidator implements ElementValidator {
|
|
8
|
+
private declarationNode;
|
|
9
|
+
private publicSymbolTable;
|
|
10
|
+
private symbolFactory;
|
|
11
|
+
constructor(declarationNode: ElementDeclarationNode & {
|
|
12
|
+
type: SyntaxToken;
|
|
13
|
+
}, publicSymbolTable: SymbolTable, symbolFactory: SymbolFactory);
|
|
14
|
+
validate(): {
|
|
15
|
+
errors: CompileError[];
|
|
16
|
+
warnings: CompileWarning[];
|
|
17
|
+
};
|
|
18
|
+
private validateContext;
|
|
19
|
+
private validateName;
|
|
20
|
+
private validateAlias;
|
|
21
|
+
registerElement(): CompileError[];
|
|
22
|
+
private validateSettingList;
|
|
23
|
+
validateBody(body?: FunctionApplicationNode | BlockExpressionNode): {
|
|
24
|
+
errors: CompileError[];
|
|
25
|
+
warnings: CompileWarning[];
|
|
26
|
+
};
|
|
27
|
+
validateFields(fields: FunctionApplicationNode[]): CompileError[];
|
|
28
|
+
private validateSubElements;
|
|
29
|
+
private validateSubBlock;
|
|
30
|
+
registerSubBlockFields(sub: ElementDeclarationNode): CompileError[];
|
|
31
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as SymbolFactory } from '../../symbol/factory';
|
|
2
|
-
import { CompileError } from '../../../errors';
|
|
2
|
+
import { CompileError, CompileWarning } from '../../../errors';
|
|
3
3
|
import { BlockExpressionNode, ElementDeclarationNode, FunctionApplicationNode, ListExpressionNode } from '../../../parser/nodes';
|
|
4
4
|
import { SyntaxToken } from '../../../lexer/tokens';
|
|
5
5
|
import { ElementValidator } from '../types';
|
|
@@ -11,7 +11,10 @@ export default class EnumValidator implements ElementValidator {
|
|
|
11
11
|
constructor(declarationNode: ElementDeclarationNode & {
|
|
12
12
|
type: SyntaxToken;
|
|
13
13
|
}, publicSymbolTable: SymbolTable, symbolFactory: SymbolFactory);
|
|
14
|
-
validate():
|
|
14
|
+
validate(): {
|
|
15
|
+
errors: CompileError[];
|
|
16
|
+
warnings: CompileWarning[];
|
|
17
|
+
};
|
|
15
18
|
private validateContext;
|
|
16
19
|
private validateName;
|
|
17
20
|
private validateAlias;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as SymbolFactory } from '../../symbol/factory';
|
|
2
|
-
import { CompileError } from '../../../errors';
|
|
2
|
+
import { CompileError, CompileWarning } from '../../../errors';
|
|
3
3
|
import { ElementDeclarationNode, SyntaxNode } from '../../../parser/nodes';
|
|
4
4
|
import { SyntaxToken } from '../../../lexer/tokens';
|
|
5
5
|
import { ElementValidator } from '../types';
|
|
@@ -11,7 +11,10 @@ export default class IndexesValidator implements ElementValidator {
|
|
|
11
11
|
constructor(declarationNode: ElementDeclarationNode & {
|
|
12
12
|
type: SyntaxToken;
|
|
13
13
|
}, publicSymbolTable: SymbolTable, symbolFactory: SymbolFactory);
|
|
14
|
-
validate():
|
|
14
|
+
validate(): {
|
|
15
|
+
errors: CompileError[];
|
|
16
|
+
warnings: CompileWarning[];
|
|
17
|
+
};
|
|
15
18
|
private validateContext;
|
|
16
19
|
private validateName;
|
|
17
20
|
private validateAlias;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as SymbolFactory } from '../../symbol/factory';
|
|
2
|
-
import { CompileError } from '../../../errors';
|
|
2
|
+
import { CompileError, CompileWarning } from '../../../errors';
|
|
3
3
|
import { BlockExpressionNode, ElementDeclarationNode, FunctionApplicationNode } from '../../../parser/nodes';
|
|
4
4
|
import { SyntaxToken } from '../../../lexer/tokens';
|
|
5
5
|
import { ElementValidator } from '../types';
|
|
@@ -11,7 +11,10 @@ export default class NoteValidator implements ElementValidator {
|
|
|
11
11
|
constructor(declarationNode: ElementDeclarationNode & {
|
|
12
12
|
type: SyntaxToken;
|
|
13
13
|
}, publicSymbolTable: SymbolTable, symbolFactory: SymbolFactory);
|
|
14
|
-
validate():
|
|
14
|
+
validate(): {
|
|
15
|
+
errors: CompileError[];
|
|
16
|
+
warnings: CompileWarning[];
|
|
17
|
+
};
|
|
15
18
|
private validateContext;
|
|
16
19
|
private validateName;
|
|
17
20
|
private validateAlias;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as SymbolFactory } from '../../symbol/factory';
|
|
2
|
-
import { CompileError } from '../../../errors';
|
|
2
|
+
import { CompileError, CompileWarning } from '../../../errors';
|
|
3
3
|
import { BlockExpressionNode, ElementDeclarationNode, FunctionApplicationNode } from '../../../parser/nodes';
|
|
4
4
|
import { SyntaxToken } from '../../../lexer/tokens';
|
|
5
5
|
import { ElementValidator } from '../types';
|
|
@@ -11,7 +11,10 @@ export default class ProjectValidator implements ElementValidator {
|
|
|
11
11
|
constructor(declarationNode: ElementDeclarationNode & {
|
|
12
12
|
type: SyntaxToken;
|
|
13
13
|
}, publicSymbolTable: SymbolTable, symbolFactory: SymbolFactory);
|
|
14
|
-
validate():
|
|
14
|
+
validate(): {
|
|
15
|
+
errors: CompileError[];
|
|
16
|
+
warnings: CompileWarning[];
|
|
17
|
+
};
|
|
15
18
|
private validateContext;
|
|
16
19
|
private validateName;
|
|
17
20
|
private validateAlias;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as SymbolFactory } from '../../symbol/factory';
|
|
2
|
-
import { CompileError } from '../../../errors';
|
|
2
|
+
import { CompileError, CompileWarning } from '../../../errors';
|
|
3
3
|
import { BlockExpressionNode, ElementDeclarationNode, FunctionApplicationNode } from '../../../parser/nodes';
|
|
4
4
|
import { SyntaxToken } from '../../../lexer/tokens';
|
|
5
5
|
import { ElementValidator } from '../types';
|
|
@@ -11,7 +11,10 @@ export default class RecordsValidator implements ElementValidator {
|
|
|
11
11
|
constructor(declarationNode: ElementDeclarationNode & {
|
|
12
12
|
type: SyntaxToken;
|
|
13
13
|
}, publicSymbolTable: SymbolTable, symbolFactory: SymbolFactory);
|
|
14
|
-
validate():
|
|
14
|
+
validate(): {
|
|
15
|
+
errors: CompileError[];
|
|
16
|
+
warnings: CompileWarning[];
|
|
17
|
+
};
|
|
15
18
|
private validateContext;
|
|
16
19
|
private validateName;
|
|
17
20
|
private validateTopLevelName;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SyntaxToken } from '../../../lexer/tokens';
|
|
2
2
|
import { default as SymbolFactory } from '../../symbol/factory';
|
|
3
|
-
import { CompileError } from '../../../errors';
|
|
3
|
+
import { CompileError, CompileWarning } from '../../../errors';
|
|
4
4
|
import { BlockExpressionNode, ElementDeclarationNode, FunctionApplicationNode, ListExpressionNode } from '../../../parser/nodes';
|
|
5
5
|
import { ElementValidator } from '../types';
|
|
6
6
|
import { default as SymbolTable } from '../../symbol/symbolTable';
|
|
@@ -11,7 +11,10 @@ export default class RefValidator implements ElementValidator {
|
|
|
11
11
|
constructor(declarationNode: ElementDeclarationNode & {
|
|
12
12
|
type: SyntaxToken;
|
|
13
13
|
}, publicSymbolTable: SymbolTable, symbolFactory: SymbolFactory);
|
|
14
|
-
validate():
|
|
14
|
+
validate(): {
|
|
15
|
+
errors: CompileError[];
|
|
16
|
+
warnings: CompileWarning[];
|
|
17
|
+
};
|
|
15
18
|
private validateContext;
|
|
16
19
|
private validateName;
|
|
17
20
|
private validateAlias;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as SymbolFactory } from '../../symbol/factory';
|
|
2
|
-
import { CompileError } from '../../../errors';
|
|
2
|
+
import { CompileError, CompileWarning } from '../../../errors';
|
|
3
3
|
import { BlockExpressionNode, ElementDeclarationNode, ExpressionNode, FunctionApplicationNode } from '../../../parser/nodes';
|
|
4
4
|
import { ElementValidator } from '../types';
|
|
5
5
|
import { SyntaxToken } from '../../../lexer/tokens';
|
|
@@ -11,7 +11,10 @@ export default class TableValidator implements ElementValidator {
|
|
|
11
11
|
constructor(declarationNode: ElementDeclarationNode & {
|
|
12
12
|
type: SyntaxToken;
|
|
13
13
|
}, publicSymbolTable: SymbolTable, symbolFactory: SymbolFactory);
|
|
14
|
-
validate():
|
|
14
|
+
validate(): {
|
|
15
|
+
errors: CompileError[];
|
|
16
|
+
warnings: CompileWarning[];
|
|
17
|
+
};
|
|
15
18
|
private validateContext;
|
|
16
19
|
private validateName;
|
|
17
20
|
private validateAlias;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CompileError } from '../../../errors';
|
|
1
|
+
import { CompileError, CompileWarning } from '../../../errors';
|
|
2
2
|
import { ElementValidator } from '../types';
|
|
3
3
|
import { default as SymbolTable } from '../../symbol/symbolTable';
|
|
4
4
|
import { SyntaxToken } from '../../../lexer/tokens';
|
|
@@ -11,7 +11,10 @@ export default class TableGroupValidator implements ElementValidator {
|
|
|
11
11
|
constructor(declarationNode: ElementDeclarationNode & {
|
|
12
12
|
type: SyntaxToken;
|
|
13
13
|
}, publicSymbolTable: SymbolTable, symbolFactory: SymbolFactory);
|
|
14
|
-
validate():
|
|
14
|
+
validate(): {
|
|
15
|
+
errors: CompileError[];
|
|
16
|
+
warnings: CompileWarning[];
|
|
17
|
+
};
|
|
15
18
|
private validateContext;
|
|
16
19
|
private validateName;
|
|
17
20
|
private validateAlias;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as SymbolFactory } from '../../symbol/factory';
|
|
2
|
-
import { CompileError } from '../../../errors';
|
|
2
|
+
import { CompileError, CompileWarning } from '../../../errors';
|
|
3
3
|
import { BlockExpressionNode, ElementDeclarationNode, ExpressionNode, FunctionApplicationNode } from '../../../parser/nodes';
|
|
4
4
|
import { ElementValidator } from '../types';
|
|
5
5
|
import { SyntaxToken } from '../../../lexer/tokens';
|
|
@@ -11,7 +11,10 @@ export default class TablePartialValidator implements ElementValidator {
|
|
|
11
11
|
constructor(declarationNode: ElementDeclarationNode & {
|
|
12
12
|
type: SyntaxToken;
|
|
13
13
|
}, publicSymbolTable: SymbolTable, symbolFactory: SymbolFactory);
|
|
14
|
-
validate():
|
|
14
|
+
validate(): {
|
|
15
|
+
errors: CompileError[];
|
|
16
|
+
warnings: CompileWarning[];
|
|
17
|
+
};
|
|
15
18
|
private validateContext;
|
|
16
19
|
private validateName;
|
|
17
20
|
private validateAlias;
|
|
@@ -14,9 +14,10 @@ import { default as Report } from '../../report';
|
|
|
14
14
|
import { default as TablePartialValidator } from './elementValidators/tablePartial';
|
|
15
15
|
import { default as ChecksValidator } from './elementValidators/checks';
|
|
16
16
|
import { default as RecordsValidator } from './elementValidators/records';
|
|
17
|
+
import { default as DiagramViewValidator } from './elementValidators/diagramView';
|
|
17
18
|
export declare function pickValidator(element: ElementDeclarationNode & {
|
|
18
19
|
type: SyntaxToken;
|
|
19
|
-
}): typeof CustomValidator | typeof EnumValidator | typeof TableValidator | typeof TableGroupValidator | typeof ProjectValidator | typeof RefValidator | typeof NoteValidator | typeof IndexesValidator | typeof TablePartialValidator | typeof ChecksValidator | typeof RecordsValidator;
|
|
20
|
+
}): typeof CustomValidator | typeof EnumValidator | typeof TableValidator | typeof TableGroupValidator | typeof ProjectValidator | typeof RefValidator | typeof NoteValidator | typeof IndexesValidator | typeof TablePartialValidator | typeof ChecksValidator | typeof RecordsValidator | typeof DiagramViewValidator;
|
|
20
21
|
export declare function isValidName(nameNode: SyntaxNode): boolean;
|
|
21
22
|
export declare function isValidAlias(aliasNode: SyntaxNode): aliasNode is PrimaryExpressionNode & {
|
|
22
23
|
expression: VariableNode;
|
|
File without changes
|
|
@@ -95,6 +95,10 @@ export declare enum CompileErrorCode {
|
|
|
95
95
|
INVALID_RECORDS_FIELD = 3079,
|
|
96
96
|
DUPLICATE_COLUMN_REFERENCES_IN_RECORDS = 3080,
|
|
97
97
|
DUPLICATE_RECORDS_FOR_TABLE = 3081,
|
|
98
|
+
INVALID_DIAGRAMVIEW_CONTEXT = 3082,
|
|
99
|
+
DUPLICATE_DIAGRAMVIEW_NAME = 3083,
|
|
100
|
+
INVALID_DIAGRAMVIEW_FIELD = 3084,
|
|
101
|
+
DUPLICATE_DIAGRAMVIEW_FIELD = 3085,
|
|
98
102
|
BINDING_ERROR = 4000,
|
|
99
103
|
UNSUPPORTED = 5000,
|
|
100
104
|
CIRCULAR_REF = 5001,
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CompileError } from '../../errors';
|
|
2
|
+
import { ElementDeclarationNode } from '../../parser/nodes';
|
|
3
|
+
import { ElementInterpreter, InterpreterDatabase } from '../types';
|
|
4
|
+
export declare class DiagramViewInterpreter implements ElementInterpreter {
|
|
5
|
+
private declarationNode;
|
|
6
|
+
private env;
|
|
7
|
+
private diagramView;
|
|
8
|
+
constructor(declarationNode: ElementDeclarationNode, env: InterpreterDatabase);
|
|
9
|
+
interpret(): CompileError[];
|
|
10
|
+
private interpretName;
|
|
11
|
+
private interpretBody;
|
|
12
|
+
private interpretSubBlock;
|
|
13
|
+
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|