@dbml/parse 5.4.1 → 5.5.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.
Files changed (34) hide show
  1. package/dist/__tests__/snapshots/binder/binder.test.d.ts +1 -0
  2. package/dist/__tests__/snapshots/interpreter/interpreter.test.d.ts +1 -0
  3. package/dist/__tests__/snapshots/lexer/lexer.test.d.ts +1 -0
  4. package/dist/__tests__/snapshots/parser/parser.test.d.ts +1 -0
  5. package/dist/__tests__/snapshots/validator/validator.test.d.ts +1 -0
  6. package/dist/dbml-parse.js +29 -10
  7. package/dist/dbml-parse.mjs +8502 -4787
  8. package/dist/index.d.ts +2 -0
  9. package/dist/src/core/analyzer/binder/binder.d.ts +4 -3
  10. package/dist/src/core/analyzer/binder/elementBinder/checks.d.ts +12 -11
  11. package/dist/src/core/analyzer/binder/elementBinder/custom.d.ts +15 -9
  12. package/dist/src/core/analyzer/binder/elementBinder/enum.d.ts +15 -11
  13. package/dist/src/core/analyzer/binder/elementBinder/indexes.d.ts +16 -16
  14. package/dist/src/core/analyzer/binder/elementBinder/note.d.ts +15 -11
  15. package/dist/src/core/analyzer/binder/elementBinder/project.d.ts +15 -9
  16. package/dist/src/core/analyzer/binder/elementBinder/ref.d.ts +16 -16
  17. package/dist/src/core/analyzer/binder/elementBinder/table.d.ts +20 -48
  18. package/dist/src/core/analyzer/binder/elementBinder/tableGroup.d.ts +16 -16
  19. package/dist/src/core/analyzer/binder/elementBinder/tablePartial.d.ts +18 -36
  20. package/dist/src/core/analyzer/binder/types.d.ts +3 -16
  21. package/dist/src/core/analyzer/binder/utils.d.ts +18 -2
  22. package/dist/src/core/analyzer/symbol/symbolIndex.d.ts +2 -4
  23. package/dist/src/core/analyzer/symbol/symbols.d.ts +9 -8
  24. package/dist/src/core/analyzer/symbol/utils.d.ts +3 -3
  25. package/dist/src/core/analyzer/utils.d.ts +8 -5
  26. package/dist/src/core/analyzer/validator/elementValidators/table.d.ts +1 -3
  27. package/dist/src/core/analyzer/validator/utils.d.ts +18 -3
  28. package/dist/src/core/interpreter/types.d.ts +1 -1
  29. package/dist/src/core/lexer/tokens.d.ts +0 -1
  30. package/dist/src/core/parser/nodes.d.ts +3 -12
  31. package/dist/src/core/parser/parser.d.ts +0 -1
  32. package/dist/src/core/parser/utils.d.ts +1 -0
  33. package/package.json +3 -2
  34. package/dist/src/core/analyzer/binder/elementBinder/elementBinder.d.ts +0 -25
@@ -0,0 +1,2 @@
1
+ export * from './src/index'
2
+ export {}
@@ -4,7 +4,8 @@ import { default as Report } from '../../report';
4
4
  import { default as SymbolFactory } from '../symbol/factory';
5
5
  export default class Binder {
6
6
  private ast;
7
- private errors;
8
- constructor(ast: ProgramNode);
9
- resolve(symbolFactory: SymbolFactory): Report<ProgramNode, CompileError>;
7
+ private symbolFactory;
8
+ constructor(ast: ProgramNode, symbolFactory: SymbolFactory);
9
+ private resolvePartialInjections;
10
+ resolve(): Report<ProgramNode, CompileError>;
10
11
  }
