@dbml/parse 5.4.0 → 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 (118) hide show
  1. package/LICENSE +0 -0
  2. package/dist/{tests → __tests__/examples}/binder/binder.test.d.ts +0 -0
  3. package/dist/{tests → __tests__/examples}/compiler/applyTextEdits.test.d.ts +0 -0
  4. package/dist/{tests → __tests__/examples}/compiler/renameTable.test.d.ts +0 -0
  5. package/dist/{tests → __tests__/examples}/interpreter/interpreter.test.d.ts +0 -0
  6. package/dist/{tests → __tests__/examples}/lexer/lexer.test.d.ts +0 -0
  7. package/dist/{tests → __tests__/examples}/parser/parser.test.d.ts +0 -0
  8. package/dist/{tests/NaN_errors/interpreter_NaN.test.d.ts → __tests__/examples/services/definition.test.d.ts} +0 -0
  9. package/dist/{tests/validator/validator.test.d.ts → __tests__/examples/services/references.test.d.ts} +0 -0
  10. package/dist/__tests__/examples/services/service_utils.test.d.ts +1 -0
  11. package/dist/__tests__/examples/services/suggestions.test.d.ts +1 -0
  12. package/dist/__tests__/examples/validator/validator.test.d.ts +1 -0
  13. package/dist/__tests__/fuzz/interpreter.test.d.ts +1 -0
  14. package/dist/__tests__/fuzz/parser.test.d.ts +1 -0
  15. package/dist/__tests__/fuzz/services.test.d.ts +1 -0
  16. package/dist/__tests__/properties/lexer.test.d.ts +1 -0
  17. package/dist/__tests__/properties/parser.test.d.ts +1 -0
  18. package/dist/__tests__/snapshots/binder/binder.test.d.ts +1 -0
  19. package/dist/__tests__/snapshots/interpreter/interpreter.test.d.ts +1 -0
  20. package/dist/__tests__/snapshots/lexer/lexer.test.d.ts +1 -0
  21. package/dist/__tests__/snapshots/nan/nan.test.d.ts +1 -0
  22. package/dist/__tests__/snapshots/parser/parser.test.d.ts +1 -0
  23. package/dist/__tests__/snapshots/validator/validator.test.d.ts +1 -0
  24. package/dist/__tests__/utils/arbitraries/grammars.d.ts +100 -0
  25. package/dist/__tests__/utils/arbitraries/index.d.ts +3 -0
  26. package/dist/__tests__/utils/arbitraries/tokens.d.ts +20 -0
  27. package/dist/__tests__/utils/arbitraries/utils.d.ts +59 -0
  28. package/dist/__tests__/utils/compiler.d.ts +13 -0
  29. package/dist/__tests__/utils/index.d.ts +3 -0
  30. package/dist/__tests__/utils/mocks.d.ts +16 -0
  31. package/dist/__tests__/utils/testHelpers.d.ts +16 -0
  32. package/dist/dbml-parse.js +29 -10
  33. package/dist/dbml-parse.mjs +8505 -4841
  34. package/dist/index.d.ts +2 -0
  35. package/dist/src/compiler/index.d.ts +0 -0
  36. package/dist/src/compiler/queries/container/element.d.ts +0 -0
  37. package/dist/src/compiler/queries/container/index.d.ts +0 -0
  38. package/dist/src/compiler/queries/container/scope.d.ts +0 -0
  39. package/dist/src/compiler/queries/container/scopeKind.d.ts +0 -0
  40. package/dist/src/compiler/queries/container/stack.d.ts +0 -0
  41. package/dist/src/compiler/queries/container/token.d.ts +0 -0
  42. package/dist/src/compiler/queries/parse.d.ts +0 -0
  43. package/dist/src/compiler/queries/symbol.d.ts +0 -0
  44. package/dist/src/compiler/queries/token.d.ts +0 -0
  45. package/dist/src/compiler/queries/transform/applyTextEdits.d.ts +0 -0
  46. package/dist/src/compiler/queries/transform/index.d.ts +0 -0
  47. package/dist/src/compiler/queries/transform/renameTable.d.ts +0 -0
  48. package/dist/src/compiler/types.d.ts +0 -0
  49. package/dist/src/constants.d.ts +0 -0
  50. package/dist/src/core/analyzer/analyzer.d.ts +0 -0
  51. package/dist/src/core/analyzer/binder/binder.d.ts +4 -3
  52. package/dist/src/core/analyzer/binder/elementBinder/checks.d.ts +12 -11
  53. package/dist/src/core/analyzer/binder/elementBinder/custom.d.ts +15 -9
  54. package/dist/src/core/analyzer/binder/elementBinder/enum.d.ts +15 -11
  55. package/dist/src/core/analyzer/binder/elementBinder/indexes.d.ts +16 -16
  56. package/dist/src/core/analyzer/binder/elementBinder/note.d.ts +15 -11
  57. package/dist/src/core/analyzer/binder/elementBinder/project.d.ts +15 -9
  58. package/dist/src/core/analyzer/binder/elementBinder/ref.d.ts +16 -16
  59. package/dist/src/core/analyzer/binder/elementBinder/table.d.ts +20 -48
  60. package/dist/src/core/analyzer/binder/elementBinder/tableGroup.d.ts +16 -16
  61. package/dist/src/core/analyzer/binder/elementBinder/tablePartial.d.ts +18 -36
  62. package/dist/src/core/analyzer/binder/types.d.ts +3 -16
  63. package/dist/src/core/analyzer/binder/utils.d.ts +18 -2
  64. package/dist/src/core/analyzer/symbol/factory.d.ts +0 -0
  65. package/dist/src/core/analyzer/symbol/symbolIndex.d.ts +2 -4
  66. package/dist/src/core/analyzer/symbol/symbolTable.d.ts +0 -0
  67. package/dist/src/core/analyzer/symbol/symbols.d.ts +9 -8
  68. package/dist/src/core/analyzer/symbol/utils.d.ts +3 -3
  69. package/dist/src/core/analyzer/types.d.ts +0 -0
  70. package/dist/src/core/analyzer/utils.d.ts +8 -5
  71. package/dist/src/core/analyzer/validator/elementValidators/checks.d.ts +0 -0
  72. package/dist/src/core/analyzer/validator/elementValidators/custom.d.ts +0 -0
  73. package/dist/src/core/analyzer/validator/elementValidators/enum.d.ts +0 -0
  74. package/dist/src/core/analyzer/validator/elementValidators/indexes.d.ts +0 -0
  75. package/dist/src/core/analyzer/validator/elementValidators/note.d.ts +0 -0
  76. package/dist/src/core/analyzer/validator/elementValidators/project.d.ts +0 -0
  77. package/dist/src/core/analyzer/validator/elementValidators/ref.d.ts +0 -0
  78. package/dist/src/core/analyzer/validator/elementValidators/table.d.ts +1 -3
  79. package/dist/src/core/analyzer/validator/elementValidators/tableGroup.d.ts +0 -0
  80. package/dist/src/core/analyzer/validator/elementValidators/tablePartial.d.ts +0 -0
  81. package/dist/src/core/analyzer/validator/types.d.ts +0 -0
  82. package/dist/src/core/analyzer/validator/utils.d.ts +18 -3
  83. package/dist/src/core/analyzer/validator/validator.d.ts +0 -0
  84. package/dist/src/core/errors.d.ts +0 -0
  85. package/dist/src/core/interpreter/elementInterpreter/enum.d.ts +0 -0
  86. package/dist/src/core/interpreter/elementInterpreter/project.d.ts +0 -0
  87. package/dist/src/core/interpreter/elementInterpreter/ref.d.ts +0 -0
  88. package/dist/src/core/interpreter/elementInterpreter/sticky_note.d.ts +0 -0
  89. package/dist/src/core/interpreter/elementInterpreter/table.d.ts +0 -0
  90. package/dist/src/core/interpreter/elementInterpreter/tableGroup.d.ts +0 -0
  91. package/dist/src/core/interpreter/elementInterpreter/tablePartial.d.ts +0 -0
  92. package/dist/src/core/interpreter/interpreter.d.ts +0 -0
  93. package/dist/src/core/interpreter/types.d.ts +1 -1
  94. package/dist/src/core/interpreter/utils.d.ts +0 -0
  95. package/dist/src/core/lexer/lexer.d.ts +0 -0
  96. package/dist/src/core/lexer/tokens.d.ts +0 -1
  97. package/dist/src/core/lexer/utils.d.ts +0 -0
  98. package/dist/src/core/option.d.ts +0 -0
  99. package/dist/src/core/parser/contextStack.d.ts +0 -0
  100. package/dist/src/core/parser/factory.d.ts +0 -0
  101. package/dist/src/core/parser/nodes.d.ts +3 -11
  102. package/dist/src/core/parser/parser.d.ts +0 -1
  103. package/dist/src/core/parser/utils.d.ts +1 -0
  104. package/dist/src/core/report.d.ts +0 -0
  105. package/dist/src/core/serialization/serialize.d.ts +0 -0
  106. package/dist/src/core/types.d.ts +0 -0
  107. package/dist/src/core/utils.d.ts +0 -0
  108. package/dist/src/index.d.ts +0 -0
  109. package/dist/src/services/definition/provider.d.ts +0 -0
  110. package/dist/src/services/index.d.ts +0 -0
  111. package/dist/src/services/references/provider.d.ts +0 -0
  112. package/dist/src/services/suggestions/provider.d.ts +0 -0
  113. package/dist/src/services/suggestions/utils.d.ts +0 -0
  114. package/dist/src/services/types.d.ts +1 -1
  115. package/dist/src/services/utils.d.ts +0 -0
  116. package/package.json +5 -5
  117. package/dist/src/core/analyzer/binder/elementBinder/elementBinder.d.ts +0 -25
  118. package/dist/tests/jestHelpers.d.ts +0 -1
