@dbml/parse 5.4.1 → 5.5.1-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/__tests__/snapshots/binder/binder.test.d.ts +1 -0
- package/dist/__tests__/snapshots/interpreter/interpreter.test.d.ts +1 -0
- package/dist/__tests__/snapshots/lexer/lexer.test.d.ts +1 -0
- package/dist/__tests__/snapshots/parser/parser.test.d.ts +1 -0
- package/dist/__tests__/snapshots/validator/validator.test.d.ts +1 -0
- package/dist/dbml-parse.js +29 -10
- package/dist/dbml-parse.mjs +8506 -4787
- package/dist/index.d.ts +2 -0
- package/dist/src/core/analyzer/binder/binder.d.ts +4 -3
- package/dist/src/core/analyzer/binder/elementBinder/checks.d.ts +12 -11
- package/dist/src/core/analyzer/binder/elementBinder/custom.d.ts +15 -9
- package/dist/src/core/analyzer/binder/elementBinder/enum.d.ts +15 -11
- package/dist/src/core/analyzer/binder/elementBinder/indexes.d.ts +16 -16
- package/dist/src/core/analyzer/binder/elementBinder/note.d.ts +15 -11
- package/dist/src/core/analyzer/binder/elementBinder/project.d.ts +15 -9
- package/dist/src/core/analyzer/binder/elementBinder/ref.d.ts +16 -16
- package/dist/src/core/analyzer/binder/elementBinder/table.d.ts +20 -48
- package/dist/src/core/analyzer/binder/elementBinder/tableGroup.d.ts +16 -16
- package/dist/src/core/analyzer/binder/elementBinder/tablePartial.d.ts +18 -36
- package/dist/src/core/analyzer/binder/types.d.ts +3 -16
- package/dist/src/core/analyzer/binder/utils.d.ts +18 -2
- package/dist/src/core/analyzer/symbol/symbolIndex.d.ts +2 -4
- package/dist/src/core/analyzer/symbol/symbols.d.ts +9 -8
- package/dist/src/core/analyzer/symbol/utils.d.ts +3 -3
- package/dist/src/core/analyzer/utils.d.ts +8 -5
- package/dist/src/core/analyzer/validator/elementValidators/table.d.ts +1 -3
- package/dist/src/core/analyzer/validator/utils.d.ts +18 -3
- package/dist/src/core/interpreter/types.d.ts +1 -1
- package/dist/src/core/lexer/tokens.d.ts +0 -1
- package/dist/src/core/parser/nodes.d.ts +3 -12
- package/dist/src/core/parser/parser.d.ts +0 -1
- package/dist/src/core/parser/utils.d.ts +1 -0
- package/package.json +3 -2
- package/dist/src/core/analyzer/binder/elementBinder/elementBinder.d.ts +0 -25
|
@@ -39,8 +39,7 @@ export declare enum SyntaxNodeKind {
|
|
|
39
39
|
PRIMARY_EXPRESSION = "<primary-expression>",
|
|
40
40
|
GROUP_EXPRESSION = "<group-expression>",
|
|
41
41
|
DUMMY = "<dummy>",
|
|
42
|
-
ARRAY = "<array>"
|
|
43
|
-
PARTIAL_INJECTION = "<partial-injection>"
|
|
42
|
+
ARRAY = "<array>"
|
|
44
43
|
}
|
|
45
44
|
export declare class ProgramNode extends SyntaxNode {
|
|
46
45
|
body: ElementDeclarationNode[];
|
|
@@ -129,22 +128,14 @@ export declare class FunctionApplicationNode extends SyntaxNode {
|
|
|
129
128
|
}
|
|
130
129
|
export declare class BlockExpressionNode extends SyntaxNode {
|
|
131
130
|
blockOpenBrace?: SyntaxToken;
|
|
132
|
-
body: (
|
|
131
|
+
body: (ElementDeclarationNode | FunctionApplicationNode)[];
|
|
133
132
|
blockCloseBrace?: SyntaxToken;
|
|
134
133
|
constructor({ blockOpenBrace, body, blockCloseBrace, }: {
|
|
135
134
|
blockOpenBrace?: SyntaxToken;
|
|
136
|
-
body?: (
|
|
135
|
+
body?: (ElementDeclarationNode | FunctionApplicationNode)[];
|
|
137
136
|
blockCloseBrace?: SyntaxToken;
|
|
138
137
|
}, id: SyntaxNodeId);
|
|
139
138
|
}
|
|
140
|
-
export declare class PartialInjectionNode extends SyntaxNode {
|
|
141
|
-
op?: SyntaxToken;
|
|
142
|
-
partial?: VariableNode;
|
|
143
|
-
constructor({ op, partial }: {
|
|
144
|
-
op?: SyntaxToken;
|
|
145
|
-
partial?: VariableNode;
|
|
146
|
-
}, id: SyntaxNodeId);
|
|
147
|
-
}
|
|
148
139
|
export declare class ListExpressionNode extends SyntaxNode {
|
|
149
140
|
listOpenBracket?: SyntaxToken;
|
|
150
141
|
elementList: AttributeNode[];
|
|
@@ -49,4 +49,5 @@ type DotDelimitedIdentifier = PrimaryExpressionNode | (AccessExpression & {
|
|
|
49
49
|
export declare function isAccessExpression(node?: SyntaxNode): node is AccessExpression;
|
|
50
50
|
export declare function isDotDelimitedIdentifier(node?: SyntaxNode): node is DotDelimitedIdentifier;
|
|
51
51
|
export declare function extractStringFromIdentifierStream(stream?: IdentiferStreamNode): Option<string>;
|
|
52
|
+
export declare function getElementName(element: ElementDeclarationNode): Option<string>;
|
|
52
53
|
export {};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package",
|
|
3
3
|
"name": "@dbml/parse",
|
|
4
|
-
"version": "5.
|
|
4
|
+
"version": "5.5.1-alpha.0",
|
|
5
5
|
"description": "DBML parser v2",
|
|
6
6
|
"author": "Holistics <dev@holistics.io>",
|
|
7
7
|
"license": "Apache-2.0",
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
"types": "./dist/index.d.ts",
|
|
17
17
|
"exports": {
|
|
18
18
|
".": {
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
19
20
|
"import": "./dist/dbml-parse.mjs",
|
|
20
21
|
"require": "./dist/dbml-parse.js"
|
|
21
22
|
}
|
|
@@ -53,5 +54,5 @@
|
|
|
53
54
|
"engines": {
|
|
54
55
|
"node": ">=18"
|
|
55
56
|
},
|
|
56
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "355cbecd2d809b9750aea2854fbc85bf469db257"
|
|
57
58
|
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { ElementDeclarationNode, SyntaxNode } from '../../../parser/nodes';
|
|
2
|
-
import { ArgumentBinderRule, BinderRule, SettingListBinderRule } from '../types';
|
|
3
|
-
import { CompileError } from '../../../errors';
|
|
4
|
-
import { default as SymbolFactory } from '../../symbol/factory';
|
|
5
|
-
export default abstract class ElementBinder {
|
|
6
|
-
protected abstract subfield: {
|
|
7
|
-
arg: ArgumentBinderRule;
|
|
8
|
-
settingList: SettingListBinderRule;
|
|
9
|
-
};
|
|
10
|
-
protected abstract settingList: SettingListBinderRule;
|
|
11
|
-
protected injectionBinderRule?: BinderRule;
|
|
12
|
-
private errors;
|
|
13
|
-
private declarationNode;
|
|
14
|
-
constructor(declarationNode: ElementDeclarationNode, errors: CompileError[]);
|
|
15
|
-
bind(): void;
|
|
16
|
-
private bindSettingList;
|
|
17
|
-
private bindBody;
|
|
18
|
-
private bindSubfield;
|
|
19
|
-
private bindPartialInjection;
|
|
20
|
-
private scanAndBind;
|
|
21
|
-
private bindFragments;
|
|
22
|
-
private resolveIndexStack;
|
|
23
|
-
protected logError(node: SyntaxNode, message: string, ignoreError: boolean): void;
|
|
24
|
-
resolveInjections(symbolFactory: SymbolFactory): void;
|
|
25
|
-
}
|