@@ -1,12 +1,13 @@
1
- import { default as ElementBinder } from './elementBinder';
2
- export default class ChecksBinder extends ElementBinder {
3
- protected subfield: {
4
- arg: {
5
- argBinderRules: {
6
- shouldBind: false;
7
- }[];
8
- };
9
- settingList: {};
10
- };
11
- protected settingList: {};
1
+ import { ElementDeclarationNode, ProgramNode, SyntaxToken } from '../../../..';
2
+ import { CompileError } from '../../../errors';
3
+ import { default as SymbolFactory } from '../../symbol/factory';
4
+ import { ElementBinder } from '../types';
5
+ export default class ChecksBinder implements ElementBinder {
6
+ private symbolFactory;
7
+ private declarationNode;
8
+ private ast;
9
+ constructor(declarationNode: ElementDeclarationNode & {
10
+ type: SyntaxToken;
11
+ }, ast: ProgramNode, symbolFactory: SymbolFactory);
12
+ bind(): CompileError[];
12
13
  }
@@ -1,10 +1,16 @@
1
- import { default as ElementBinder } from './elementBinder';
2
- export default class CustomBinder extends ElementBinder {
3
- protected subfield: {
4
- arg: {
5
- argBinderRules: never[];
6
- };
7
- settingList: {};
8
- };
9
- protected settingList: {};
1
+ import { CompileError } from '../../../errors';
2
+ import { ElementBinder } from '../types';
3
+ import { ElementDeclarationNode, ProgramNode } from '../../../parser/nodes';
4
+ import { SyntaxToken } from '../../../lexer/tokens';
5
+ import { default as SymbolFactory } from '../../symbol/factory';
6
+ export default class CustomBinder 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;
10
16
  }
@@ -1,12 +1,16 @@
1
- import { default as ElementBinder } from './elementBinder';
2
- export default class EnumBinder extends ElementBinder {
3
- protected subfield: {
4
- arg: {
5
- argBinderRules: {
6
- shouldBind: false;
7
- }[];
8
- };
9
- settingList: {};
10
- };
11
- protected settingList: {};
1
+ import { CompileError } from '../../../errors';
2
+ import { ElementBinder } from '../types';
3
+ import { ElementDeclarationNode, ProgramNode } from '../../../parser/nodes';
4
+ import { SyntaxToken } from '../../../lexer/tokens';
5
+ import { default as SymbolFactory } from '../../symbol/factory';
6
+ export default class EnumBinder 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;
12
16
  }
@@ -1,17 +1,17 @@
1
- import { SymbolKind } from '../../symbol/symbolIndex';
2
- import { default as ElementBinder } from './elementBinder';
3
- export default class IndexesBinder extends ElementBinder {
4
- protected subfield: {
5
- arg: {
6
- argBinderRules: {
7
- shouldBind: true;
8
- topSubnamesSymbolKind: SymbolKind[];
9
- remainingSubnamesSymbolKind: SymbolKind;
10
- ignoreNameNotFound: boolean;
11
- ignoreNameNotFoundForQuotedVariable: boolean;
12
- }[];
13
- };
14
- settingList: {};
15
- };
16
- protected settingList: {};
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 IndexesBinder 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 bindFields;
16
+ private bindSubElements;
17
17
  }
@@ -1,12 +1,16 @@
1
- import { default as ElementBinder } from './elementBinder';
2
- export default class NoteBinder extends ElementBinder {
3
- protected subfield: {
4
- arg: {
5
- argBinderRules: {
6
- shouldBind: false;
7
- }[];
8
- };
9
- settingList: {};
10
- };
11
- protected settingList: {};
1
+ import { CompileError } from '../../../errors';
2
+ import { ElementBinder } from '../types';
3
+ import { ElementDeclarationNode, ProgramNode } from '../../../parser/nodes';
4
+ import { SyntaxToken } from '../../../lexer/tokens';
5
+ import { default as SymbolFactory } from '../../symbol/factory';
6
+ export default class NoteBinder 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;
12
16
  }
@@ -1,10 +1,16 @@
1
- import { default as ElementBinder } from './elementBinder';
2
- export default class ProjectBinder extends ElementBinder {
3
- protected subfield: {
4
- arg: {
5
- argBinderRules: never[];
6
- };
7
- settingList: {};
8
- };
9
- protected settingList: {};
1
+ import { SyntaxToken } from '../../../lexer/tokens';
2
+ import { ElementBinder } from '../types';
3
+ import { ElementDeclarationNode, ProgramNode } from '../../../parser/nodes';
4
+ import { CompileError } from '../../../errors';
5
+ import { default as SymbolFactory } from '../../symbol/factory';
6
+ export default class ProjectBinder 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;
10
16
  }
@@ -1,17 +1,17 @@
1
- import { SymbolKind } from '../../symbol/symbolIndex';
2
- import { default as ElementBinder } from './elementBinder';
3
- export default class RefBinder extends ElementBinder {
4
- protected subfield: {
5
- arg: {
6
- argBinderRules: {
7
- shouldBind: true;
8
- topSubnamesSymbolKind: SymbolKind[];
9
- remainingSubnamesSymbolKind: SymbolKind;
10
- ignoreNameNotFound: boolean;
11
- ignoreNameNotFoundForQuotedVariable: boolean;
12
- }[];
13
- };
14
- settingList: {};
15
- };
16
- protected settingList: {};
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 RefBinder 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 bindFields;
16
+ private bindSubElements;
17
17
  }
@@ -1,49 +1,21 @@
1
- import { SymbolKind } from '../../symbol/symbolIndex';
2
- import { default as ElementBinder } from './elementBinder';
3
- export default class TableBinder extends ElementBinder {
4
- protected subfield: {
5
- arg: {
6
- argBinderRules: ({
7
- shouldBind: false;
8
- topSubnamesSymbolKind?: undefined;
9
- remainingSubnamesSymbolKind?: undefined;
10
- ignoreNameNotFound?: undefined;
11
- ignoreNameNotFoundForQuotedVariable?: undefined;
12
- } | {
13
- shouldBind: true;
14
- topSubnamesSymbolKind: SymbolKind[];
15
- remainingSubnamesSymbolKind: SymbolKind;
16
- ignoreNameNotFound: boolean;
17
- ignoreNameNotFoundForQuotedVariable: boolean;
18
- })[];
19
- };
20
- settingList: {
21
- ref: {
22
- shouldBind: true;
23
- topSubnamesSymbolKind: SymbolKind[];
24
- remainingSubnamesSymbolKind: SymbolKind;
25
- ignoreNameNotFound: boolean;
26
- ignoreNameNotFoundForQuotedVariable: boolean;
27
- };
28
- default: {
29
- shouldBind: true;
30
- topSubnamesSymbolKind: SymbolKind[];
31
- remainingSubnamesSymbolKind: SymbolKind;
32
- ignoreNameNotFound: boolean;
33
- keywords: string[];
34
- ignoreNameNotFoundForQuotedVariable: boolean;
35
- };
36
- check: {
37
- shouldBind: false;
38
- };
39
- };
40
- };
41
- protected settingList: {};
42
- protected injectionBinderRule: {
43
- shouldBind: true;
44
- topSubnamesSymbolKind: never[];
45
- remainingSubnamesSymbolKind: SymbolKind;
46
- ignoreNameNotFound: boolean;
47
- ignoreNameNotFoundForQuotedVariable: boolean;
48
- };
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 TableBinder 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
+ resolvePartialInjections(): CompileError[];
15
+ private bindBody;
16
+ private bindFields;
17
+ private tryToBindColumnType;
18
+ private tryToBindEnumFieldRef;
19
+ private bindInlineRef;
20
+ private bindSubElements;
49
21
  }
@@ -1,17 +1,17 @@
1
- import { SymbolKind } from '../../symbol/symbolIndex';
2
- import { default as ElementBinder } from './elementBinder';
3
- export default class TableGroupBinder extends ElementBinder {
4
- protected subfield: {
5
- arg: {
6
- argBinderRules: {
7
- shouldBind: true;
8
- topSubnamesSymbolKind: SymbolKind[];
9
- remainingSubnamesSymbolKind: SymbolKind;
10
- ignoreNameNotFound: boolean;
11
- ignoreNameNotFoundForQuotedVariable: boolean;
12
- }[];
13
- };
14
- settingList: {};
15
- };
16
- protected settingList: {};
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 TableGroupBinder 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 bindFields;
16
+ private bindSubElements;
17
17
  }
@@ -1,37 +1,19 @@
1
- import { SymbolKind } from '../../symbol/symbolIndex';
2
- import { default as ElementBinder } from './elementBinder';
3
- export default class TablePartialBinder extends ElementBinder {
4
- protected subfield: {
5
- arg: {
6
- argBinderRules: ({
7
- shouldBind: false;
8
- topSubnamesSymbolKind?: undefined;
9
- remainingSubnamesSymbolKind?: undefined;
10
- ignoreNameNotFound?: undefined;
11
- ignoreNameNotFoundForQuotedVariable?: undefined;
12
- } | {
13
- shouldBind: true;
14
- topSubnamesSymbolKind: SymbolKind[];
15
- remainingSubnamesSymbolKind: SymbolKind;
16
- ignoreNameNotFound: boolean;
17
- ignoreNameNotFoundForQuotedVariable: boolean;
18
- })[];
19
- };
20
- settingList: {
21
- ref: {
22
- shouldBind: true;
23
- topSubnamesSymbolKind: SymbolKind[];
24
- remainingSubnamesSymbolKind: SymbolKind;
25
- ignoreNameNotFound: boolean;
26
- ignoreNameNotFoundForQuotedVariable: boolean;
27
- };
28
- default: {
29
- shouldBind: false;
30
- };
31
- check: {
32
- shouldBind: false;
33
- };
34
- };
35
- };
36
- protected settingList: {};
1
+ import { ElementDeclarationNode, ProgramNode } from '../../../parser/nodes';
2
+ import { SyntaxToken } from '../../../lexer/tokens';
3
+ import { ElementBinder } from '../types';
4
+ import { CompileError } from '../../../errors';
5
+ import { default as SymbolFactory } from '../../symbol/factory';
6
+ export default class TablePartialBinder 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 bindFields;
16
+ private tryToBindColumnType;
17
+ private bindInlineRef;
18
+ private bindSubElements;
37
19
  }
@@ -1,17 +1,4 @@
1
- import { SymbolKind } from '../symbol/symbolIndex';
2
- export type BinderRule = {
3
- shouldBind: true;
4
- topSubnamesSymbolKind: SymbolKind[];
5
- remainingSubnamesSymbolKind: SymbolKind;
6
- ignoreNameNotFound: boolean;
7
- keywords?: readonly string[];
8
- ignoreNameNotFoundForQuotedVariable?: boolean;
9
- } | {
10
- shouldBind: false;
11
- };
12
- export interface ArgumentBinderRule {
13
- argBinderRules: BinderRule[];
14
- }
15
- export interface SettingListBinderRule {
16
- [index: string]: BinderRule;
1
+ import { CompileError } from '../../errors';
2
+ export interface ElementBinder {
3
+ bind(): CompileError[];
17
4
  }
@@ -1,5 +1,5 @@
1
1
  import { SyntaxToken } from '../../lexer/tokens';
2
- import { ElementDeclarationNode } from '../../parser/nodes';
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
5
  import { default as EnumBinder } from './elementBinder/enum';
@@ -10,6 +10,22 @@ import { default as RefBinder } from './elementBinder/ref';
10
10
  import { default as TableBinder } from './elementBinder/table';
11
11
  import { default as TableGroupBinder } from './elementBinder/tableGroup';
12
12
  import { default as TablePartialBinder } from './elementBinder/tablePartial';
13
+ import { SymbolKind } from '../symbol/symbolIndex';
14
+ import { CompileError } from '../../errors';
13
15
  export declare function pickBinder(element: ElementDeclarationNode & {
14
16
  type: SyntaxToken;
15
- }): typeof EnumBinder | typeof TableBinder | typeof TableGroupBinder | typeof ProjectBinder | typeof RefBinder | typeof NoteBinder | typeof IndexesBinder | typeof TablePartialBinder | typeof ChecksBinder | typeof CustomBinder;
17
+ }): typeof ChecksBinder | typeof CustomBinder | typeof EnumBinder | typeof TableBinder | typeof TableGroupBinder | typeof ProjectBinder | typeof RefBinder | typeof NoteBinder | typeof IndexesBinder | typeof TablePartialBinder;
18
+ export declare function scanNonListNodeForBinding(node?: SyntaxNode): {
19
+ variables: (PrimaryExpressionNode & {
20
+ expression: VariableNode;
21
+ })[];
22
+ tupleElements: (PrimaryExpressionNode & {
23
+ expression: VariableNode;
24
+ })[];
25
+ }[];
26
+ export declare function lookupAndBindInScope(initialScope: ElementDeclarationNode | ProgramNode, symbolInfos: {
27
+ node: PrimaryExpressionNode & {
28
+ expression: VariableNode;
29
+ };
30
+ kind: SymbolKind;
31
+ }[]): CompileError[];
@@ -10,7 +10,7 @@ export declare enum SymbolKind {
10
10
  EnumField = "Enum field",
11
11
  Note = "Note",
12
12
  TablePartial = "TablePartial",
13
- TablePartialInjection = "TablePartialInjection"
13
+ PartialInjection = "PartialInjection"
14
14
  }