package/LICENSE CHANGED
File without changes
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,100 @@
1
+ import { default as fc } from 'fast-check';
2
+ export declare const whitespaceArbitrary: fc.Arbitrary<" " | "\n" | "\t" | " " | "\n\n" | " \t " | "\r\n">;
3
+ export declare const schemaQualifiedNameArbitrary: fc.Arbitrary<string>;
4
+ export declare const anyElementNameArbitrary: fc.Arbitrary<string>;
5
+ export declare const simpleRefEndpointArbitrary: fc.Arbitrary<string>;
6
+ export declare const schemaQualifiedRefEndpointArbitrary: fc.Arbitrary<string>;
7
+ export declare const anyRefEndpointArbitrary: fc.Arbitrary<string>;
8
+ export declare const basicTypeArbitrary: fc.Arbitrary<string>;
9
+ export declare const typeWithArgsArbitrary: fc.Arbitrary<string>;
10
+ export declare const typeWithEmptyArgsArbitrary: fc.Arbitrary<string>;
11
+ export declare const arrayTypeArbitrary: fc.Arbitrary<string>;
12
+ export declare const sizedArrayTypeArbitrary: fc.Arbitrary<string>;
13
+ export declare const schemaQualifiedTypeArbitrary: fc.Arbitrary<string>;
14
+ export declare const columnTypeArbitrary: fc.Arbitrary<string>;
15
+ export declare const noteSettingArbitrary: fc.Arbitrary<string>;
16
+ export declare const enumMemberArbitrary: fc.Arbitrary<string>;
17
+ export declare const defaultValueArbitrary: fc.Arbitrary<string>;
18
+ export declare const checkExpressionArbitrary: fc.Arbitrary<string>;
19
+ export declare const inlineCheckArbitrary: fc.Arbitrary<string>;
20
+ export declare const relationshipTypeArbitrary: fc.Arbitrary<"-" | "<" | ">" | "<>">;
21
+ export declare const inlineRefSettingArbitrary: fc.Arbitrary<string>;
22
+ export declare const columnSettingArbitrary: fc.Arbitrary<string>;
23
+ export declare const columnSettingsListArbitrary: fc.Arbitrary<string>;
24
+ export declare const emptySettingsListArbitrary: fc.Arbitrary<"[]">;
25
+ export declare const tableSettingArbitrary: fc.Arbitrary<string>;
26
+ export declare const tableSettingsListArbitrary: fc.Arbitrary<string>;
27
+ export declare const indexSettingArbitrary: fc.Arbitrary<string>;
28
+ export declare const indexSettingsListArbitrary: fc.Arbitrary<string>;
29
+ export declare const refSettingArbitrary: fc.Arbitrary<string>;
30
+ export declare const refSettingsListArbitrary: fc.Arbitrary<string>;
31
+ export declare const simpleColumnArbitrary: fc.Arbitrary<string>;
32
+ export declare const columnWithSettingsArbitrary: fc.Arbitrary<string>;
33
+ export declare const columnArbitrary: fc.Arbitrary<string>;
34
+ export declare const columnListArbitrary: fc.Arbitrary<string>;
35
+ export declare const singleColumnIndexArbitrary: fc.Arbitrary<string>;
36
+ export declare const expressionIndexArbitrary: fc.Arbitrary<string>;
37
+ export declare const compositeIndexArbitrary: fc.Arbitrary<string>;
38
+ export declare const mixedCompositeIndexArbitrary: fc.Arbitrary<string>;
39
+ export declare const indexArbitrary: fc.Arbitrary<string>;
40
+ export declare const indexesBlockArbitrary: fc.Arbitrary<string>;
41
+ export declare const checkSettingArbitrary: fc.Arbitrary<string>;
42
+ export declare const checkConstraintArbitrary: fc.Arbitrary<string>;
43
+ export declare const checksBlockArbitrary: fc.Arbitrary<string>;
44
+ export declare const inlineNoteArbitrary: fc.Arbitrary<string>;
45
+ export declare const blockNoteArbitrary: fc.Arbitrary<string>;
46
+ export declare const simpleEnumValueArbitrary: fc.Arbitrary<string>;
47
+ export declare const enumValueWithNoteArbitrary: fc.Arbitrary<string>;
48
+ export declare const enumValueArbitrary: fc.Arbitrary<string>;
49
+ export declare const enumArbitrary: fc.Arbitrary<string>;
50
+ export declare const inlineRefArbitrary: fc.Arbitrary<string>;
51
+ export declare const standaloneRefArbitrary: fc.Arbitrary<string>;
52
+ export declare const namedRefArbitrary: fc.Arbitrary<string>;
53
+ export declare const multiColumnRefArbitrary: fc.Arbitrary<string>;
54
+ export declare const anyRefArbitrary: fc.Arbitrary<string>;
55
+ export declare const tableAliasArbitrary: fc.Arbitrary<string>;
56
+ export declare const simpleTableArbitrary: fc.Arbitrary<string>;
57
+ export declare const tableWithAliasArbitrary: fc.Arbitrary<string>;
58
+ export declare const tableWithSettingsArbitrary: fc.Arbitrary<string>;
59
+ export declare const tableWithIndexesArbitrary: fc.Arbitrary<string>;
60
+ export declare const tableWithNoteArbitrary: fc.Arbitrary<string>;
61
+ export declare const complexTableArbitrary: fc.Arbitrary<string>;
62
+ export declare const tableArbitrary: fc.Arbitrary<string>;
63
+ export declare const tableGroupSettingArbitrary: fc.Arbitrary<string>;
64
+ export declare const tableGroupSettingsListArbitrary: fc.Arbitrary<string>;
65
+ export declare const tableGroupArbitrary: fc.Arbitrary<string>;
66
+ export declare const tablePartialArbitrary: fc.Arbitrary<string>;
67
+ export declare const partialInjectionArbitrary: fc.Arbitrary<string>;
68
+ export declare const standaloneNoteArbitrary: fc.Arbitrary<string>;
69
+ export declare const projectSettingArbitrary: fc.Arbitrary<string>;
70
+ export declare const projectArbitrary: fc.Arbitrary<string>;
71
+ export declare const schemaElementArbitrary: fc.Arbitrary<string>;
72
+ export declare const smallSchemaArbitrary: fc.Arbitrary<string>;
73
+ export declare const mediumSchemaArbitrary: fc.Arbitrary<string>;
74
+ export declare const largeSchemaArbitrary: fc.Arbitrary<string>;
75
+ export declare const dbmlSchemaArbitrary: fc.Arbitrary<string>;
76
+ export declare const unclosedBracketArbitrary: fc.Arbitrary<string>;
77
+ export declare const mismatchedBracketsArbitrary: fc.Arbitrary<string>;
78
+ export declare const unclosedStringArbitrary: fc.Arbitrary<string>;
79
+ export declare const truncatedInputArbitrary: fc.Arbitrary<string>;
80
+ export declare const invalidEscapeArbitrary: fc.Arbitrary<string>;
81
+ export declare const binaryGarbageArbitrary: fc.Arbitrary<string>;
82
+ export declare const extremeNestingArbitrary: fc.Arbitrary<string>;
83
+ export declare const malformedTableArbitrary: fc.Arbitrary<string>;
84
+ export declare const malformedEnumArbitrary: fc.Arbitrary<string>;
85
+ export declare const malformedRefArbitrary: fc.Arbitrary<string>;
86
+ export declare const conflictingSettingsArbitrary: fc.Arbitrary<string>;
87
+ export declare const emptyTableArbitrary: fc.Arbitrary<string>;
88
+ export declare const columnNoSettingsArbitrary: fc.Arbitrary<string>;
89
+ export declare const tableWithZeroSettingsArbitrary: fc.Arbitrary<string>;
90
+ export declare const allSettingsColumnArbitrary: fc.Arbitrary<string>;
91
+ export declare const selfReferentialTableArbitrary: fc.Arbitrary<string>;
92
+ export declare const circularRefArbitrary: fc.Arbitrary<string>;
93
+ export declare const danglingRefArbitrary: fc.Arbitrary<string>;
94
+ export declare const mismatchedCompositeRefArbitrary: fc.Arbitrary<string>;
95
+ export declare const malformedInputArbitrary: fc.Arbitrary<string>;
96
+ export declare const charSubstitutionArbitrary: (source: string) => fc.Arbitrary<string>;
97
+ export declare const multiCharInsertionArbitrary: (source: string) => fc.Arbitrary<string>;
98
+ export declare const blockDuplicationArbitrary: (source: string) => fc.Arbitrary<string>;
99
+ export declare const toCRLF: (source: string) => string;
100
+ export declare const crlfSchemaArbitrary: fc.Arbitrary<string>;
@@ -0,0 +1,3 @@
1
+ export * from './utils';
2
+ export * from './tokens';
3
+ export * from './grammars';
@@ -0,0 +1,20 @@
1
+ import { default as fc } from 'fast-check';
2
+ export declare const identifierArbitrary: fc.Arbitrary<string>;
3
+ export declare const quotedIdentifierArbitrary: fc.Arbitrary<string>;
4
+ export declare const anyIdentifierArbitrary: fc.Arbitrary<string>;
5
+ export declare const singleLineStringArbitrary: fc.Arbitrary<string>;
6
+ export declare const multiLineStringArbitrary: fc.Arbitrary<string>;
7
+ export declare const anyStringArbitrary: fc.Arbitrary<string>;
8
+ export declare const numberArbitrary: fc.Arbitrary<string>;
9
+ export declare const prefixedNumberArbitrary: fc.Arbitrary<string>;
10
+ export declare const functionExpressionArbitrary: fc.Arbitrary<string>;
11
+ export declare const colorArbitrary: fc.Arbitrary<string>;
12
+ export declare const opArbitrary: fc.Arbitrary<string>;
13
+ export declare const seppuncArbitrary: fc.Arbitrary<string>;
14
+ export declare const wsArbitrary: fc.Arbitrary<string>;
15
+ export declare const singleLineCommentArbitrary: fc.Arbitrary<string>;
16
+ export declare const multiLineCommentArbitrary: fc.Arbitrary<string>;
17
+ export declare const commentArbitrary: fc.Arbitrary<string>;
18
+ export declare const identifierStreamArbitrary: fc.Arbitrary<string>;
19
+ export declare const tokenStreamArbitrary: fc.Arbitrary<string>;
20
+ export declare const spacedTokenStreamArbitrary: fc.Arbitrary<string>;
@@ -0,0 +1,59 @@
1
+ import { default as fc } from 'fast-check';
2
+ export declare function orRegex(...subregexes: RegExp[]): RegExp;
3
+ export declare function chainRegex(...subregexes: RegExp[]): RegExp;
4
+ export declare function matchFullRegex(regex: RegExp): RegExp;
5
+ export declare function oneOrManyRegex(regex: RegExp): RegExp;
6
+ export declare function zeroOrManyRegex(regex: RegExp): RegExp;
7
+ /**
8
+ * Helper to generate case variations of a string (lowercase, uppercase, original)
9
+ * Examples:
10
+ * caseVariant('table') => 'Table' | 'tAble' | 'taBle'
11
+ */
12
+ export declare const caseVariant: (str: string) => fc.Arbitrary<string>;
13
+ /**
14
+ * Helper to generate case variations of one of multiple strings
15
+ * Picks one string from the arguments and varies its case
16
+ * Examples:
17
+ * caseVariantOneOf('primary key', 'pk') => 'primary key' | 'PRIMARY KEY' | 'pk' | 'PK' | etc.
18
+ */
19
+ export declare const caseVariantOneOf: (...strings: string[]) => fc.Arbitrary<string>;
20
+ /**
21
+ * Helper to generate case variations with key:value format for settings
22
+ */
23
+ export declare const settingKeyValue: (key: string, valueArb: fc.Arbitrary<string>) => fc.Arbitrary<string>;
24
+ /**
25
+ * Helper to generate random whitespace (spaces, tabs, newlines)
26
+ * CRLF tested separately via crlfSchemaArbitrary
27
+ */
28
+ export declare const randomSpaceArbitrary: fc.Arbitrary<string>;
29
+ /**
30
+ * Helper to generate random inline whitespace (spaces and tabs only, NO newlines)
31
+ * Returns 1-3 whitespace characters
32
+ * Use this for single-line constructs (columns, enum values, checks, indexes)
33
+ */
34
+ export declare const randomInlineSpaceArbitrary: fc.Arbitrary<string>;
35
+ /**
36
+ * Helper to join string/arbitrary tokens with random spacing between them
37
+ * Automatically injects random whitespace between all tokens (including newlines)
38
+ * Use this for top-level declarations (Table, Enum, Ref, etc.)
39
+ *
40
+ * @param tokens - Array of strings or arbitraries to join
41
+ * @returns An arbitrary that produces the joined string with random spacing
42
+ *
43
+ * @example
44
+ * joinWithRandomSpaces(caseVariant('Table'), 'users', '{')
45
+ * // Produces: "Table users {" or "TABLE\n\tusers\t{" etc.
46
+ */
47
+ export declare const joinWithRandomSpaces: (...tokens: (fc.Arbitrary<string> | string)[]) => fc.Arbitrary<string>;
48
+ /**
49
+ * Helper to join string/arbitrary tokens with random inline spacing (NO newlines)
50
+ * Use this for single-line constructs (columns, enum values, checks, indexes)
51
+ *
52
+ * @param tokens - Array of strings or arbitraries to join
53
+ * @returns An arbitrary that produces the joined string with random inline spacing
54
+ *
55
+ * @example
56
+ * joinWithRandomInlineSpaces('id', 'int', '[pk]')
57
+ * // Produces: "id int [pk]" or "id\tint\t\t[pk]" etc. (no newlines)
58
+ */
59
+ export declare const joinWithRandomInlineSpaces: (...tokens: (fc.Arbitrary<string> | string)[]) => fc.Arbitrary<string>;
@@ -0,0 +1,13 @@
1
+ import { ProgramNode, SyntaxNode } from '../../src/core/parser/nodes';
2
+ import { default as Report } from '../../src/core/report';
3
+ import { CompileError, SyntaxToken } from '../../src/index';
4
+ import { Database } from '../../src/core/interpreter/types';
5
+ export declare function lex(source: string): Report<SyntaxToken[], CompileError>;
6
+ export declare function parse(source: string): Report<{
7
+ ast: ProgramNode;
8
+ tokens: SyntaxToken[];
9
+ }, CompileError>;
10
+ export declare function analyze(source: string): Report<ProgramNode, CompileError>;
11
+ export declare function interpret(source: string): Report<Database | undefined, CompileError>;
12
+ export declare function flattenTokens(token: SyntaxToken): SyntaxToken[];
13
+ export declare function print(source: string, ast: SyntaxNode): string;
@@ -0,0 +1,3 @@
1
+ export { createPosition, MockTextModel, createMockTextModel, extractTextFromRange, } from './mocks';
2
+ export { scanTestNames, serialize, } from './testHelpers';
3
+ export { lex, parse, analyze, interpret, flattenTokens, print, } from './compiler';
@@ -0,0 +1,16 @@
1
+ import { Position, TextModel } from '../../src/services';
2
+ export declare function createPosition(lineNumber: number, column: number): Position;
3
+ export declare class MockTextModel {
4
+ private content;
5
+ uri: any;
6
+ constructor(content: string, uri?: string);
7
+ getOffsetAt(position: Position): number;
8
+ getValue(): string;
9
+ }
10
+ export declare function createMockTextModel(content: string, uri?: string): TextModel;
11
+ export declare function extractTextFromRange(program: string, range: {
12
+ startLineNumber: number;
13
+ startColumn: number;
14
+ endLineNumber: number;
15
+ endColumn: number;
16
+ }): string;
@@ -0,0 +1,16 @@
1
+ import { default as Report } from '../../src/core/report';
2
+ import { CompileError, ProgramNode } from '../../src/index';
3
+ export declare function scanTestNames(_path: any): string[];
4
+ /**
5
+ * Serializes a compiler report to JSON, handling circular references and
6
+ * reducing verbosity by outputting IDs instead of full objects where appropriate.
7
+ *
8
+ * The serializer handles special keys:
9
+ * - 'symbol': For non-root nodes, outputs only the symbol ID. For root nodes,
10
+ * outputs the full symbol table with references as IDs.
11
+ * - 'referee': Outputs only the referenced symbol's ID
12
+ * - 'parent': Outputs only the parent node's ID
13
+ * - 'declaration': Outputs only the declaration node's ID
14
+ * - 'symbolTable': Converts Map to Object for JSON compatibility
15
+ */
16
+ export declare function serialize(report: Readonly<Report<ProgramNode, CompileError>>, pretty?: boolean): string;