15
15
  export declare function createSchemaSymbolIndex(key: string): NodeSymbolIndex;
16
16
  export declare function createTableSymbolIndex(key: string): NodeSymbolIndex;
@@ -21,12 +21,10 @@ export declare function createTableGroupSymbolIndex(key: string): NodeSymbolInde
21
21
  export declare function createTableGroupFieldSymbolIndex(key: string): NodeSymbolIndex;
22
22
  export declare function createStickyNoteSymbolIndex(key: string): NodeSymbolIndex;
23
23
  export declare function createTablePartialSymbolIndex(key: string): NodeSymbolIndex;
24
- export declare function createTablePartialInjectionSymbolIndex(key: string): NodeSymbolIndex;
24
+ export declare function createPartialInjectionSymbolIndex(key: string): NodeSymbolIndex;
25
25
  export declare function createNodeSymbolIndex(key: string, symbolKind: SymbolKind): NodeSymbolIndex;
26
26
  export declare function destructureIndex(id: NodeSymbolIndex): Option<{
27
27
  name: string;
28
28
  kind: SymbolKind;
29
29
  }>;
30
30
  export declare function isPublicSchemaIndex(id: NodeSymbolIndex): boolean;
31
- export declare function isInjectionIndex(id: NodeSymbolIndex): boolean;
32
- export declare function getInjectorIndex(injectionNodeIndex: NodeSymbolIndex): NodeSymbolIndex | null;
@@ -11,7 +11,6 @@ export interface NodeSymbol {
11
11
  symbolTable?: SymbolTable;
12
12
  declaration?: SyntaxNode;
13
13
  references: SyntaxNode[];
14
- injectorDeclaration?: SyntaxNode;
15
14
  }
16
15
  export declare class SchemaSymbol implements NodeSymbol {
17
16
  id: NodeSymbolId;
@@ -85,21 +84,23 @@ export declare class TablePartialSymbol implements NodeSymbol {
85
84
  declaration: SyntaxNode;
86
85
  }, id: NodeSymbolId);
87
86
  }
88
- export declare class TablePartialInjectionSymbol implements NodeSymbol {
87
+ export declare class PartialInjectionSymbol implements NodeSymbol {
89
88
  id: NodeSymbolId;
89
+ symbolTable: SymbolTable;
90
90
  declaration: SyntaxNode;
91
91
  references: SyntaxNode[];
92
- constructor({ declaration }: {
92
+ constructor({ symbolTable, declaration }: {
93
+ symbolTable: SymbolTable;
93
94
  declaration: SyntaxNode;
94
95
  }, id: NodeSymbolId);
95
96
  }
96
97
  export declare class TablePartialInjectedColumnSymbol implements NodeSymbol {
97
98
  id: NodeSymbolId;
98
- injectorDeclaration: SyntaxNode;
99
- injectorFieldSymbol: NodeSymbol;
99
+ declaration: SyntaxNode;
100
+ tablePartialSymbol: TablePartialSymbol;
100
101
  references: SyntaxNode[];
101
- constructor({ injectorFieldSymbol, injectorDeclaration }: {
102
- injectorFieldSymbol: NodeSymbol;
103
- injectorDeclaration: SyntaxNode;
102
+ constructor({ declaration, tablePartialSymbol }: {
103
+ declaration: SyntaxNode;
104
+ tablePartialSymbol: TablePartialSymbol;
104
105
  }, id: NodeSymbolId);
105
106
  }
@@ -1,4 +1,4 @@
1
- import { NodeSymbolIndex } from './symbolIndex';
2
- import { NodeSymbol, TablePartialInjectedColumnSymbol } from './symbols';
1
+ import { NodeSymbolIndex, SymbolKind } from './symbolIndex';
2
+ import { NodeSymbol } from './symbols';
3
3
  export declare function generatePossibleIndexes(name: string): NodeSymbolIndex[];
4
- export declare function getInjectedFieldSymbolFromInjectorFieldSymbol(injectorSymbol: NodeSymbol): typeof TablePartialInjectedColumnSymbol | null;
4
+ export declare function getSymbolKind(symbol: NodeSymbol): SymbolKind;
@@ -1,5 +1,5 @@
1
1
  import { Option } from '../option';
2
- import { ElementDeclarationNode, FunctionExpressionNode, InfixExpressionNode, PartialInjectionNode, PrimaryExpressionNode, SyntaxNode, VariableNode } from '../parser/nodes';
2
+ import { ElementDeclarationNode, FunctionExpressionNode, InfixExpressionNode, PrimaryExpressionNode, SyntaxNode, VariableNode } from '../parser/nodes';
3
3
  import { NodeSymbolIndex } from './symbol/symbolIndex';
4
4
  import { NodeSymbol } from './symbol/symbols';
5
5
  import { SyntaxToken } from '../lexer/tokens';
@@ -7,9 +7,13 @@ import { ElementKind } from './types';
7
7
  export declare function getElementKind(node?: ElementDeclarationNode): Option<ElementKind>;
8
8
  export declare function destructureMemberAccessExpression(node?: SyntaxNode): Option<SyntaxNode[]>;
9
9
  export declare function destructureComplexVariable(node?: SyntaxNode): Option<string[]>;
10
- export declare function destructureComplexTuple(node?: SyntaxNode): Option<{
11
- variables: string[];
12
- tupleElements?: string[];
10
+ export declare function destructureComplexVariableTuple(node?: SyntaxNode): Option<{
11
+ variables: (PrimaryExpressionNode & {
12
+ expression: VariableNode;
13
+ })[];
14
+ tupleElements: (PrimaryExpressionNode & {
15
+ expression: VariableNode;
16
+ })[];
13
17
  }>;
14
18
  export declare function extractVariableFromExpression(node?: SyntaxNode): Option<string>;
15
19
  export declare function destructureIndexNode(node?: SyntaxNode): Option<{
@@ -21,7 +25,6 @@ export declare function destructureIndexNode(node?: SyntaxNode): Option<{
21
25
  export declare function extractVarNameFromPrimaryVariable(node?: PrimaryExpressionNode & {
22
26
  expression: VariableNode;
23
27
  }): Option<string>;
24
- export declare function extractVarNameFromPartialInjection(node?: PartialInjectionNode): Option<string>;
25
28
  export declare function extractQuotedStringToken(value?: SyntaxNode): Option<string>;
26
29
  export declare function isBinaryRelationship(value?: SyntaxNode): value is InfixExpressionNode;
27
30
  export declare function isEqualTupleOperands(value: InfixExpressionNode): value is InfixExpressionNode;
@@ -1,6 +1,6 @@
1
1
  import { default as SymbolFactory } from '../../symbol/factory';
2
2
  import { CompileError } from '../../../errors';
3
- import { BlockExpressionNode, ElementDeclarationNode, ExpressionNode, FunctionApplicationNode, PartialInjectionNode } from '../../../parser/nodes';
3
+ import { BlockExpressionNode, ElementDeclarationNode, ExpressionNode, FunctionApplicationNode } from '../../../parser/nodes';
4
4
  import { ElementValidator } from '../types';
5
5
  import { SyntaxToken } from '../../../lexer/tokens';
6
6
  import { default as SymbolTable } from '../../symbol/symbolTable';
@@ -18,8 +18,6 @@ export default class TableValidator implements ElementValidator {
18
18
  private validateSettingList;
19
19
  registerElement(): CompileError[];
20
20
  validateBody(body?: FunctionApplicationNode | BlockExpressionNode): CompileError[];
21
- validateInjections(injections: PartialInjectionNode[]): CompileError[];
22
- registerInjection(injection: PartialInjectionNode): CompileError[];
23
21
  validateFields(fields: FunctionApplicationNode[]): CompileError[];
24
22
  registerField(field: FunctionApplicationNode): CompileError[];
25
23
  validateFieldSetting(parts: ExpressionNode[]): CompileError[];
@@ -1,5 +1,5 @@
1
- import { SyntaxToken } from '../../lexer/tokens';
2
- import { AttributeNode, BlockExpressionNode, ElementDeclarationNode, ListExpressionNode, PrefixExpressionNode, PrimaryExpressionNode, SyntaxNode, TupleExpressionNode, VariableNode } from '../../parser/nodes';
1
+ import { SyntaxToken, SyntaxTokenKind } from '../../lexer/tokens';
2
+ import { AttributeNode, BlockExpressionNode, ElementDeclarationNode, ListExpressionNode, LiteralNode, PrefixExpressionNode, PrimaryExpressionNode, SyntaxNode, TupleExpressionNode, VariableNode } from '../../parser/nodes';
3
3
  import { default as CustomValidator } from './elementValidators/custom';
4
4
  import { default as EnumValidator } from './elementValidators/enum';
5
5
  import { default as IndexesValidator } from './elementValidators/indexes';
@@ -32,12 +32,27 @@ export declare function hasComplexBody(node: ElementDeclarationNode): node is El
32
32
  export declare function hasSimpleBody(node: ElementDeclarationNode): node is ElementDeclarationNode & {
33
33
  bodyColon: SyntaxToken;
34
34
  };
35
+ export declare function isValidPartialInjection(node?: SyntaxNode): node is PrefixExpressionNode & {
36
+ op: {
37
+ value: '~';
38
+ };
39
+ };
35
40
  export declare function registerSchemaStack(variables: string[], globalSchema: SymbolTable, symbolFactory: SymbolFactory): SymbolTable;
36
41
  export declare function isRelationshipOp(op?: string): boolean;
37
42
  export declare function isValidColor(value?: SyntaxNode): boolean;
38
43
  export declare function isVoid(value?: SyntaxNode): boolean;
39
44
  export declare function isValidDefaultValue(value?: SyntaxNode): boolean;
40
- export declare function isExpressionANumber(value?: SyntaxNode): boolean;
45
+ export type SignedNumberExpression = (PrimaryExpressionNode & {
46
+ expression: LiteralNode & {
47
+ literal: {
48
+ kind: SyntaxTokenKind.NUMERIC_LITERAL;
49
+ };
50
+ };
51
+ }) | (PrefixExpressionNode & {
52
+ op: '-' | '+';
53
+ expression: SignedNumberExpression;
54
+ });
55
+ export declare function isExpressionASignedNumberExpression(value?: SyntaxNode): value is SignedNumberExpression;
41
56
  export declare function isUnaryRelationship(value?: SyntaxNode): value is PrefixExpressionNode;
42
57
  export declare function isTupleOfVariables(value?: SyntaxNode): value is TupleExpressionNode & {
43
58
  elementList: (PrimaryExpressionNode & {
@@ -17,7 +17,7 @@ export interface InterpreterDatabase {
17
17
  };
18
18
  ref: Map<ElementDeclarationNode, Ref>;
19
19
  enums: Map<ElementDeclarationNode, Enum>;
20
- groupOfTable: {
20
+ tableOwnerGroup: {
21
21
  [tableid: string]: ElementDeclarationNode;
22
22
  };
23
23
  tableGroups: Map<ElementDeclarationNode, TableGroup>;
@@ -22,7 +22,6 @@ export declare enum SyntaxTokenKind {
22
22
  IDENTIFIER = "<identifier>",
23
23
  SEMICOLON = "<semicolon>",
24
24
  COLON = "<colon>",
25
- TILDE = "<tilde>",
26
25
  SINGLE_LINE_COMMENT = "<single-line-comment>",
27
26
  MULTILINE_COMMENT = "<multiline-comment>"
28
27
  }