@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/dbml-parse.mjs
CHANGED
|
@@ -985,7 +985,7 @@ function unzip(r) {
|
|
|
985
985
|
}
|
|
986
986
|
var zip_default = _baseRest_default(unzip);
|
|
987
987
|
let SyntaxTokenKind = /* @__PURE__ */ function(r) {
|
|
988
|
-
return r.SPACE = "<space>", r.TAB = "<tab>", r.NEWLINE = "<newline>", r.COMMA = "<comma>", r.LPAREN = "<lparen>", r.RPAREN = "<rparen>", r.LBRACE = "<lbrace>", r.RBRACE = "<rbrace>", r.LBRACKET = "<lbracket>", r.RBRACKET = "<rbracket>", r.LANGLE = "<langle>", r.RANGLE = "<rangle>", r.OP = "<op>", r.EOF = "<eof>", r.NUMERIC_LITERAL = "<number>", r.STRING_LITERAL = "<string>", r.COLOR_LITERAL = "<color>", r.FUNCTION_EXPRESSION = "<function-expression>", r.QUOTED_STRING = "<variable>", r.IDENTIFIER = "<identifier>", r.SEMICOLON = "<semicolon>", r.COLON = "<colon>", r.SINGLE_LINE_COMMENT = "<single-line-comment>", r.MULTILINE_COMMENT = "<multiline-comment>", r;
|
|
988
|
+
return r.SPACE = "<space>", r.TAB = "<tab>", r.NEWLINE = "<newline>", r.COMMA = "<comma>", r.LPAREN = "<lparen>", r.RPAREN = "<rparen>", r.LBRACE = "<lbrace>", r.RBRACE = "<rbrace>", r.LBRACKET = "<lbracket>", r.RBRACKET = "<rbracket>", r.LANGLE = "<langle>", r.RANGLE = "<rangle>", r.OP = "<op>", r.EOF = "<eof>", r.NUMERIC_LITERAL = "<number>", r.STRING_LITERAL = "<string>", r.COLOR_LITERAL = "<color>", r.FUNCTION_EXPRESSION = "<function-expression>", r.QUOTED_STRING = "<variable>", r.IDENTIFIER = "<identifier>", r.SEMICOLON = "<semicolon>", r.COLON = "<colon>", r.SINGLE_LINE_COMMENT = "<single-line-comment>", r.MULTILINE_COMMENT = "<multiline-comment>", r.WILDCARD = "<wildcard>", r;
|
|
989
989
|
}({});
|
|
990
990
|
function isTriviaToken(r) {
|
|
991
991
|
switch (r.kind) {
|
|
@@ -1002,7 +1002,6 @@ function isOp(r) {
|
|
|
1002
1002
|
switch (r) {
|
|
1003
1003
|
case "+":
|
|
1004
1004
|
case "-":
|
|
1005
|
-
case "*":
|
|
1006
1005
|
case "/":
|
|
1007
1006
|
case "%":
|
|
1008
1007
|
case "<":
|
|
@@ -1073,7 +1072,7 @@ var SyntaxNodeIdGenerator = class {
|
|
|
1073
1072
|
}
|
|
1074
1073
|
};
|
|
1075
1074
|
let SyntaxNodeKind = /* @__PURE__ */ function(r) {
|
|
1076
|
-
return r.PROGRAM = "<program>", r.ELEMENT_DECLARATION = "<element-declaration>", r.ATTRIBUTE = "<attribute>", r.IDENTIFIER_STREAM = "<identifer-stream>", r.LITERAL = "<literal>", r.VARIABLE = "<variable>", r.PREFIX_EXPRESSION = "<prefix-expression>", r.INFIX_EXPRESSION = "<infix-expression>", r.POSTFIX_EXPRESSION = "<postfix-expression>", r.FUNCTION_EXPRESSION = "<function-expression>", r.FUNCTION_APPLICATION = "<function-application>", r.BLOCK_EXPRESSION = "<block-expression>", r.LIST_EXPRESSION = "<list-expression>", r.TUPLE_EXPRESSION = "<tuple-expression>", r.CALL_EXPRESSION = "<call-expression>", r.PRIMARY_EXPRESSION = "<primary-expression>", r.GROUP_EXPRESSION = "<group-expression>", r.COMMA_EXPRESSION = "<comma-expression>", r.EMPTY = "<dummy>", r.ARRAY = "<array>", r;
|
|
1075
|
+
return r.PROGRAM = "<program>", r.ELEMENT_DECLARATION = "<element-declaration>", r.ATTRIBUTE = "<attribute>", r.IDENTIFIER_STREAM = "<identifer-stream>", r.LITERAL = "<literal>", r.VARIABLE = "<variable>", r.PREFIX_EXPRESSION = "<prefix-expression>", r.INFIX_EXPRESSION = "<infix-expression>", r.POSTFIX_EXPRESSION = "<postfix-expression>", r.FUNCTION_EXPRESSION = "<function-expression>", r.FUNCTION_APPLICATION = "<function-application>", r.BLOCK_EXPRESSION = "<block-expression>", r.LIST_EXPRESSION = "<list-expression>", r.TUPLE_EXPRESSION = "<tuple-expression>", r.CALL_EXPRESSION = "<call-expression>", r.PRIMARY_EXPRESSION = "<primary-expression>", r.GROUP_EXPRESSION = "<group-expression>", r.COMMA_EXPRESSION = "<comma-expression>", r.WILDCARD = "<wildcard>", r.EMPTY = "<dummy>", r.ARRAY = "<array>", r;
|
|
1077
1076
|
}({});
|
|
1078
1077
|
var ProgramNode = class extends SyntaxNode {
|
|
1079
1078
|
constructor({ body: r = [], eof: j, source: M }, N) {
|
|
@@ -1173,6 +1172,10 @@ var ProgramNode = class extends SyntaxNode {
|
|
|
1173
1172
|
constructor({ literal: r }, j) {
|
|
1174
1173
|
super(j, SyntaxNodeKind.LITERAL, [r]), this.literal = r;
|
|
1175
1174
|
}
|
|
1175
|
+
}, WildcardNode = class extends SyntaxNode {
|
|
1176
|
+
constructor({ token: r }, j) {
|
|
1177
|
+
super(j, SyntaxNodeKind.WILDCARD, [r]), this.token = r;
|
|
1178
|
+
}
|
|
1176
1179
|
}, VariableNode = class extends SyntaxNode {
|
|
1177
1180
|
constructor({ variable: r }, j) {
|
|
1178
1181
|
super(j, SyntaxNodeKind.VARIABLE, [r]), this.variable = r;
|
|
@@ -1235,6 +1238,18 @@ var NodeSymbolIdGenerator = class {
|
|
|
1235
1238
|
constructor({ declaration: r }, j) {
|
|
1236
1239
|
this.references = [], this.id = j, this.declaration = r;
|
|
1237
1240
|
}
|
|
1241
|
+
}, DiagramViewSymbol = class {
|
|
1242
|
+
constructor({ symbolTable: r, declaration: j }, M) {
|
|
1243
|
+
this.references = [], this.id = M, this.symbolTable = r, this.declaration = j;
|
|
1244
|
+
}
|
|
1245
|
+
}, DiagramViewFieldSymbol = class {
|
|
1246
|
+
constructor({ declaration: r }, j) {
|
|
1247
|
+
this.references = [], this.id = j, this.declaration = r;
|
|
1248
|
+
}
|
|
1249
|
+
}, StickyNoteSymbol = class {
|
|
1250
|
+
constructor({ declaration: r }, j) {
|
|
1251
|
+
this.references = [], this.id = j, this.declaration = r;
|
|
1252
|
+
}
|
|
1238
1253
|
}, TablePartialSymbol = class {
|
|
1239
1254
|
constructor({ symbolTable: r, declaration: j }, M) {
|
|
1240
1255
|
this.references = [], this.id = M, this.symbolTable = r, this.declaration = j;
|
|
@@ -1249,7 +1264,7 @@ var NodeSymbolIdGenerator = class {
|
|
|
1249
1264
|
}
|
|
1250
1265
|
};
|
|
1251
1266
|
let CompileErrorCode = /* @__PURE__ */ function(r) {
|
|
1252
|
-
return r[r.UNKNOWN_SYMBOL = 1e3] = "UNKNOWN_SYMBOL", r[r.UNEXPECTED_SYMBOL = 1001] = "UNEXPECTED_SYMBOL", r[r.UNEXPECTED_EOF = 1002] = "UNEXPECTED_EOF", r[r.UNEXPECTED_NEWLINE = 1003] = "UNEXPECTED_NEWLINE", r[r.UNKNOWN_TOKEN = 1004] = "UNKNOWN_TOKEN", r[r.UNEXPECTED_TOKEN = 1005] = "UNEXPECTED_TOKEN", r[r.UNEXPECTED_ELEMENT_DECLARATION = 1006] = "UNEXPECTED_ELEMENT_DECLARATION", r[r.MISSING_SPACES = 1007] = "MISSING_SPACES", r[r.UNKNOWN_PREFIX_OP = 1008] = "UNKNOWN_PREFIX_OP", r[r.INVALID_OPERAND = 1009] = "INVALID_OPERAND", r[r.EMPTY_ATTRIBUTE_NAME = 1010] = "EMPTY_ATTRIBUTE_NAME", r[r.INVALID_ESCAPE_SEQUENCE = 1011] = "INVALID_ESCAPE_SEQUENCE", r[r.INVALID_NAME = 3e3] = "INVALID_NAME", r[r.UNEXPECTED_NAME = 3001] = "UNEXPECTED_NAME", r[r.NAME_NOT_FOUND = 3002] = "NAME_NOT_FOUND", r[r.DUPLICATE_NAME = 3003] = "DUPLICATE_NAME", r[r.INVALID_ALIAS = 3004] = "INVALID_ALIAS", r[r.UNEXPECTED_ALIAS = 3005] = "UNEXPECTED_ALIAS", r[r.UNEXPECTED_SETTINGS = 3006] = "UNEXPECTED_SETTINGS", r[r.INVALID_SETTINGS = 3007] = "INVALID_SETTINGS", r[r.UNEXPECTED_SIMPLE_BODY = 3008] = "UNEXPECTED_SIMPLE_BODY", r[r.UNEXPECTED_COMPLEX_BODY = 3009] = "UNEXPECTED_COMPLEX_BODY", r[r.INVALID_TABLE_CONTEXT = 3010] = "INVALID_TABLE_CONTEXT", r[r.UNKNOWN_TABLE_SETTING = 3011] = "UNKNOWN_TABLE_SETTING", r[r.DUPLICATE_TABLE_SETTING = 3012] = "DUPLICATE_TABLE_SETTING", r[r.INVALID_TABLEGROUP_CONTEXT = 3013] = "INVALID_TABLEGROUP_CONTEXT", r[r.INVALID_TABLEGROUP_ELEMENT_NAME = 3014] = "INVALID_TABLEGROUP_ELEMENT_NAME", r[r.DUPLICATE_TABLEGROUP_ELEMENT_NAME = 3015] = "DUPLICATE_TABLEGROUP_ELEMENT_NAME", r[r.DUPLICATE_TABLEGROUP_FIELD_NAME = 3016] = "DUPLICATE_TABLEGROUP_FIELD_NAME", r[r.INVALID_TABLEGROUP_FIELD = 3017] = "INVALID_TABLEGROUP_FIELD", r[r.EMPTY_TABLE = 3018] = "EMPTY_TABLE", r[r.INVALID_COLUMN = 3019] = "INVALID_COLUMN", r[r.INVALID_COLUMN_NAME = 3020] = "INVALID_COLUMN_NAME", r[r.UNKNOWN_COLUMN_SETTING = 3021] = "UNKNOWN_COLUMN_SETTING", r[r.INVALID_COLUMN_TYPE = 3022] = "INVALID_COLUMN_TYPE", r[r.DUPLICATE_COLUMN_NAME = 3023] = "DUPLICATE_COLUMN_NAME", r[r.DUPLICATE_COLUMN_SETTING = 3024] = "DUPLICATE_COLUMN_SETTING", r[r.INVALID_COLUMN_SETTING_VALUE = 3025] = "INVALID_COLUMN_SETTING_VALUE", r[r.INVALID_ENUM_CONTEXT = 3026] = "INVALID_ENUM_CONTEXT", r[r.INVALID_ENUM_ELEMENT_NAME = 3027] = "INVALID_ENUM_ELEMENT_NAME", r[r.INVALID_ENUM_ELEMENT = 3028] = "INVALID_ENUM_ELEMENT", r[r.DUPLICATE_ENUM_ELEMENT_NAME = 3029] = "DUPLICATE_ENUM_ELEMENT_NAME", r[r.UNKNOWN_ENUM_ELEMENT_SETTING = 3030] = "UNKNOWN_ENUM_ELEMENT_SETTING", r[r.DUPLICATE_ENUM_ELEMENT_SETTING = 3031] = "DUPLICATE_ENUM_ELEMENT_SETTING", r[r.INVALID_ENUM_ELEMENT_SETTING = 3032] = "INVALID_ENUM_ELEMENT_SETTING", r[r.EMPTY_ENUM = 3033] = "EMPTY_ENUM", r[r.INVALID_REF_CONTEXT = 3034] = "INVALID_REF_CONTEXT", r[r.UNKNOWN_REF_SETTING = 3035] = "UNKNOWN_REF_SETTING", r[r.DUPLICATE_REF_SETTING = 3036] = "DUPLICATE_REF_SETTING", r[r.INVALID_REF_SETTING_VALUE = 3037] = "INVALID_REF_SETTING_VALUE", r[r.INVALID_REF_RELATIONSHIP = 3038] = "INVALID_REF_RELATIONSHIP", r[r.INVALID_REF_FIELD = 3039] = "INVALID_REF_FIELD", r[r.EMPTY_REF = 3040] = "EMPTY_REF", r[r.REF_REDEFINED = 3041] = "REF_REDEFINED", r[r.INVALID_NOTE_CONTEXT = 3042] = "INVALID_NOTE_CONTEXT", r[r.INVALID_NOTE = 3043] = "INVALID_NOTE", r[r.NOTE_REDEFINED = 3044] = "NOTE_REDEFINED", r[r.NOTE_CONTENT_REDEFINED = 3045] = "NOTE_CONTENT_REDEFINED", r[r.EMPTY_NOTE = 3046] = "EMPTY_NOTE", r[r.INVALID_INDEXES_CONTEXT = 3047] = "INVALID_INDEXES_CONTEXT", r[r.INVALID_INDEXES_FIELD = 3048] = "INVALID_INDEXES_FIELD", r[r.INVALID_INDEX = 3049] = "INVALID_INDEX", r[r.UNKNOWN_INDEX_SETTING = 3050] = "UNKNOWN_INDEX_SETTING", r[r.DUPLICATE_INDEX_SETTING = 3051] = "DUPLICATE_INDEX_SETTING", r[r.UNEXPECTED_INDEX_SETTING_VALUE = 3052] = "UNEXPECTED_INDEX_SETTING_VALUE", r[r.INVALID_INDEX_SETTING_VALUE = 3053] = "INVALID_INDEX_SETTING_VALUE", r[r.INVALID_PROJECT_CONTEXT = 3054] = "INVALID_PROJECT_CONTEXT", r[r.PROJECT_REDEFINED = 3055] = "PROJECT_REDEFINED", r[r.INVALID_PROJECT_FIELD = 3056] = "INVALID_PROJECT_FIELD", r[r.INVALID_CUSTOM_CONTEXT = 3057] = "INVALID_CUSTOM_CONTEXT", r[r.INVALID_CUSTOM_ELEMENT_VALUE = 3058] = "INVALID_CUSTOM_ELEMENT_VALUE", r[r.INVALID_ELEMENT_IN_SIMPLE_BODY = 3059] = "INVALID_ELEMENT_IN_SIMPLE_BODY", r[r.INVALID_TABLE_PARTIAL_CONTEXT = 3060] = "INVALID_TABLE_PARTIAL_CONTEXT", r[r.INVALID_TABLE_PARTIAL_ELEMENT_NAME = 3061] = "INVALID_TABLE_PARTIAL_ELEMENT_NAME", r[r.INVALID_TABLE_PARTIAL_SETTING_VALUE = 3062] = "INVALID_TABLE_PARTIAL_SETTING_VALUE", r[r.DUPLICATE_TABLE_PARTIAL_ELEMENT_NAME = 3063] = "DUPLICATE_TABLE_PARTIAL_ELEMENT_NAME", r[r.DUPLICATE_TABLE_PARTIAL_SETTING = 3064] = "DUPLICATE_TABLE_PARTIAL_SETTING", r[r.INVALID_TABLE_PARTIAL_INJECTION = 3065] = "INVALID_TABLE_PARTIAL_INJECTION", r[r.INVALID_TABLE_PARTIAL_INJECTION_OP = 3066] = "INVALID_TABLE_PARTIAL_INJECTION_OP", r[r.INVALID_TABLE_PARTIAL_INJECTION_NAME = 3067] = "INVALID_TABLE_PARTIAL_INJECTION_NAME", r[r.DUPLICATE_TABLE_PARTIAL_INJECTION_NAME = 3068] = "DUPLICATE_TABLE_PARTIAL_INJECTION_NAME", r[r.UNKNOWN_TABLE_PARTIAL_SETTING = 3069] = "UNKNOWN_TABLE_PARTIAL_SETTING", r[r.INVALID_TABLE_SETTING_VALUE = 3070] = "INVALID_TABLE_SETTING_VALUE", r[r.INVALID_CHECKS_CONTEXT = 3071] = "INVALID_CHECKS_CONTEXT", r[r.INVALID_CHECKS_FIELD = 3072] = "INVALID_CHECKS_FIELD", r[r.INVALID_CHECK = 3073] = "INVALID_CHECK", r[r.UNKNOWN_CHECK_SETTING = 3074] = "UNKNOWN_CHECK_SETTING", r[r.DUPLICATE_CHECK_SETTING = 3075] = "DUPLICATE_CHECK_SETTING", r[r.INVALID_CHECK_SETTING_VALUE = 3076] = "INVALID_CHECK_SETTING_VALUE", r[r.INVALID_RECORDS_CONTEXT = 3077] = "INVALID_RECORDS_CONTEXT", r[r.INVALID_RECORDS_NAME = 3078] = "INVALID_RECORDS_NAME", r[r.INVALID_RECORDS_FIELD = 3079] = "INVALID_RECORDS_FIELD", r[r.DUPLICATE_COLUMN_REFERENCES_IN_RECORDS = 3080] = "DUPLICATE_COLUMN_REFERENCES_IN_RECORDS", r[r.DUPLICATE_RECORDS_FOR_TABLE = 3081] = "DUPLICATE_RECORDS_FOR_TABLE", r[r.BINDING_ERROR = 4e3] = "BINDING_ERROR", r[r.UNSUPPORTED = 5e3] = "UNSUPPORTED", r[r.CIRCULAR_REF = 5001] = "CIRCULAR_REF", r[r.SAME_ENDPOINT = 5002] = "SAME_ENDPOINT", r[r.UNEQUAL_FIELDS_BINARY_REF = 5003] = "UNEQUAL_FIELDS_BINARY_REF", r[r.CONFLICTING_SETTING = 5004] = "CONFLICTING_SETTING", r[r.TABLE_REAPPEAR_IN_TABLEGROUP = 5005] = "TABLE_REAPPEAR_IN_TABLEGROUP", r;
|
|
1267
|
+
return r[r.UNKNOWN_SYMBOL = 1e3] = "UNKNOWN_SYMBOL", r[r.UNEXPECTED_SYMBOL = 1001] = "UNEXPECTED_SYMBOL", r[r.UNEXPECTED_EOF = 1002] = "UNEXPECTED_EOF", r[r.UNEXPECTED_NEWLINE = 1003] = "UNEXPECTED_NEWLINE", r[r.UNKNOWN_TOKEN = 1004] = "UNKNOWN_TOKEN", r[r.UNEXPECTED_TOKEN = 1005] = "UNEXPECTED_TOKEN", r[r.UNEXPECTED_ELEMENT_DECLARATION = 1006] = "UNEXPECTED_ELEMENT_DECLARATION", r[r.MISSING_SPACES = 1007] = "MISSING_SPACES", r[r.UNKNOWN_PREFIX_OP = 1008] = "UNKNOWN_PREFIX_OP", r[r.INVALID_OPERAND = 1009] = "INVALID_OPERAND", r[r.EMPTY_ATTRIBUTE_NAME = 1010] = "EMPTY_ATTRIBUTE_NAME", r[r.INVALID_ESCAPE_SEQUENCE = 1011] = "INVALID_ESCAPE_SEQUENCE", r[r.INVALID_NAME = 3e3] = "INVALID_NAME", r[r.UNEXPECTED_NAME = 3001] = "UNEXPECTED_NAME", r[r.NAME_NOT_FOUND = 3002] = "NAME_NOT_FOUND", r[r.DUPLICATE_NAME = 3003] = "DUPLICATE_NAME", r[r.INVALID_ALIAS = 3004] = "INVALID_ALIAS", r[r.UNEXPECTED_ALIAS = 3005] = "UNEXPECTED_ALIAS", r[r.UNEXPECTED_SETTINGS = 3006] = "UNEXPECTED_SETTINGS", r[r.INVALID_SETTINGS = 3007] = "INVALID_SETTINGS", r[r.UNEXPECTED_SIMPLE_BODY = 3008] = "UNEXPECTED_SIMPLE_BODY", r[r.UNEXPECTED_COMPLEX_BODY = 3009] = "UNEXPECTED_COMPLEX_BODY", r[r.INVALID_TABLE_CONTEXT = 3010] = "INVALID_TABLE_CONTEXT", r[r.UNKNOWN_TABLE_SETTING = 3011] = "UNKNOWN_TABLE_SETTING", r[r.DUPLICATE_TABLE_SETTING = 3012] = "DUPLICATE_TABLE_SETTING", r[r.INVALID_TABLEGROUP_CONTEXT = 3013] = "INVALID_TABLEGROUP_CONTEXT", r[r.INVALID_TABLEGROUP_ELEMENT_NAME = 3014] = "INVALID_TABLEGROUP_ELEMENT_NAME", r[r.DUPLICATE_TABLEGROUP_ELEMENT_NAME = 3015] = "DUPLICATE_TABLEGROUP_ELEMENT_NAME", r[r.DUPLICATE_TABLEGROUP_FIELD_NAME = 3016] = "DUPLICATE_TABLEGROUP_FIELD_NAME", r[r.INVALID_TABLEGROUP_FIELD = 3017] = "INVALID_TABLEGROUP_FIELD", r[r.EMPTY_TABLE = 3018] = "EMPTY_TABLE", r[r.INVALID_COLUMN = 3019] = "INVALID_COLUMN", r[r.INVALID_COLUMN_NAME = 3020] = "INVALID_COLUMN_NAME", r[r.UNKNOWN_COLUMN_SETTING = 3021] = "UNKNOWN_COLUMN_SETTING", r[r.INVALID_COLUMN_TYPE = 3022] = "INVALID_COLUMN_TYPE", r[r.DUPLICATE_COLUMN_NAME = 3023] = "DUPLICATE_COLUMN_NAME", r[r.DUPLICATE_COLUMN_SETTING = 3024] = "DUPLICATE_COLUMN_SETTING", r[r.INVALID_COLUMN_SETTING_VALUE = 3025] = "INVALID_COLUMN_SETTING_VALUE", r[r.INVALID_ENUM_CONTEXT = 3026] = "INVALID_ENUM_CONTEXT", r[r.INVALID_ENUM_ELEMENT_NAME = 3027] = "INVALID_ENUM_ELEMENT_NAME", r[r.INVALID_ENUM_ELEMENT = 3028] = "INVALID_ENUM_ELEMENT", r[r.DUPLICATE_ENUM_ELEMENT_NAME = 3029] = "DUPLICATE_ENUM_ELEMENT_NAME", r[r.UNKNOWN_ENUM_ELEMENT_SETTING = 3030] = "UNKNOWN_ENUM_ELEMENT_SETTING", r[r.DUPLICATE_ENUM_ELEMENT_SETTING = 3031] = "DUPLICATE_ENUM_ELEMENT_SETTING", r[r.INVALID_ENUM_ELEMENT_SETTING = 3032] = "INVALID_ENUM_ELEMENT_SETTING", r[r.EMPTY_ENUM = 3033] = "EMPTY_ENUM", r[r.INVALID_REF_CONTEXT = 3034] = "INVALID_REF_CONTEXT", r[r.UNKNOWN_REF_SETTING = 3035] = "UNKNOWN_REF_SETTING", r[r.DUPLICATE_REF_SETTING = 3036] = "DUPLICATE_REF_SETTING", r[r.INVALID_REF_SETTING_VALUE = 3037] = "INVALID_REF_SETTING_VALUE", r[r.INVALID_REF_RELATIONSHIP = 3038] = "INVALID_REF_RELATIONSHIP", r[r.INVALID_REF_FIELD = 3039] = "INVALID_REF_FIELD", r[r.EMPTY_REF = 3040] = "EMPTY_REF", r[r.REF_REDEFINED = 3041] = "REF_REDEFINED", r[r.INVALID_NOTE_CONTEXT = 3042] = "INVALID_NOTE_CONTEXT", r[r.INVALID_NOTE = 3043] = "INVALID_NOTE", r[r.NOTE_REDEFINED = 3044] = "NOTE_REDEFINED", r[r.NOTE_CONTENT_REDEFINED = 3045] = "NOTE_CONTENT_REDEFINED", r[r.EMPTY_NOTE = 3046] = "EMPTY_NOTE", r[r.INVALID_INDEXES_CONTEXT = 3047] = "INVALID_INDEXES_CONTEXT", r[r.INVALID_INDEXES_FIELD = 3048] = "INVALID_INDEXES_FIELD", r[r.INVALID_INDEX = 3049] = "INVALID_INDEX", r[r.UNKNOWN_INDEX_SETTING = 3050] = "UNKNOWN_INDEX_SETTING", r[r.DUPLICATE_INDEX_SETTING = 3051] = "DUPLICATE_INDEX_SETTING", r[r.UNEXPECTED_INDEX_SETTING_VALUE = 3052] = "UNEXPECTED_INDEX_SETTING_VALUE", r[r.INVALID_INDEX_SETTING_VALUE = 3053] = "INVALID_INDEX_SETTING_VALUE", r[r.INVALID_PROJECT_CONTEXT = 3054] = "INVALID_PROJECT_CONTEXT", r[r.PROJECT_REDEFINED = 3055] = "PROJECT_REDEFINED", r[r.INVALID_PROJECT_FIELD = 3056] = "INVALID_PROJECT_FIELD", r[r.INVALID_CUSTOM_CONTEXT = 3057] = "INVALID_CUSTOM_CONTEXT", r[r.INVALID_CUSTOM_ELEMENT_VALUE = 3058] = "INVALID_CUSTOM_ELEMENT_VALUE", r[r.INVALID_ELEMENT_IN_SIMPLE_BODY = 3059] = "INVALID_ELEMENT_IN_SIMPLE_BODY", r[r.INVALID_TABLE_PARTIAL_CONTEXT = 3060] = "INVALID_TABLE_PARTIAL_CONTEXT", r[r.INVALID_TABLE_PARTIAL_ELEMENT_NAME = 3061] = "INVALID_TABLE_PARTIAL_ELEMENT_NAME", r[r.INVALID_TABLE_PARTIAL_SETTING_VALUE = 3062] = "INVALID_TABLE_PARTIAL_SETTING_VALUE", r[r.DUPLICATE_TABLE_PARTIAL_ELEMENT_NAME = 3063] = "DUPLICATE_TABLE_PARTIAL_ELEMENT_NAME", r[r.DUPLICATE_TABLE_PARTIAL_SETTING = 3064] = "DUPLICATE_TABLE_PARTIAL_SETTING", r[r.INVALID_TABLE_PARTIAL_INJECTION = 3065] = "INVALID_TABLE_PARTIAL_INJECTION", r[r.INVALID_TABLE_PARTIAL_INJECTION_OP = 3066] = "INVALID_TABLE_PARTIAL_INJECTION_OP", r[r.INVALID_TABLE_PARTIAL_INJECTION_NAME = 3067] = "INVALID_TABLE_PARTIAL_INJECTION_NAME", r[r.DUPLICATE_TABLE_PARTIAL_INJECTION_NAME = 3068] = "DUPLICATE_TABLE_PARTIAL_INJECTION_NAME", r[r.UNKNOWN_TABLE_PARTIAL_SETTING = 3069] = "UNKNOWN_TABLE_PARTIAL_SETTING", r[r.INVALID_TABLE_SETTING_VALUE = 3070] = "INVALID_TABLE_SETTING_VALUE", r[r.INVALID_CHECKS_CONTEXT = 3071] = "INVALID_CHECKS_CONTEXT", r[r.INVALID_CHECKS_FIELD = 3072] = "INVALID_CHECKS_FIELD", r[r.INVALID_CHECK = 3073] = "INVALID_CHECK", r[r.UNKNOWN_CHECK_SETTING = 3074] = "UNKNOWN_CHECK_SETTING", r[r.DUPLICATE_CHECK_SETTING = 3075] = "DUPLICATE_CHECK_SETTING", r[r.INVALID_CHECK_SETTING_VALUE = 3076] = "INVALID_CHECK_SETTING_VALUE", r[r.INVALID_RECORDS_CONTEXT = 3077] = "INVALID_RECORDS_CONTEXT", r[r.INVALID_RECORDS_NAME = 3078] = "INVALID_RECORDS_NAME", r[r.INVALID_RECORDS_FIELD = 3079] = "INVALID_RECORDS_FIELD", r[r.DUPLICATE_COLUMN_REFERENCES_IN_RECORDS = 3080] = "DUPLICATE_COLUMN_REFERENCES_IN_RECORDS", r[r.DUPLICATE_RECORDS_FOR_TABLE = 3081] = "DUPLICATE_RECORDS_FOR_TABLE", r[r.INVALID_DIAGRAMVIEW_CONTEXT = 3082] = "INVALID_DIAGRAMVIEW_CONTEXT", r[r.DUPLICATE_DIAGRAMVIEW_NAME = 3083] = "DUPLICATE_DIAGRAMVIEW_NAME", r[r.INVALID_DIAGRAMVIEW_FIELD = 3084] = "INVALID_DIAGRAMVIEW_FIELD", r[r.DUPLICATE_DIAGRAMVIEW_FIELD = 3085] = "DUPLICATE_DIAGRAMVIEW_FIELD", r[r.BINDING_ERROR = 4e3] = "BINDING_ERROR", r[r.UNSUPPORTED = 5e3] = "UNSUPPORTED", r[r.CIRCULAR_REF = 5001] = "CIRCULAR_REF", r[r.SAME_ENDPOINT = 5002] = "SAME_ENDPOINT", r[r.UNEQUAL_FIELDS_BINARY_REF = 5003] = "UNEQUAL_FIELDS_BINARY_REF", r[r.CONFLICTING_SETTING = 5004] = "CONFLICTING_SETTING", r[r.TABLE_REAPPEAR_IN_TABLEGROUP = 5005] = "TABLE_REAPPEAR_IN_TABLEGROUP", r;
|
|
1253
1268
|
}({});
|
|
1254
1269
|
var CompileError = class r extends Error {
|
|
1255
1270
|
constructor(j, M, N) {
|
|
@@ -1357,7 +1372,7 @@ const KEYWORDS_OF_DEFAULT_SETTING = [
|
|
|
1357
1372
|
"false"
|
|
1358
1373
|
], NUMERIC_LITERAL_PREFIX = ["-", "+"], DEFAULT_SCHEMA_NAME = "public";
|
|
1359
1374
|
let ElementKind = /* @__PURE__ */ function(r) {
|
|
1360
|
-
return r.Table = "table", r.Enum = "enum", r.Ref = "ref", r.Note = "note", r.Project = "project", r.Indexes = "indexes", r.TableGroup = "tablegroup", r.TablePartial = "tablepartial", r.Check = "checks", r.Records = "records", r;
|
|
1375
|
+
return r.Table = "table", r.Enum = "enum", r.Ref = "ref", r.Note = "note", r.Project = "project", r.Indexes = "indexes", r.TableGroup = "tablegroup", r.TablePartial = "tablepartial", r.Check = "checks", r.Records = "records", r.DiagramView = "diagramview", r;
|
|
1361
1376
|
}({}), SettingName = /* @__PURE__ */ function(r) {
|
|
1362
1377
|
return r.Color = "color", r.HeaderColor = "headercolor", r.Note = "note", r.PK = "pk", r.PrimaryKey = "primary key", r.Unique = "unique", r.Ref = "ref", r.NotNull = "not null", r.Null = "null", r.Increment = "increment", r.Default = "default", r.Name = "name", r.Type = "type", r.Check = "check", r.Update = "update", r.Delete = "delete", r;
|
|
1363
1378
|
}({});
|
|
@@ -1366,19 +1381,22 @@ var CustomValidator = class {
|
|
|
1366
1381
|
this.declarationNode = r, this.publicSymbolTable = j, this.symbolFactory = M;
|
|
1367
1382
|
}
|
|
1368
1383
|
validate() {
|
|
1369
|
-
return
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1384
|
+
return {
|
|
1385
|
+
errors: [
|
|
1386
|
+
...this.validateContext(),
|
|
1387
|
+
...this.validateName(this.declarationNode.name),
|
|
1388
|
+
...this.validateAlias(this.declarationNode.alias),
|
|
1389
|
+
...this.validateSettingList(this.declarationNode.attributeList),
|
|
1390
|
+
...this.validateBody(this.declarationNode.body)
|
|
1391
|
+
],
|
|
1392
|
+
warnings: []
|
|
1393
|
+
};
|
|
1376
1394
|
}
|
|
1377
1395
|
validateContext() {
|
|
1378
1396
|
return this.declarationNode.parent instanceof ProgramNode || getElementKind(this.declarationNode.parent).unwrap_or(void 0) !== ElementKind.Project ? [new CompileError(CompileErrorCode.INVALID_CUSTOM_CONTEXT, "A Custom element can only appear in a Project", this.declarationNode)] : [];
|
|
1379
1397
|
}
|
|
1380
1398
|
validateName(r) {
|
|
1381
|
-
return r ? [new CompileError(CompileErrorCode.UNEXPECTED_NAME, "A Custom element shouldn't have a name", r)] : [];
|
|
1399
|
+
return r instanceof WildcardNode ? [new CompileError(CompileErrorCode.INVALID_NAME, "Wildcard (*) is not allowed as a Custom element name", r)] : r ? [new CompileError(CompileErrorCode.UNEXPECTED_NAME, "A Custom element shouldn't have a name", r)] : [];
|
|
1382
1400
|
}
|
|
1383
1401
|
validateAlias(r) {
|
|
1384
1402
|
return r ? [new CompileError(CompileErrorCode.UNEXPECTED_NAME, "A Custom element shouldn't have an alias", r)] : [];
|
|
@@ -1394,7 +1412,7 @@ var CustomValidator = class {
|
|
|
1394
1412
|
}
|
|
1395
1413
|
};
|
|
1396
1414
|
let SymbolKind = /* @__PURE__ */ function(r) {
|
|
1397
|
-
return r.Schema = "Schema", r.Table = "Table", r.Column = "Column", r.TableGroup = "TableGroup", r.TableGroupField = "TableGroup field", r.Enum = "Enum", r.EnumField = "Enum field", r.Note = "Note", r.TablePartial = "TablePartial", r.PartialInjection = "PartialInjection", r;
|
|
1415
|
+
return r.Schema = "Schema", r.Table = "Table", r.Column = "Column", r.TableGroup = "TableGroup", r.TableGroupField = "TableGroup field", r.Enum = "Enum", r.EnumField = "Enum field", r.Note = "Note", r.TablePartial = "TablePartial", r.PartialInjection = "PartialInjection", r.DiagramView = "DiagramView", r.DiagramViewField = "DiagramView field", r;
|
|
1398
1416
|
}({});
|
|
1399
1417
|
function createSchemaSymbolIndex(r) {
|
|
1400
1418
|
return `${SymbolKind.Schema}:${r}`;
|
|
@@ -1426,6 +1444,12 @@ function createTablePartialSymbolIndex(r) {
|
|
|
1426
1444
|
function createPartialInjectionSymbolIndex(r) {
|
|
1427
1445
|
return `${SymbolKind.PartialInjection}:${r}`;
|
|
1428
1446
|
}
|
|
1447
|
+
function createDiagramViewSymbolIndex(r) {
|
|
1448
|
+
return `${SymbolKind.DiagramView}:${r}`;
|
|
1449
|
+
}
|
|
1450
|
+
function createDiagramViewFieldSymbolIndex(r) {
|
|
1451
|
+
return `${SymbolKind.DiagramViewField}:${r}`;
|
|
1452
|
+
}
|
|
1429
1453
|
function createNodeSymbolIndex(r, j) {
|
|
1430
1454
|
switch (j) {
|
|
1431
1455
|
case SymbolKind.Column: return createColumnSymbolIndex(r);
|
|
@@ -1435,8 +1459,11 @@ function createNodeSymbolIndex(r, j) {
|
|
|
1435
1459
|
case SymbolKind.Table: return createTableSymbolIndex(r);
|
|
1436
1460
|
case SymbolKind.TableGroup: return createTableGroupSymbolIndex(r);
|
|
1437
1461
|
case SymbolKind.TableGroupField: return createTableGroupFieldSymbolIndex(r);
|
|
1462
|
+
case SymbolKind.Note: return createStickyNoteSymbolIndex(r);
|
|
1438
1463
|
case SymbolKind.TablePartial: return createTablePartialSymbolIndex(r);
|
|
1439
1464
|
case SymbolKind.PartialInjection: return createPartialInjectionSymbolIndex(r);
|
|
1465
|
+
case SymbolKind.DiagramView: return createDiagramViewSymbolIndex(r);
|
|
1466
|
+
case SymbolKind.DiagramViewField: return createDiagramViewFieldSymbolIndex(r);
|
|
1440
1467
|
default: throw Error("Unreachable");
|
|
1441
1468
|
}
|
|
1442
1469
|
}
|
|
@@ -1471,20 +1498,23 @@ var SymbolTable = class {
|
|
|
1471
1498
|
this.declarationNode = r, this.publicSymbolTable = j, this.symbolFactory = M;
|
|
1472
1499
|
}
|
|
1473
1500
|
validate() {
|
|
1474
|
-
return
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1501
|
+
return {
|
|
1502
|
+
errors: [
|
|
1503
|
+
...this.validateContext(),
|
|
1504
|
+
...this.validateName(this.declarationNode.name),
|
|
1505
|
+
...this.validateAlias(this.declarationNode.alias),
|
|
1506
|
+
...this.validateSettingList(this.declarationNode.attributeList),
|
|
1507
|
+
...this.registerElement(),
|
|
1508
|
+
...this.validateBody(this.declarationNode.body)
|
|
1509
|
+
],
|
|
1510
|
+
warnings: []
|
|
1511
|
+
};
|
|
1482
1512
|
}
|
|
1483
1513
|
validateContext() {
|
|
1484
1514
|
return this.declarationNode.parent instanceof ElementDeclarationNode ? [new CompileError(CompileErrorCode.INVALID_PROJECT_CONTEXT, "An Enum can only appear top-level", this.declarationNode)] : [];
|
|
1485
1515
|
}
|
|
1486
1516
|
validateName(r) {
|
|
1487
|
-
return r ? isValidName(r) ? [] : [new CompileError(CompileErrorCode.INVALID_NAME, "An Enum name must be of the form <enum> or <schema>.<enum>", r)] : [new CompileError(CompileErrorCode.NAME_NOT_FOUND, "An Enum must have a name", this.declarationNode)];
|
|
1517
|
+
return r ? r instanceof WildcardNode ? [new CompileError(CompileErrorCode.INVALID_NAME, "Wildcard (*) is not allowed as an Enum name", r)] : isValidName(r) ? [] : [new CompileError(CompileErrorCode.INVALID_NAME, "An Enum name must be of the form <enum> or <schema>.<enum>", r)] : [new CompileError(CompileErrorCode.NAME_NOT_FOUND, "An Enum must have a name", this.declarationNode)];
|
|
1488
1518
|
}
|
|
1489
1519
|
validateAlias(r) {
|
|
1490
1520
|
return r ? [new CompileError(CompileErrorCode.UNEXPECTED_ALIAS, "An Enum shouldn't have an alias", r)] : [];
|
|
@@ -1535,7 +1565,7 @@ var SymbolTable = class {
|
|
|
1535
1565
|
return M;
|
|
1536
1566
|
}
|
|
1537
1567
|
validateSubElements(r) {
|
|
1538
|
-
return r.flatMap((r) => (r.parent = this.declarationNode, r.type ? new (pickValidator(r))(r, this.publicSymbolTable, this.symbolFactory).validate() : []));
|
|
1568
|
+
return r.flatMap((r) => (r.parent = this.declarationNode, r.type ? new (pickValidator(r))(r, this.publicSymbolTable, this.symbolFactory).validate().errors : []));
|
|
1539
1569
|
}
|
|
1540
1570
|
registerField(r) {
|
|
1541
1571
|
if (r.callee && isExpressionAVariableNode(r.callee)) {
|
|
@@ -1555,13 +1585,16 @@ var SymbolTable = class {
|
|
|
1555
1585
|
this.declarationNode = r, this.publicSymbolTable = j, this.symbolFactory = M;
|
|
1556
1586
|
}
|
|
1557
1587
|
validate() {
|
|
1558
|
-
return
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1588
|
+
return {
|
|
1589
|
+
errors: [
|
|
1590
|
+
...this.validateContext(),
|
|
1591
|
+
...this.validateName(this.declarationNode.name),
|
|
1592
|
+
...this.validateAlias(this.declarationNode.alias),
|
|
1593
|
+
...this.validateSettingList(this.declarationNode.attributeList),
|
|
1594
|
+
...this.validateBody(this.declarationNode.body)
|
|
1595
|
+
],
|
|
1596
|
+
warnings: []
|
|
1597
|
+
};
|
|
1565
1598
|
}
|
|
1566
1599
|
validateContext() {
|
|
1567
1600
|
let r = new CompileError(CompileErrorCode.INVALID_INDEXES_CONTEXT, "An Indexes can only appear inside a Table or a TablePartial", this.declarationNode);
|
|
@@ -1570,7 +1603,7 @@ var SymbolTable = class {
|
|
|
1570
1603
|
return j && [ElementKind.Table, ElementKind.TablePartial].includes(j) ? [] : [r];
|
|
1571
1604
|
}
|
|
1572
1605
|
validateName(r) {
|
|
1573
|
-
return r ? [new CompileError(CompileErrorCode.UNEXPECTED_NAME, "An Indexes shouldn't have a name", r)] : [];
|
|
1606
|
+
return r instanceof WildcardNode ? [new CompileError(CompileErrorCode.INVALID_NAME, "Wildcard (*) is not allowed as an Indexes name", r)] : r ? [new CompileError(CompileErrorCode.UNEXPECTED_NAME, "An Indexes shouldn't have a name", r)] : [];
|
|
1574
1607
|
}
|
|
1575
1608
|
validateAlias(r) {
|
|
1576
1609
|
return r ? [new CompileError(CompileErrorCode.UNEXPECTED_ALIAS, "An Indexes shouldn't have an alias", r)] : [];
|
|
@@ -1622,20 +1655,23 @@ var SymbolTable = class {
|
|
|
1622
1655
|
return M;
|
|
1623
1656
|
}
|
|
1624
1657
|
validateSubElements(r) {
|
|
1625
|
-
return r.flatMap((r) => (r.parent = this.declarationNode, r.type ? new (pickValidator(r))(r, this.publicSymbolTable, this.symbolFactory).validate() : []));
|
|
1658
|
+
return r.flatMap((r) => (r.parent = this.declarationNode, r.type ? new (pickValidator(r))(r, this.publicSymbolTable, this.symbolFactory).validate().errors : []));
|
|
1626
1659
|
}
|
|
1627
1660
|
}, NoteValidator = class {
|
|
1628
1661
|
constructor(r, j, M) {
|
|
1629
1662
|
this.declarationNode = r, this.publicSymbolTable = j, this.symbolFactory = M;
|
|
1630
1663
|
}
|
|
1631
1664
|
validate() {
|
|
1632
|
-
return
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1665
|
+
return {
|
|
1666
|
+
errors: [
|
|
1667
|
+
...this.validateContext(),
|
|
1668
|
+
...this.validateName(this.declarationNode.name),
|
|
1669
|
+
...this.validateAlias(this.declarationNode.alias),
|
|
1670
|
+
...this.validateSettingList(this.declarationNode.attributeList),
|
|
1671
|
+
...this.validateBody(this.declarationNode.body)
|
|
1672
|
+
],
|
|
1673
|
+
warnings: []
|
|
1674
|
+
};
|
|
1639
1675
|
}
|
|
1640
1676
|
validateContext() {
|
|
1641
1677
|
return !(this.declarationNode.parent instanceof ProgramNode) && ![
|
|
@@ -1648,10 +1684,11 @@ var SymbolTable = class {
|
|
|
1648
1684
|
validateName(r) {
|
|
1649
1685
|
if (!(this.declarationNode.parent instanceof ProgramNode)) return r ? [new CompileError(CompileErrorCode.UNEXPECTED_NAME, "A Note shouldn't have a name", r)] : [];
|
|
1650
1686
|
if (!r) return [new CompileError(CompileErrorCode.INVALID_NAME, "Sticky note must have a name", this.declarationNode)];
|
|
1687
|
+
if (r instanceof WildcardNode) return [new CompileError(CompileErrorCode.INVALID_NAME, "Wildcard (*) is not allowed as a Note name", r)];
|
|
1651
1688
|
let j = destructureComplexVariable(r);
|
|
1652
1689
|
if (!j.isOk()) return [new CompileError(CompileErrorCode.INVALID_NAME, "Invalid name for sticky note ", this.declarationNode)];
|
|
1653
1690
|
let M = j.unwrap().join("."), N = createStickyNoteSymbolIndex(M);
|
|
1654
|
-
return this.publicSymbolTable.has(N) ? [new CompileError(CompileErrorCode.DUPLICATE_NAME, `Sticky note "${M}" has already been defined`, r)] : (this.publicSymbolTable.set(N, this.declarationNode.symbol), []);
|
|
1691
|
+
return this.publicSymbolTable.has(N) ? [new CompileError(CompileErrorCode.DUPLICATE_NAME, `Sticky note "${M}" has already been defined`, r)] : (this.declarationNode.symbol = this.symbolFactory.create(StickyNoteSymbol, { declaration: this.declarationNode }), this.publicSymbolTable.set(N, this.declarationNode.symbol), []);
|
|
1655
1692
|
}
|
|
1656
1693
|
validateAlias(r) {
|
|
1657
1694
|
return r ? [new CompileError(CompileErrorCode.UNEXPECTED_ALIAS, "A Ref shouldn't have an alias", r)] : [];
|
|
@@ -1670,26 +1707,29 @@ var SymbolTable = class {
|
|
|
1670
1707
|
return r.length === 0 ? [new CompileError(CompileErrorCode.EMPTY_NOTE, "A Note must have a content", this.declarationNode)] : (r.length > 1 && r.slice(1).forEach((r) => j.push(new CompileError(CompileErrorCode.NOTE_CONTENT_REDEFINED, "A Note can only contain one string", r))), isExpressionAQuotedString(r[0].callee) || j.push(new CompileError(CompileErrorCode.INVALID_NOTE, "A Note content must be a quoted string", r[0])), r[0].args.length > 0 && j.push(...r[0].args.map((r) => new CompileError(CompileErrorCode.INVALID_NOTE, "A Note can only contain one quoted string", r))), j);
|
|
1671
1708
|
}
|
|
1672
1709
|
validateSubElements(r) {
|
|
1673
|
-
return r.flatMap((r) => (r.parent = this.declarationNode, r.type ? new (pickValidator(r))(r, this.publicSymbolTable, this.symbolFactory).validate() : []));
|
|
1710
|
+
return r.flatMap((r) => (r.parent = this.declarationNode, r.type ? new (pickValidator(r))(r, this.publicSymbolTable, this.symbolFactory).validate().errors : []));
|
|
1674
1711
|
}
|
|
1675
1712
|
}, ProjectValidator = class {
|
|
1676
1713
|
constructor(r, j, M) {
|
|
1677
1714
|
this.declarationNode = r, this.publicSymbolTable = j, this.symbolFactory = M;
|
|
1678
1715
|
}
|
|
1679
1716
|
validate() {
|
|
1680
|
-
return
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1717
|
+
return {
|
|
1718
|
+
errors: [
|
|
1719
|
+
...this.validateContext(),
|
|
1720
|
+
...this.validateName(this.declarationNode.name),
|
|
1721
|
+
...this.validateAlias(this.declarationNode.alias),
|
|
1722
|
+
...this.validateSettingList(this.declarationNode.attributeList),
|
|
1723
|
+
...this.validateBody(this.declarationNode.body)
|
|
1724
|
+
],
|
|
1725
|
+
warnings: []
|
|
1726
|
+
};
|
|
1687
1727
|
}
|
|
1688
1728
|
validateContext() {
|
|
1689
1729
|
return this.declarationNode.parent instanceof ElementDeclarationNode ? [new CompileError(CompileErrorCode.INVALID_PROJECT_CONTEXT, "A Project can only appear top-level", this.declarationNode)] : [];
|
|
1690
1730
|
}
|
|
1691
1731
|
validateName(r) {
|
|
1692
|
-
return r ? isSimpleName(r) ? [] : [new CompileError(CompileErrorCode.INVALID_NAME, "A Project's name is optional or must be an identifier or a quoted identifer", r)] : [];
|
|
1732
|
+
return r ? r instanceof WildcardNode ? [new CompileError(CompileErrorCode.INVALID_NAME, "Wildcard (*) is not allowed as a Project name", r)] : isSimpleName(r) ? [] : [new CompileError(CompileErrorCode.INVALID_NAME, "A Project's name is optional or must be an identifier or a quoted identifer", r)] : [];
|
|
1693
1733
|
}
|
|
1694
1734
|
validateAlias(r) {
|
|
1695
1735
|
return r ? [new CompileError(CompileErrorCode.UNEXPECTED_ALIAS, "A Project shouldn't have an alias", r)] : [];
|
|
@@ -1704,26 +1744,29 @@ var SymbolTable = class {
|
|
|
1704
1744
|
return [...j.map((r) => new CompileError(CompileErrorCode.INVALID_PROJECT_FIELD, "A Project can not have inline fields", r)), ...this.validateSubElements(M)];
|
|
1705
1745
|
}
|
|
1706
1746
|
validateSubElements(r) {
|
|
1707
|
-
return r.flatMap((r) => (r.parent = this.declarationNode, r.type ? new (pickValidator(r))(r, this.publicSymbolTable, this.symbolFactory).validate() : []));
|
|
1747
|
+
return r.flatMap((r) => (r.parent = this.declarationNode, r.type ? new (pickValidator(r))(r, this.publicSymbolTable, this.symbolFactory).validate().errors : []));
|
|
1708
1748
|
}
|
|
1709
1749
|
}, RefValidator = class {
|
|
1710
1750
|
constructor(r, j, M) {
|
|
1711
1751
|
this.declarationNode = r, this.publicSymbolTable = j, this.symbolFactory = M;
|
|
1712
1752
|
}
|
|
1713
1753
|
validate() {
|
|
1714
|
-
return
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1754
|
+
return {
|
|
1755
|
+
errors: [
|
|
1756
|
+
...this.validateContext(),
|
|
1757
|
+
...this.validateName(this.declarationNode.name),
|
|
1758
|
+
...this.validateAlias(this.declarationNode.alias),
|
|
1759
|
+
...this.validateSettingList(this.declarationNode.attributeList),
|
|
1760
|
+
...this.validateBody(this.declarationNode.body)
|
|
1761
|
+
],
|
|
1762
|
+
warnings: []
|
|
1763
|
+
};
|
|
1721
1764
|
}
|
|
1722
1765
|
validateContext() {
|
|
1723
1766
|
return this.declarationNode.parent instanceof ProgramNode ? [] : [new CompileError(CompileErrorCode.INVALID_REF_CONTEXT, "A Ref must appear top-level", this.declarationNode)];
|
|
1724
1767
|
}
|
|
1725
1768
|
validateName(r) {
|
|
1726
|
-
return r ? isSimpleName(r) ? [] : [new CompileError(CompileErrorCode.INVALID_NAME, "A Ref's name is optional or must be an identifier or a quoted identifer", r)] : [];
|
|
1769
|
+
return r ? r instanceof WildcardNode ? [new CompileError(CompileErrorCode.INVALID_NAME, "Wildcard (*) is not allowed as a Ref name", r)] : isSimpleName(r) ? [] : [new CompileError(CompileErrorCode.INVALID_NAME, "A Ref's name is optional or must be an identifier or a quoted identifer", r)] : [];
|
|
1727
1770
|
}
|
|
1728
1771
|
validateAlias(r) {
|
|
1729
1772
|
return r ? [new CompileError(CompileErrorCode.UNEXPECTED_ALIAS, "A Ref shouldn't have an alias", r)] : [];
|
|
@@ -1782,7 +1825,7 @@ var SymbolTable = class {
|
|
|
1782
1825
|
return M;
|
|
1783
1826
|
}
|
|
1784
1827
|
validateSubElements(r) {
|
|
1785
|
-
return r.flatMap((r) => (r.parent = this.declarationNode, r.type ? new (pickValidator(r))(r, this.publicSymbolTable, this.symbolFactory).validate() : []));
|
|
1828
|
+
return r.flatMap((r) => (r.parent = this.declarationNode, r.type ? new (pickValidator(r))(r, this.publicSymbolTable, this.symbolFactory).validate().errors : []));
|
|
1786
1829
|
}
|
|
1787
1830
|
};
|
|
1788
1831
|
function isValidPolicy(r) {
|
|
@@ -1803,20 +1846,23 @@ var TableValidator = class {
|
|
|
1803
1846
|
this.declarationNode = r, this.symbolFactory = M, this.publicSymbolTable = j;
|
|
1804
1847
|
}
|
|
1805
1848
|
validate() {
|
|
1806
|
-
return
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1849
|
+
return {
|
|
1850
|
+
errors: [
|
|
1851
|
+
...this.validateContext(),
|
|
1852
|
+
...this.validateName(this.declarationNode.name),
|
|
1853
|
+
...this.validateAlias(this.declarationNode.alias),
|
|
1854
|
+
...this.validateSettingList(this.declarationNode.attributeList),
|
|
1855
|
+
...this.registerElement(),
|
|
1856
|
+
...this.validateBody(this.declarationNode.body)
|
|
1857
|
+
],
|
|
1858
|
+
warnings: []
|
|
1859
|
+
};
|
|
1814
1860
|
}
|
|
1815
1861
|
validateContext() {
|
|
1816
1862
|
return this.declarationNode.parent instanceof ElementDeclarationNode ? [new CompileError(CompileErrorCode.INVALID_TABLE_CONTEXT, "Table must appear top-level", this.declarationNode)] : [];
|
|
1817
1863
|
}
|
|
1818
1864
|
validateName(r) {
|
|
1819
|
-
return r ? r instanceof ArrayNode ? [new CompileError(CompileErrorCode.INVALID_NAME, "Invalid array as Table name, maybe you forget to add a space between the name and the setting list?", r)] : isValidName(r) ? [] : [new CompileError(CompileErrorCode.INVALID_NAME, "A Table name must be of the form <table> or <schema>.<table>", r)] : [new CompileError(CompileErrorCode.NAME_NOT_FOUND, "A Table must have a name", this.declarationNode)];
|
|
1865
|
+
return r ? r instanceof WildcardNode ? [new CompileError(CompileErrorCode.INVALID_NAME, "Wildcard (*) is not allowed as a Table name", r)] : r instanceof ArrayNode ? [new CompileError(CompileErrorCode.INVALID_NAME, "Invalid array as Table name, maybe you forget to add a space between the name and the setting list?", r)] : isValidName(r) ? [] : [new CompileError(CompileErrorCode.INVALID_NAME, "A Table name must be of the form <table> or <schema>.<table>", r)] : [new CompileError(CompileErrorCode.NAME_NOT_FOUND, "A Table must have a name", this.declarationNode)];
|
|
1820
1866
|
}
|
|
1821
1867
|
validateAlias(r) {
|
|
1822
1868
|
return r ? isValidAlias(r) ? [] : [new CompileError(CompileErrorCode.INVALID_ALIAS, "Table aliases can only contains alphanumeric and underscore unless surrounded by double quotes", r)] : [];
|
|
@@ -1976,7 +2022,7 @@ var TableValidator = class {
|
|
|
1976
2022
|
}), N;
|
|
1977
2023
|
}
|
|
1978
2024
|
validateSubElements(r) {
|
|
1979
|
-
let j = r.flatMap((r) => (r.parent = this.declarationNode, r.type ? new (pickValidator(r))(r, this.publicSymbolTable, this.symbolFactory).validate() : [])), M = r.filter((r) => r.type?.value.toLowerCase() === "note");
|
|
2025
|
+
let j = r.flatMap((r) => (r.parent = this.declarationNode, r.type ? new (pickValidator(r))(r, this.publicSymbolTable, this.symbolFactory).validate().errors : [])), M = r.filter((r) => r.type?.value.toLowerCase() === "note");
|
|
1980
2026
|
return M.length > 1 && j.push(...M.map((r) => new CompileError(CompileErrorCode.NOTE_REDEFINED, "Duplicate notes are defined", r))), j;
|
|
1981
2027
|
}
|
|
1982
2028
|
};
|
|
@@ -1988,20 +2034,23 @@ var TableGroupValidator = class {
|
|
|
1988
2034
|
this.declarationNode = r, this.publicSymbolTable = j, this.symbolFactory = M;
|
|
1989
2035
|
}
|
|
1990
2036
|
validate() {
|
|
1991
|
-
return
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
2037
|
+
return {
|
|
2038
|
+
errors: [
|
|
2039
|
+
...this.validateContext(),
|
|
2040
|
+
...this.validateName(this.declarationNode.name),
|
|
2041
|
+
...this.validateAlias(this.declarationNode.alias),
|
|
2042
|
+
...this.validateSettingList(this.declarationNode.attributeList),
|
|
2043
|
+
...this.registerElement(),
|
|
2044
|
+
...this.validateBody(this.declarationNode.body)
|
|
2045
|
+
],
|
|
2046
|
+
warnings: []
|
|
2047
|
+
};
|
|
1999
2048
|
}
|
|
2000
2049
|
validateContext() {
|
|
2001
2050
|
return this.declarationNode.parent instanceof ElementDeclarationNode ? [new CompileError(CompileErrorCode.INVALID_TABLEGROUP_CONTEXT, "TableGroup must appear top-level", this.declarationNode)] : [];
|
|
2002
2051
|
}
|
|
2003
2052
|
validateName(r) {
|
|
2004
|
-
return r ? isSimpleName(r) ? [] : [new CompileError(CompileErrorCode.INVALID_NAME, "A TableGroup name must be a single identifier", r)] : [new CompileError(CompileErrorCode.NAME_NOT_FOUND, "A TableGroup must have a name", this.declarationNode)];
|
|
2053
|
+
return r ? r instanceof WildcardNode ? [new CompileError(CompileErrorCode.INVALID_NAME, "Wildcard (*) is not allowed as a TableGroup name", r)] : isSimpleName(r) ? [] : [new CompileError(CompileErrorCode.INVALID_NAME, "A TableGroup name must be a single identifier", r)] : [new CompileError(CompileErrorCode.NAME_NOT_FOUND, "A TableGroup must have a name", this.declarationNode)];
|
|
2005
2054
|
}
|
|
2006
2055
|
validateAlias(r) {
|
|
2007
2056
|
return r ? [new CompileError(CompileErrorCode.UNEXPECTED_ALIAS, "A TableGroup shouldn't have an alias", r)] : [];
|
|
@@ -2053,7 +2102,7 @@ var TableGroupValidator = class {
|
|
|
2053
2102
|
});
|
|
2054
2103
|
}
|
|
2055
2104
|
validateSubElements(r) {
|
|
2056
|
-
let j = r.flatMap((r) => (r.parent = this.declarationNode, r.type ? new (pickValidator(r))(r, this.publicSymbolTable, this.symbolFactory).validate() : [])), M = r.filter((r) => r.type?.value.toLowerCase() === "note");
|
|
2105
|
+
let j = r.flatMap((r) => (r.parent = this.declarationNode, r.type ? new (pickValidator(r))(r, this.publicSymbolTable, this.symbolFactory).validate().errors : [])), M = r.filter((r) => r.type?.value.toLowerCase() === "note");
|
|
2057
2106
|
return M.length > 1 && j.push(...M.map((r) => new CompileError(CompileErrorCode.NOTE_REDEFINED, "Duplicate notes are defined", r))), j;
|
|
2058
2107
|
}
|
|
2059
2108
|
registerField(r) {
|
|
@@ -2074,20 +2123,23 @@ var TableGroupValidator = class {
|
|
|
2074
2123
|
this.declarationNode = r, this.symbolFactory = M, this.publicSymbolTable = j;
|
|
2075
2124
|
}
|
|
2076
2125
|
validate() {
|
|
2077
|
-
return
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2126
|
+
return {
|
|
2127
|
+
errors: [
|
|
2128
|
+
...this.validateContext(),
|
|
2129
|
+
...this.validateName(this.declarationNode.name),
|
|
2130
|
+
...this.validateAlias(this.declarationNode.alias),
|
|
2131
|
+
...this.validateSettingList(this.declarationNode.attributeList),
|
|
2132
|
+
...this.registerElement(),
|
|
2133
|
+
...this.validateBody(this.declarationNode.body)
|
|
2134
|
+
],
|
|
2135
|
+
warnings: []
|
|
2136
|
+
};
|
|
2085
2137
|
}
|
|
2086
2138
|
validateContext() {
|
|
2087
2139
|
return this.declarationNode.parent instanceof ElementDeclarationNode ? [new CompileError(CompileErrorCode.INVALID_TABLE_PARTIAL_CONTEXT, "TablePartial must appear top-level", this.declarationNode)] : [];
|
|
2088
2140
|
}
|
|
2089
2141
|
validateName(r) {
|
|
2090
|
-
return r ? isSimpleName(r) ? [] : [new CompileError(CompileErrorCode.INVALID_NAME, "A TablePartial name must be an identifier or a quoted identifer", r)] : [new CompileError(CompileErrorCode.NAME_NOT_FOUND, "A TablePartial must have a name", this.declarationNode)];
|
|
2142
|
+
return r ? r instanceof WildcardNode ? [new CompileError(CompileErrorCode.INVALID_NAME, "Wildcard (*) is not allowed as a TablePartial name", r)] : isSimpleName(r) ? [] : [new CompileError(CompileErrorCode.INVALID_NAME, "A TablePartial name must be an identifier or a quoted identifer", r)] : [new CompileError(CompileErrorCode.NAME_NOT_FOUND, "A TablePartial must have a name", this.declarationNode)];
|
|
2091
2143
|
}
|
|
2092
2144
|
validateAlias(r) {
|
|
2093
2145
|
return r ? [new CompileError(CompileErrorCode.UNEXPECTED_ALIAS, "A TablePartial shouldn't have an alias", r)] : [];
|
|
@@ -2223,7 +2275,7 @@ var TableGroupValidator = class {
|
|
|
2223
2275
|
}), P;
|
|
2224
2276
|
}
|
|
2225
2277
|
validateSubElements(r) {
|
|
2226
|
-
let j = r.flatMap((r) => (r.parent = this.declarationNode, r.type ? new (pickValidator(r))(r, this.publicSymbolTable, this.symbolFactory).validate() : [])), M = r.filter((r) => r.type?.value.toLowerCase() === ElementKind.Note);
|
|
2278
|
+
let j = r.flatMap((r) => (r.parent = this.declarationNode, r.type ? new (pickValidator(r))(r, this.publicSymbolTable, this.symbolFactory).validate().errors : [])), M = r.filter((r) => r.type?.value.toLowerCase() === ElementKind.Note);
|
|
2227
2279
|
return M.length > 1 && j.push(...M.map((r) => new CompileError(CompileErrorCode.NOTE_REDEFINED, "Duplicate notes are defined", r))), j;
|
|
2228
2280
|
}
|
|
2229
2281
|
}, ChecksValidator = class {
|
|
@@ -2231,13 +2283,16 @@ var TableGroupValidator = class {
|
|
|
2231
2283
|
this.declarationNode = r, this.publicSymbolTable = j, this.symbolFactory = M;
|
|
2232
2284
|
}
|
|
2233
2285
|
validate() {
|
|
2234
|
-
return
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2286
|
+
return {
|
|
2287
|
+
errors: [
|
|
2288
|
+
...this.validateContext(),
|
|
2289
|
+
...this.validateName(this.declarationNode.name),
|
|
2290
|
+
...this.validateAlias(this.declarationNode.alias),
|
|
2291
|
+
...this.validateSettingList(this.declarationNode.attributeList),
|
|
2292
|
+
...this.validateBody(this.declarationNode.body)
|
|
2293
|
+
],
|
|
2294
|
+
warnings: []
|
|
2295
|
+
};
|
|
2241
2296
|
}
|
|
2242
2297
|
validateContext() {
|
|
2243
2298
|
let r = new CompileError(CompileErrorCode.INVALID_CHECKS_CONTEXT, "A Checks can only appear inside a Table or a TablePartial", this.declarationNode);
|
|
@@ -2246,7 +2301,7 @@ var TableGroupValidator = class {
|
|
|
2246
2301
|
return j && [ElementKind.Table, ElementKind.TablePartial].includes(j) ? [] : [r];
|
|
2247
2302
|
}
|
|
2248
2303
|
validateName(r) {
|
|
2249
|
-
return r ? [new CompileError(CompileErrorCode.UNEXPECTED_NAME, "A Checks shouldn't have a name", r)] : [];
|
|
2304
|
+
return r instanceof WildcardNode ? [new CompileError(CompileErrorCode.INVALID_NAME, "Wildcard (*) is not allowed as a Checks name", r)] : r ? [new CompileError(CompileErrorCode.UNEXPECTED_NAME, "A Checks shouldn't have a name", r)] : [];
|
|
2250
2305
|
}
|
|
2251
2306
|
validateAlias(r) {
|
|
2252
2307
|
return r ? [new CompileError(CompileErrorCode.UNEXPECTED_ALIAS, "A Checks shouldn't have an alias", r)] : [];
|
|
@@ -2283,27 +2338,30 @@ var TableGroupValidator = class {
|
|
|
2283
2338
|
return M;
|
|
2284
2339
|
}
|
|
2285
2340
|
validateSubElements(r) {
|
|
2286
|
-
return r.flatMap((r) => (r.parent = this.declarationNode, r.type ? new (pickValidator(r))(r, this.publicSymbolTable, this.symbolFactory).validate() : []));
|
|
2341
|
+
return r.flatMap((r) => (r.parent = this.declarationNode, r.type ? new (pickValidator(r))(r, this.publicSymbolTable, this.symbolFactory).validate().errors : []));
|
|
2287
2342
|
}
|
|
2288
2343
|
}, RecordsValidator = class {
|
|
2289
2344
|
constructor(r, j, M) {
|
|
2290
2345
|
this.declarationNode = r, this.publicSymbolTable = j, this.symbolFactory = M;
|
|
2291
2346
|
}
|
|
2292
2347
|
validate() {
|
|
2293
|
-
return
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2348
|
+
return {
|
|
2349
|
+
errors: [
|
|
2350
|
+
...this.validateContext(),
|
|
2351
|
+
...this.validateName(this.declarationNode.name),
|
|
2352
|
+
...this.validateAlias(this.declarationNode.alias),
|
|
2353
|
+
...this.validateSettingList(this.declarationNode.attributeList),
|
|
2354
|
+
...this.validateBody(this.declarationNode.body)
|
|
2355
|
+
],
|
|
2356
|
+
warnings: []
|
|
2357
|
+
};
|
|
2300
2358
|
}
|
|
2301
2359
|
validateContext() {
|
|
2302
2360
|
let r = this.declarationNode.parent;
|
|
2303
2361
|
return r instanceof ProgramNode || r instanceof ElementDeclarationNode && getElementKind(r).unwrap_or(void 0) === ElementKind.Table ? [] : [new CompileError(CompileErrorCode.INVALID_RECORDS_CONTEXT, "Records can only appear at top-level or inside a Table", this.declarationNode)];
|
|
2304
2362
|
}
|
|
2305
2363
|
validateName(r) {
|
|
2306
|
-
return this.declarationNode.parent instanceof ProgramNode ? this.validateTopLevelName(r) : this.validateInsideTableName(r);
|
|
2364
|
+
return r instanceof WildcardNode ? [new CompileError(CompileErrorCode.INVALID_NAME, "Wildcard (*) is not allowed as a Records name", r)] : this.declarationNode.parent instanceof ProgramNode ? this.validateTopLevelName(r) : this.validateInsideTableName(r);
|
|
2307
2365
|
}
|
|
2308
2366
|
validateTopLevelName(r) {
|
|
2309
2367
|
if (!(r instanceof CallExpressionNode)) return [new CompileError(CompileErrorCode.INVALID_RECORDS_NAME, "Records at top-level must have a name in the form of table(col1, col2, ...) or schema.table(col1, col2, ...)", r || this.declarationNode.type)];
|
|
@@ -2348,7 +2406,127 @@ var TableGroupValidator = class {
|
|
|
2348
2406
|
return !1;
|
|
2349
2407
|
}
|
|
2350
2408
|
validateSubElements(r) {
|
|
2351
|
-
return r.flatMap((r) => (r.parent = this.declarationNode, r.type ? new (pickValidator(r))(r, this.publicSymbolTable, this.symbolFactory).validate() : []));
|
|
2409
|
+
return r.flatMap((r) => (r.parent = this.declarationNode, r.type ? new (pickValidator(r))(r, this.publicSymbolTable, this.symbolFactory).validate().errors : []));
|
|
2410
|
+
}
|
|
2411
|
+
}, DiagramViewValidator = class {
|
|
2412
|
+
constructor(r, j, M) {
|
|
2413
|
+
this.declarationNode = r, this.publicSymbolTable = j, this.symbolFactory = M;
|
|
2414
|
+
}
|
|
2415
|
+
validate() {
|
|
2416
|
+
let r = [
|
|
2417
|
+
...this.validateContext(),
|
|
2418
|
+
...this.validateName(this.declarationNode.name),
|
|
2419
|
+
...this.validateAlias(this.declarationNode.alias),
|
|
2420
|
+
...this.validateSettingList(this.declarationNode.attributeList),
|
|
2421
|
+
...this.registerElement()
|
|
2422
|
+
], j = this.validateBody(this.declarationNode.body);
|
|
2423
|
+
return r.push(...j.errors), {
|
|
2424
|
+
errors: r,
|
|
2425
|
+
warnings: j.warnings
|
|
2426
|
+
};
|
|
2427
|
+
}
|
|
2428
|
+
validateContext() {
|
|
2429
|
+
return this.declarationNode.parent instanceof ElementDeclarationNode ? [new CompileError(CompileErrorCode.INVALID_DIAGRAMVIEW_CONTEXT, "DiagramView must appear top-level", this.declarationNode)] : [];
|
|
2430
|
+
}
|
|
2431
|
+
validateName(r) {
|
|
2432
|
+
return r ? isSimpleName(r) ? [] : [new CompileError(CompileErrorCode.INVALID_NAME, "A DiagramView name must be a single identifier", r)] : [new CompileError(CompileErrorCode.NAME_NOT_FOUND, "A DiagramView must have a name", this.declarationNode)];
|
|
2433
|
+
}
|
|
2434
|
+
validateAlias(r) {
|
|
2435
|
+
return r ? [new CompileError(CompileErrorCode.UNEXPECTED_ALIAS, "A DiagramView shouldn't have an alias", r)] : [];
|
|
2436
|
+
}
|
|
2437
|
+
registerElement() {
|
|
2438
|
+
let { name: r } = this.declarationNode;
|
|
2439
|
+
this.declarationNode.symbol = this.symbolFactory.create(DiagramViewSymbol, {
|
|
2440
|
+
declaration: this.declarationNode,
|
|
2441
|
+
symbolTable: new SymbolTable()
|
|
2442
|
+
});
|
|
2443
|
+
let j = destructureComplexVariable(r);
|
|
2444
|
+
if (j.isOk()) {
|
|
2445
|
+
let M = j.unwrap(), N = M.pop(), P = registerSchemaStack(M, this.publicSymbolTable, this.symbolFactory), F = createDiagramViewSymbolIndex(N);
|
|
2446
|
+
if (P.has(F)) return [new CompileError(CompileErrorCode.DUPLICATE_DIAGRAMVIEW_NAME, `DiagramView name '${N}' already exists`, r)];
|
|
2447
|
+
P.set(F, this.declarationNode.symbol);
|
|
2448
|
+
}
|
|
2449
|
+
return [];
|
|
2450
|
+
}
|
|
2451
|
+
validateSettingList(r) {
|
|
2452
|
+
let j = aggregateSettingList(r), M = j.getErrors(), N = j.getValue();
|
|
2453
|
+
for (let r of Object.keys(N)) M.push(...N[r].map((j) => new CompileError(CompileErrorCode.UNEXPECTED_SETTINGS, `Unknown '${r}' setting for DiagramView`, j)));
|
|
2454
|
+
return M;
|
|
2455
|
+
}
|
|
2456
|
+
validateBody(r) {
|
|
2457
|
+
if (!r) return {
|
|
2458
|
+
errors: [],
|
|
2459
|
+
warnings: []
|
|
2460
|
+
};
|
|
2461
|
+
if (r instanceof FunctionApplicationNode) return {
|
|
2462
|
+
errors: [new CompileError(CompileErrorCode.UNEXPECTED_SIMPLE_BODY, "A DiagramView's body must be a block", r)],
|
|
2463
|
+
warnings: []
|
|
2464
|
+
};
|
|
2465
|
+
let [j, M] = partition_default(r.body, (r) => r instanceof FunctionApplicationNode), N = this.validateSubElements(M);
|
|
2466
|
+
return {
|
|
2467
|
+
errors: [...this.validateFields(j), ...N.errors],
|
|
2468
|
+
warnings: N.warnings
|
|
2469
|
+
};
|
|
2470
|
+
}
|
|
2471
|
+
validateFields(r) {
|
|
2472
|
+
return r.flatMap((r) => {
|
|
2473
|
+
if (isWildcardExpression(r.callee)) return r.args.length > 0 ? r.args.map((r) => new CompileError(CompileErrorCode.INVALID_DIAGRAMVIEW_FIELD, "DiagramView field should only have a single name", r)) : [];
|
|
2474
|
+
let j = [];
|
|
2475
|
+
return j.push(new CompileError(CompileErrorCode.INVALID_DIAGRAMVIEW_FIELD, "Fields are not allowed at DiagramView level. Use Tables, Notes, TableGroups, or Schemas blocks instead.", r)), j;
|
|
2476
|
+
});
|
|
2477
|
+
}
|
|
2478
|
+
validateSubElements(r) {
|
|
2479
|
+
let j = [], M = [], N = [
|
|
2480
|
+
"tables",
|
|
2481
|
+
"notes",
|
|
2482
|
+
"tablegroups",
|
|
2483
|
+
"schemas"
|
|
2484
|
+
];
|
|
2485
|
+
for (let P of r) {
|
|
2486
|
+
if (P.parent = this.declarationNode, !P.type) continue;
|
|
2487
|
+
let r = P.type.value.toLowerCase();
|
|
2488
|
+
if (!N.includes(r)) {
|
|
2489
|
+
j.push(new CompileError(CompileErrorCode.INVALID_DIAGRAMVIEW_FIELD, `Unknown block type "${P.type.value}" in DiagramView. Allowed: Tables, Notes, TableGroups, Schemas`, P));
|
|
2490
|
+
continue;
|
|
2491
|
+
}
|
|
2492
|
+
let F = this.validateSubBlock(P);
|
|
2493
|
+
j.push(...F.errors), M.push(...F.warnings);
|
|
2494
|
+
}
|
|
2495
|
+
return {
|
|
2496
|
+
errors: j,
|
|
2497
|
+
warnings: M
|
|
2498
|
+
};
|
|
2499
|
+
}
|
|
2500
|
+
validateSubBlock(r) {
|
|
2501
|
+
let j = [], M = [];
|
|
2502
|
+
if (!r.body || !(r.body instanceof BlockExpressionNode)) return {
|
|
2503
|
+
errors: j,
|
|
2504
|
+
warnings: M
|
|
2505
|
+
};
|
|
2506
|
+
let N = r.body, P = N.body.some((r) => r instanceof FunctionApplicationNode && isWildcardExpression(r.callee)), F = N.body.some((r) => r instanceof FunctionApplicationNode && !isWildcardExpression(r.callee));
|
|
2507
|
+
return P && F && M.push(new CompileWarning(CompileErrorCode.INVALID_DIAGRAMVIEW_FIELD, `Wildcard (*) combined with specific items in ${r.type?.value} block. Specific items will be ignored.`, r)), j.push(...this.registerSubBlockFields(r)), {
|
|
2508
|
+
errors: j,
|
|
2509
|
+
warnings: M
|
|
2510
|
+
};
|
|
2511
|
+
}
|
|
2512
|
+
registerSubBlockFields(r) {
|
|
2513
|
+
let j = [];
|
|
2514
|
+
if (!r.body || !(r.body instanceof BlockExpressionNode)) return j;
|
|
2515
|
+
let M = r.body.body.filter((r) => r instanceof FunctionApplicationNode);
|
|
2516
|
+
for (let r of M) {
|
|
2517
|
+
if (r.callee && isExpressionAVariableNode(r.callee)) {
|
|
2518
|
+
if (isWildcardExpression(r.callee)) continue;
|
|
2519
|
+
let M = extractVarNameFromPrimaryVariable(r.callee).unwrap(), N = createDiagramViewFieldSymbolIndex(M), P = this.symbolFactory.create(DiagramViewFieldSymbol, { declaration: r });
|
|
2520
|
+
r.symbol = P;
|
|
2521
|
+
let F = this.declarationNode.symbol.symbolTable;
|
|
2522
|
+
if (F.has(N)) {
|
|
2523
|
+
let P = F.get(N);
|
|
2524
|
+
j.push(new CompileError(CompileErrorCode.DUPLICATE_DIAGRAMVIEW_FIELD, `${M} already exists in DiagramView`, r), new CompileError(CompileErrorCode.DUPLICATE_DIAGRAMVIEW_FIELD, `${M} already exists in DiagramView`, P.declaration));
|
|
2525
|
+
} else F.set(N, P);
|
|
2526
|
+
}
|
|
2527
|
+
r.args.length > 0 && j.push(...r.args.map((r) => new CompileError(CompileErrorCode.INVALID_DIAGRAMVIEW_FIELD, "DiagramView field should only have a single name", r)));
|
|
2528
|
+
}
|
|
2529
|
+
return j;
|
|
2352
2530
|
}
|
|
2353
2531
|
};
|
|
2354
2532
|
function pickValidator(r) {
|
|
@@ -2363,6 +2541,7 @@ function pickValidator(r) {
|
|
|
2363
2541
|
case ElementKind.TablePartial: return TablePartialValidator;
|
|
2364
2542
|
case ElementKind.Check: return ChecksValidator;
|
|
2365
2543
|
case ElementKind.Records: return RecordsValidator;
|
|
2544
|
+
case ElementKind.DiagramView: return DiagramViewValidator;
|
|
2366
2545
|
default: return CustomValidator;
|
|
2367
2546
|
}
|
|
2368
2547
|
}
|
|
@@ -2464,7 +2643,8 @@ function getElementKind(r) {
|
|
|
2464
2643
|
case ElementKind.TableGroup:
|
|
2465
2644
|
case ElementKind.TablePartial:
|
|
2466
2645
|
case ElementKind.Check:
|
|
2467
|
-
case ElementKind.Records:
|
|
2646
|
+
case ElementKind.Records:
|
|
2647
|
+
case ElementKind.DiagramView: return new Some(j);
|
|
2468
2648
|
default: return new None();
|
|
2469
2649
|
}
|
|
2470
2650
|
}
|
|
@@ -2636,6 +2816,7 @@ function getMemberChain(r) {
|
|
|
2636
2816
|
if (r instanceof CallExpressionNode) return filterUndefined(r.callee, r.argumentList);
|
|
2637
2817
|
if (r instanceof PrimaryExpressionNode) return filterUndefined(r.expression);
|
|
2638
2818
|
if (r instanceof ArrayNode) return filterUndefined(r.array, r.indexer);
|
|
2819
|
+
if (r instanceof WildcardNode) return filterUndefined(r.token);
|
|
2639
2820
|
throw r instanceof GroupExpressionNode ? Error("This case is already handled by TupleExpressionNode") : Error("Unreachable - no other possible cases");
|
|
2640
2821
|
}
|
|
2641
2822
|
function extractVariableNode(r) {
|
|
@@ -2647,6 +2828,9 @@ function isExpressionAQuotedString(r) {
|
|
|
2647
2828
|
function isExpressionAVariableNode(r) {
|
|
2648
2829
|
return r instanceof PrimaryExpressionNode && r.expression instanceof VariableNode && r.expression.variable instanceof SyntaxToken;
|
|
2649
2830
|
}
|
|
2831
|
+
function isWildcardExpression(r) {
|
|
2832
|
+
return r ? r instanceof WildcardNode : !1;
|
|
2833
|
+
}
|
|
2650
2834
|
function isExpressionAnIdentifierNode(r) {
|
|
2651
2835
|
return r instanceof PrimaryExpressionNode && r.expression instanceof VariableNode && r.expression.variable?.kind === SyntaxTokenKind.IDENTIFIER;
|
|
2652
2836
|
}
|
|
@@ -2758,6 +2942,9 @@ var Lexer = class {
|
|
|
2758
2942
|
case "/":
|
|
2759
2943
|
this.match("/") ? this.singleLineComment() : this.match("*") ? this.multilineComment() : this.operator(r);
|
|
2760
2944
|
break;
|
|
2945
|
+
case "*":
|
|
2946
|
+
this.addToken(SyntaxTokenKind.WILDCARD);
|
|
2947
|
+
break;
|
|
2761
2948
|
default:
|
|
2762
2949
|
if (isOp(r)) {
|
|
2763
2950
|
this.operator(r);
|
|
@@ -3422,7 +3609,7 @@ var ParsingContextStack = class {
|
|
|
3422
3609
|
return r;
|
|
3423
3610
|
}
|
|
3424
3611
|
extractOperand() {
|
|
3425
|
-
return this.check(SyntaxTokenKind.NUMERIC_LITERAL, SyntaxTokenKind.STRING_LITERAL, SyntaxTokenKind.COLOR_LITERAL, SyntaxTokenKind.QUOTED_STRING, SyntaxTokenKind.IDENTIFIER) ? this.primaryExpression() : this.check(SyntaxTokenKind.FUNCTION_EXPRESSION) ? this.functionExpression() : this.check(SyntaxTokenKind.LBRACKET) ? this.listExpression() : this.check(SyntaxTokenKind.LBRACE) ? this.blockExpression() : this.check(SyntaxTokenKind.LPAREN) ? this.tupleExpression() : (this.peek().kind === SyntaxTokenKind.EOF ? this.logError(this.peek(), CompileErrorCode.UNEXPECTED_EOF, "Unexpected EOF") : this.logError(this.peek(), CompileErrorCode.INVALID_OPERAND, `Invalid start of operand "${this.peek().value}"`), this.nodeFactory.create(EmptyNode, { prevToken: this.previous() }));
|
|
3612
|
+
return this.check(SyntaxTokenKind.WILDCARD) ? (this.advance(), this.nodeFactory.create(WildcardNode, { token: this.previous() })) : this.check(SyntaxTokenKind.NUMERIC_LITERAL, SyntaxTokenKind.STRING_LITERAL, SyntaxTokenKind.COLOR_LITERAL, SyntaxTokenKind.QUOTED_STRING, SyntaxTokenKind.IDENTIFIER) ? this.primaryExpression() : this.check(SyntaxTokenKind.FUNCTION_EXPRESSION) ? this.functionExpression() : this.check(SyntaxTokenKind.LBRACKET) ? this.listExpression() : this.check(SyntaxTokenKind.LBRACE) ? this.blockExpression() : this.check(SyntaxTokenKind.LPAREN) ? this.tupleExpression() : (this.peek().kind === SyntaxTokenKind.EOF ? this.logError(this.peek(), CompileErrorCode.UNEXPECTED_EOF, "Unexpected EOF") : this.logError(this.peek(), CompileErrorCode.INVALID_OPERAND, `Invalid start of operand "${this.peek().value}"`), this.nodeFactory.create(EmptyNode, { prevToken: this.previous() }));
|
|
3426
3613
|
}
|
|
3427
3614
|
functionExpression() {
|
|
3428
3615
|
let r = {};
|
|
@@ -3483,10 +3670,6 @@ var ParsingContextStack = class {
|
|
|
3483
3670
|
left: 9,
|
|
3484
3671
|
right: 10
|
|
3485
3672
|
},
|
|
3486
|
-
"*": {
|
|
3487
|
-
left: 11,
|
|
3488
|
-
right: 12
|
|
3489
|
-
},
|
|
3490
3673
|
"-": {
|
|
3491
3674
|
left: 9,
|
|
3492
3675
|
right: 10
|
|
@@ -3593,14 +3776,14 @@ var Validator = class {
|
|
|
3593
3776
|
this.ast = r, this.symbolFactory = j, this.publicSchemaSymbol = this.symbolFactory.create(SchemaSymbol, { symbolTable: new SymbolTable() }), this.ast.symbol = this.publicSchemaSymbol, this.ast.symbol.declaration = this.ast;
|
|
3594
3777
|
}
|
|
3595
3778
|
validate() {
|
|
3596
|
-
let r = [];
|
|
3597
|
-
this.ast.body.forEach((
|
|
3598
|
-
if (
|
|
3599
|
-
let
|
|
3600
|
-
r.push(...
|
|
3779
|
+
let r = [], j = [];
|
|
3780
|
+
this.ast.body.forEach((M) => {
|
|
3781
|
+
if (M.parent = this.ast, M.type === void 0) return;
|
|
3782
|
+
let N = new (pickValidator(M))(M, this.publicSchemaSymbol.symbolTable, this.symbolFactory).validate();
|
|
3783
|
+
r.push(...N.errors), j.push(...N.warnings);
|
|
3601
3784
|
});
|
|
3602
|
-
let
|
|
3603
|
-
return
|
|
3785
|
+
let M = this.ast.body.filter((r) => getElementKind(r).unwrap_or(void 0) === ElementKind.Project);
|
|
3786
|
+
return M.length > 1 && M.forEach((j) => r.push(new CompileError(CompileErrorCode.PROJECT_REDEFINED, "Only one project can exist", j))), new Report(this.ast, r, j);
|
|
3604
3787
|
}
|
|
3605
3788
|
}, ChecksBinder = class {
|
|
3606
3789
|
constructor(r, j, M) {
|
|
@@ -3624,6 +3807,88 @@ var Validator = class {
|
|
|
3624
3807
|
bindSubElements(r) {
|
|
3625
3808
|
return r.flatMap((r) => r.type ? new (pickBinder(r))(r, this.ast, this.symbolFactory).bind() : []);
|
|
3626
3809
|
}
|
|
3810
|
+
}, DiagramViewBinder = class {
|
|
3811
|
+
constructor(r, j, M) {
|
|
3812
|
+
this.declarationNode = r, this.ast = j, this.symbolFactory = M;
|
|
3813
|
+
}
|
|
3814
|
+
bind() {
|
|
3815
|
+
return this.declarationNode.body instanceof BlockExpressionNode ? this.bindBody(this.declarationNode.body) : [];
|
|
3816
|
+
}
|
|
3817
|
+
bindBody(r) {
|
|
3818
|
+
let [, j] = partition_default(r.body, (r) => r instanceof FunctionApplicationNode);
|
|
3819
|
+
return this.bindSubElements(j);
|
|
3820
|
+
}
|
|
3821
|
+
bindSubElements(r) {
|
|
3822
|
+
return r.flatMap((r) => {
|
|
3823
|
+
if (!r.type) return [];
|
|
3824
|
+
let j = r.type.value.toLowerCase();
|
|
3825
|
+
if (!(r.body instanceof BlockExpressionNode)) return [];
|
|
3826
|
+
let M = [];
|
|
3827
|
+
switch (j) {
|
|
3828
|
+
case "tables":
|
|
3829
|
+
M.push(...this.bindTableReferences(r.body));
|
|
3830
|
+
break;
|
|
3831
|
+
case "notes":
|
|
3832
|
+
M.push(...this.bindNoteReferences(r.body));
|
|
3833
|
+
break;
|
|
3834
|
+
case "tablegroups":
|
|
3835
|
+
M.push(...this.bindTableGroupReferences(r.body));
|
|
3836
|
+
break;
|
|
3837
|
+
case "schemas":
|
|
3838
|
+
M.push(...this.bindSchemaReferences(r.body));
|
|
3839
|
+
break;
|
|
3840
|
+
default: break;
|
|
3841
|
+
}
|
|
3842
|
+
return M;
|
|
3843
|
+
});
|
|
3844
|
+
}
|
|
3845
|
+
bindTableReferences(r) {
|
|
3846
|
+
let [j] = partition_default(r.body, (r) => r instanceof FunctionApplicationNode);
|
|
3847
|
+
return j.flatMap((r) => !r.callee || isWildcardExpression(r.callee) ? [] : [r.callee, ...r.args].flatMap(scanNonListNodeForBinding).flatMap((r) => {
|
|
3848
|
+
let j = r.variables.pop();
|
|
3849
|
+
if (!j) return [];
|
|
3850
|
+
let M = r.variables;
|
|
3851
|
+
return lookupAndBindInScope(this.ast, [...M.map((r) => ({
|
|
3852
|
+
node: r,
|
|
3853
|
+
kind: SymbolKind.Schema
|
|
3854
|
+
})), {
|
|
3855
|
+
node: j,
|
|
3856
|
+
kind: SymbolKind.Table
|
|
3857
|
+
}]);
|
|
3858
|
+
}));
|
|
3859
|
+
}
|
|
3860
|
+
bindNoteReferences(r) {
|
|
3861
|
+
let [j] = partition_default(r.body, (r) => r instanceof FunctionApplicationNode);
|
|
3862
|
+
return j.flatMap((r) => !r.callee || isWildcardExpression(r.callee) ? [] : scanNonListNodeForBinding(r.callee).flatMap((r) => {
|
|
3863
|
+
let j = r.variables.pop();
|
|
3864
|
+
return j ? lookupAndBindInScope(this.ast, [{
|
|
3865
|
+
node: j,
|
|
3866
|
+
kind: SymbolKind.Note
|
|
3867
|
+
}]) : [];
|
|
3868
|
+
}));
|
|
3869
|
+
}
|
|
3870
|
+
bindTableGroupReferences(r) {
|
|
3871
|
+
let [j] = partition_default(r.body, (r) => r instanceof FunctionApplicationNode);
|
|
3872
|
+
return j.flatMap((r) => !r.callee || isWildcardExpression(r.callee) ? [] : scanNonListNodeForBinding(r.callee).flatMap((r) => {
|
|
3873
|
+
let j = r.variables.pop();
|
|
3874
|
+
if (!j) return [];
|
|
3875
|
+
let M = r.variables;
|
|
3876
|
+
return lookupAndBindInScope(this.ast, [...M.map((r) => ({
|
|
3877
|
+
node: r,
|
|
3878
|
+
kind: SymbolKind.Schema
|
|
3879
|
+
})), {
|
|
3880
|
+
node: j,
|
|
3881
|
+
kind: SymbolKind.TableGroup
|
|
3882
|
+
}]);
|
|
3883
|
+
}));
|
|
3884
|
+
}
|
|
3885
|
+
bindSchemaReferences(r) {
|
|
3886
|
+
let [j] = partition_default(r.body, (r) => r instanceof FunctionApplicationNode);
|
|
3887
|
+
return j.flatMap((r) => !r.callee || isWildcardExpression(r.callee) ? [] : scanNonListNodeForBinding(r.callee).flatMap((r) => lookupAndBindInScope(this.ast, r.variables.map((r) => ({
|
|
3888
|
+
node: r,
|
|
3889
|
+
kind: SymbolKind.Schema
|
|
3890
|
+
})))));
|
|
3891
|
+
}
|
|
3627
3892
|
}, EnumBinder = class {
|
|
3628
3893
|
constructor(r, j, M) {
|
|
3629
3894
|
this.declarationNode = r, this.ast = j, this.symbolFactory = M;
|
|
@@ -3953,7 +4218,9 @@ function generatePossibleIndexes(r) {
|
|
|
3953
4218
|
createEnumFieldSymbolIndex,
|
|
3954
4219
|
createTableGroupFieldSymbolIndex,
|
|
3955
4220
|
createTablePartialSymbolIndex,
|
|
3956
|
-
createPartialInjectionSymbolIndex
|
|
4221
|
+
createPartialInjectionSymbolIndex,
|
|
4222
|
+
createDiagramViewSymbolIndex,
|
|
4223
|
+
createDiagramViewFieldSymbolIndex
|
|
3957
4224
|
].map((j) => j(r));
|
|
3958
4225
|
}
|
|
3959
4226
|
function getSymbolKind(r) {
|
|
@@ -3967,6 +4234,9 @@ function getSymbolKind(r) {
|
|
|
3967
4234
|
if (r instanceof TablePartialSymbol) return SymbolKind.TablePartial;
|
|
3968
4235
|
if (r instanceof TablePartialInjectedColumnSymbol) return SymbolKind.Column;
|
|
3969
4236
|
if (r instanceof PartialInjectionSymbol) return SymbolKind.PartialInjection;
|
|
4237
|
+
if (r instanceof StickyNoteSymbol) return SymbolKind.Note;
|
|
4238
|
+
if (r instanceof DiagramViewSymbol) return SymbolKind.DiagramView;
|
|
4239
|
+
if (r instanceof DiagramViewFieldSymbol) return SymbolKind.DiagramViewField;
|
|
3970
4240
|
throw Error("No other possible symbol kind in getSymbolKind");
|
|
3971
4241
|
}
|
|
3972
4242
|
var RecordsBinder = class {
|
|
@@ -4070,6 +4340,7 @@ function pickBinder(r) {
|
|
|
4070
4340
|
case ElementKind.TablePartial: return TablePartialBinder;
|
|
4071
4341
|
case ElementKind.Check: return ChecksBinder;
|
|
4072
4342
|
case ElementKind.Records: return RecordsBinder;
|
|
4343
|
+
case ElementKind.DiagramView: return DiagramViewBinder;
|
|
4073
4344
|
default: return CustomBinder;
|
|
4074
4345
|
}
|
|
4075
4346
|
}
|
|
@@ -4910,6 +5181,112 @@ var TableInterpreter = class {
|
|
|
4910
5181
|
}
|
|
4911
5182
|
});
|
|
4912
5183
|
}
|
|
5184
|
+
}, DiagramViewInterpreter = class {
|
|
5185
|
+
constructor(r, j) {
|
|
5186
|
+
this.declarationNode = r, this.env = j, this.diagramView = { visibleEntities: {
|
|
5187
|
+
tables: null,
|
|
5188
|
+
stickyNotes: null,
|
|
5189
|
+
tableGroups: null,
|
|
5190
|
+
schemas: null
|
|
5191
|
+
} };
|
|
5192
|
+
}
|
|
5193
|
+
interpret() {
|
|
5194
|
+
let r = [];
|
|
5195
|
+
return this.diagramView.token = getTokenPosition(this.declarationNode), this.env.diagramViews.set(this.declarationNode, this.diagramView), this.env.diagramViewWildcards.set(this.diagramView, /* @__PURE__ */ new Set()), this.env.diagramViewExplicitlySet.set(this.diagramView, /* @__PURE__ */ new Set()), this.declarationNode.name && r.push(...this.interpretName(this.declarationNode.name)), this.declarationNode.body instanceof BlockExpressionNode && r.push(...this.interpretBody(this.declarationNode.body)), r;
|
|
5196
|
+
}
|
|
5197
|
+
interpretName(r) {
|
|
5198
|
+
let j = destructureComplexVariable(r).unwrap_or([]);
|
|
5199
|
+
return j.length > 0 && (this.diagramView.name = j[j.length - 1], j.length > 1 && (this.diagramView.schemaName = j.slice(0, -1).join("."))), [];
|
|
5200
|
+
}
|
|
5201
|
+
interpretBody(r) {
|
|
5202
|
+
if (r.body.length === 1) {
|
|
5203
|
+
let j = r.body[0];
|
|
5204
|
+
if (j instanceof FunctionApplicationNode && isWildcardExpression(j.callee)) return this.diagramView.visibleEntities = {
|
|
5205
|
+
tables: [],
|
|
5206
|
+
stickyNotes: [],
|
|
5207
|
+
tableGroups: [],
|
|
5208
|
+
schemas: []
|
|
5209
|
+
}, this.env.diagramViewWildcards.set(this.diagramView, new Set([
|
|
5210
|
+
"tables",
|
|
5211
|
+
"stickyNotes",
|
|
5212
|
+
"tableGroups",
|
|
5213
|
+
"schemas"
|
|
5214
|
+
])), this.env.diagramViewExplicitlySet.set(this.diagramView, new Set([
|
|
5215
|
+
"tables",
|
|
5216
|
+
"stickyNotes",
|
|
5217
|
+
"tableGroups",
|
|
5218
|
+
"schemas"
|
|
5219
|
+
])), [];
|
|
5220
|
+
}
|
|
5221
|
+
let [j] = partition_default(r.body, (r) => r instanceof ElementDeclarationNode), M = /* @__PURE__ */ new Set();
|
|
5222
|
+
for (let r of j) {
|
|
5223
|
+
let j = r.type?.value.toLowerCase();
|
|
5224
|
+
j && M.add(j), r.body instanceof BlockExpressionNode && this.interpretSubBlock(r.body, j);
|
|
5225
|
+
}
|
|
5226
|
+
let N = this.diagramView.visibleEntities;
|
|
5227
|
+
(M.has("tables") && N.tables !== null || M.has("tablegroups") && N.tableGroups !== null || M.has("schemas") && N.schemas !== null) && (M.has("tables") || (N.tables = []), M.has("tablegroups") || (N.tableGroups = []), M.has("schemas") || (N.schemas = []));
|
|
5228
|
+
let P = this.env.diagramViewExplicitlySet.get(this.diagramView);
|
|
5229
|
+
return M.has("tables") && P.add("tables"), M.has("tablegroups") && P.add("tableGroups"), M.has("schemas") && P.add("schemas"), M.has("notes") && P.add("stickyNotes"), [];
|
|
5230
|
+
}
|
|
5231
|
+
interpretSubBlock(r, j) {
|
|
5232
|
+
if (!j) return;
|
|
5233
|
+
if (r.body.some((r) => r instanceof FunctionApplicationNode && isWildcardExpression(r.callee))) {
|
|
5234
|
+
let r = this.env.diagramViewWildcards.get(this.diagramView);
|
|
5235
|
+
switch (j) {
|
|
5236
|
+
case "tables":
|
|
5237
|
+
this.diagramView.visibleEntities.tables = [], r.add("tables");
|
|
5238
|
+
break;
|
|
5239
|
+
case "notes":
|
|
5240
|
+
this.diagramView.visibleEntities.stickyNotes = [], r.add("stickyNotes");
|
|
5241
|
+
break;
|
|
5242
|
+
case "tablegroups":
|
|
5243
|
+
this.diagramView.visibleEntities.tableGroups = [], r.add("tableGroups");
|
|
5244
|
+
break;
|
|
5245
|
+
case "schemas":
|
|
5246
|
+
this.diagramView.visibleEntities.schemas = [], r.add("schemas");
|
|
5247
|
+
break;
|
|
5248
|
+
}
|
|
5249
|
+
return;
|
|
5250
|
+
}
|
|
5251
|
+
if (r.body.length === 0) return;
|
|
5252
|
+
let M = [];
|
|
5253
|
+
for (let j of r.body) {
|
|
5254
|
+
if (!(j instanceof FunctionApplicationNode)) continue;
|
|
5255
|
+
let r = extractReferee(j.callee);
|
|
5256
|
+
if (r?.declaration instanceof ElementDeclarationNode) {
|
|
5257
|
+
let j = destructureComplexVariable(r.declaration.name).unwrap_or([]);
|
|
5258
|
+
if (j.length > 0) {
|
|
5259
|
+
let r = j[j.length - 1], N = j.length > 1 ? j.slice(0, -1).join(".") : DEFAULT_SCHEMA_NAME;
|
|
5260
|
+
M.push({
|
|
5261
|
+
name: r,
|
|
5262
|
+
schemaName: N
|
|
5263
|
+
});
|
|
5264
|
+
continue;
|
|
5265
|
+
}
|
|
5266
|
+
}
|
|
5267
|
+
let N = destructureComplexVariable(j.callee).unwrap_or([]);
|
|
5268
|
+
if (N.length === 0) continue;
|
|
5269
|
+
let P = N[N.length - 1], F = N.length > 1 ? N[0] : DEFAULT_SCHEMA_NAME;
|
|
5270
|
+
M.push({
|
|
5271
|
+
name: P,
|
|
5272
|
+
schemaName: F
|
|
5273
|
+
});
|
|
5274
|
+
}
|
|
5275
|
+
switch (j) {
|
|
5276
|
+
case "tables":
|
|
5277
|
+
this.diagramView.visibleEntities.tables = M.length > 0 ? M : null;
|
|
5278
|
+
break;
|
|
5279
|
+
case "notes":
|
|
5280
|
+
this.diagramView.visibleEntities.stickyNotes = M.length > 0 ? M.map((r) => ({ name: r.name })) : null;
|
|
5281
|
+
break;
|
|
5282
|
+
case "tablegroups":
|
|
5283
|
+
this.diagramView.visibleEntities.tableGroups = M.length > 0 ? M.map((r) => ({ name: r.name })) : null;
|
|
5284
|
+
break;
|
|
5285
|
+
case "schemas":
|
|
5286
|
+
this.diagramView.visibleEntities.schemas = M.length > 0 ? M.map((r) => ({ name: r.name })) : null;
|
|
5287
|
+
break;
|
|
5288
|
+
}
|
|
5289
|
+
}
|
|
4913
5290
|
}, DIALECT_INTEGER_TYPES = {
|
|
4914
5291
|
mysql: new Set([
|
|
4915
5292
|
"int",
|
|
@@ -9014,6 +9391,12 @@ function processColumnInDb(r) {
|
|
|
9014
9391
|
}))
|
|
9015
9392
|
};
|
|
9016
9393
|
}
|
|
9394
|
+
function expandDiagramViewWildcards(r) {
|
|
9395
|
+
for (let j of r.diagramViews.values()) {
|
|
9396
|
+
let M = j.visibleEntities, N = r.diagramViewWildcards.get(j), P = r.diagramViewExplicitlySet.get(j);
|
|
9397
|
+
!N || !P || N.has("tableGroups") && M.tableGroups && M.tableGroups.length === 0 && (P.has("tables") || P.has("schemas") || (M.tableGroups = Array.from(r.tableGroups.values()).map((r) => ({ name: r.name }))));
|
|
9398
|
+
}
|
|
9399
|
+
}
|
|
9017
9400
|
function convertEnvToDb(r) {
|
|
9018
9401
|
let j = [];
|
|
9019
9402
|
for (let [M, N] of r.records) {
|
|
@@ -9045,7 +9428,8 @@ function convertEnvToDb(r) {
|
|
|
9045
9428
|
aliases: r.aliases,
|
|
9046
9429
|
project: Array.from(r.project.values())[0] || {},
|
|
9047
9430
|
tablePartials: Array.from(r.tablePartials.values()).map(processColumnInDb),
|
|
9048
|
-
records: j
|
|
9431
|
+
records: j,
|
|
9432
|
+
diagramViews: Array.from(r.diagramViews.values())
|
|
9049
9433
|
};
|
|
9050
9434
|
}
|
|
9051
9435
|
var Interpreter = class {
|
|
@@ -9065,7 +9449,10 @@ var Interpreter = class {
|
|
|
9065
9449
|
records: /* @__PURE__ */ new Map(),
|
|
9066
9450
|
recordsElements: [],
|
|
9067
9451
|
cachedMergedTables: /* @__PURE__ */ new Map(),
|
|
9068
|
-
source: r.source
|
|
9452
|
+
source: r.source,
|
|
9453
|
+
diagramViews: /* @__PURE__ */ new Map(),
|
|
9454
|
+
diagramViewWildcards: /* @__PURE__ */ new Map(),
|
|
9455
|
+
diagramViewExplicitlySet: /* @__PURE__ */ new Map()
|
|
9069
9456
|
};
|
|
9070
9457
|
}
|
|
9071
9458
|
interpret() {
|
|
@@ -9078,6 +9465,7 @@ var Interpreter = class {
|
|
|
9078
9465
|
case ElementKind.TablePartial: return new TablePartialInterpreter(r, this.env).interpret();
|
|
9079
9466
|
case ElementKind.Enum: return new EnumInterpreter(r, this.env).interpret();
|
|
9080
9467
|
case ElementKind.Project: return new ProjectInterpreter(r, this.env).interpret();
|
|
9468
|
+
case ElementKind.DiagramView: return new DiagramViewInterpreter(r, this.env).interpret();
|
|
9081
9469
|
case ElementKind.Records: return this.env.recordsElements.push(r), [];
|
|
9082
9470
|
default: return [];
|
|
9083
9471
|
}
|
|
@@ -9086,7 +9474,7 @@ var Interpreter = class {
|
|
|
9086
9474
|
let M = new RecordsInterpreter(this.env).interpret(this.env.recordsElements);
|
|
9087
9475
|
r.push(...M.getErrors()), j.push(...M.getWarnings());
|
|
9088
9476
|
}
|
|
9089
|
-
return new Report(convertEnvToDb(this.env), r, j);
|
|
9477
|
+
return expandDiagramViewWildcards(this.env), new Report(convertEnvToDb(this.env), r, j);
|
|
9090
9478
|
}
|
|
9091
9479
|
};
|
|
9092
9480
|
let CompletionItemKind = /* @__PURE__ */ function(r) {
|
|
@@ -9606,6 +9994,11 @@ function suggestInSubField(r, j, M) {
|
|
|
9606
9994
|
return r.container.token(j).token?.kind === SyntaxTokenKind.COLON && shouldPrependSpace(r.container.token(j).token, j) ? prependSpace(M) : M;
|
|
9607
9995
|
}
|
|
9608
9996
|
case ScopeKind.TABLEGROUP: return suggestInTableGroupField(r);
|
|
9997
|
+
case ScopeKind.DIAGRAMVIEW: return suggestInDiagramViewField();
|
|
9998
|
+
case ScopeKind.CUSTOM: {
|
|
9999
|
+
let M = r.container.element(j);
|
|
10000
|
+
return M instanceof ElementDeclarationNode && M.parent instanceof ElementDeclarationNode && getElementKind(M.parent).unwrap_or(void 0) === ElementKind.DiagramView ? suggestInDiagramViewSubBlock(r, j) : noSuggestions();
|
|
10001
|
+
}
|
|
9609
10002
|
default: return noSuggestions();
|
|
9610
10003
|
}
|
|
9611
10004
|
}
|
|
@@ -9617,7 +10010,8 @@ function suggestTopLevelElementType() {
|
|
|
9617
10010
|
"Project",
|
|
9618
10011
|
"Ref",
|
|
9619
10012
|
"TablePartial",
|
|
9620
|
-
"Records"
|
|
10013
|
+
"Records",
|
|
10014
|
+
"DiagramView"
|
|
9621
10015
|
].map((r) => ({
|
|
9622
10016
|
label: r,
|
|
9623
10017
|
insertText: r,
|
|
@@ -9724,6 +10118,54 @@ function suggestInTableGroupField(r) {
|
|
|
9724
10118
|
range: void 0
|
|
9725
10119
|
}))] };
|
|
9726
10120
|
}
|
|
10121
|
+
function suggestInDiagramViewField() {
|
|
10122
|
+
return { suggestions: [...[
|
|
10123
|
+
"Tables",
|
|
10124
|
+
"TableGroups",
|
|
10125
|
+
"Notes",
|
|
10126
|
+
"Schemas"
|
|
10127
|
+
].map((r) => ({
|
|
10128
|
+
label: r,
|
|
10129
|
+
insertText: r,
|
|
10130
|
+
insertTextRules: CompletionItemInsertTextRule.KeepWhitespace,
|
|
10131
|
+
kind: CompletionItemKind.Keyword,
|
|
10132
|
+
range: void 0
|
|
10133
|
+
})), {
|
|
10134
|
+
label: "*",
|
|
10135
|
+
insertText: "*",
|
|
10136
|
+
insertTextRules: CompletionItemInsertTextRule.KeepWhitespace,
|
|
10137
|
+
kind: CompletionItemKind.Keyword,
|
|
10138
|
+
range: void 0
|
|
10139
|
+
}] };
|
|
10140
|
+
}
|
|
10141
|
+
function suggestInDiagramViewSubBlock(r, j) {
|
|
10142
|
+
let M = r.container.element(j);
|
|
10143
|
+
if (!(M instanceof ElementDeclarationNode)) return noSuggestions();
|
|
10144
|
+
let N = M.type?.value.toLowerCase(), P = {
|
|
10145
|
+
label: "*",
|
|
10146
|
+
insertText: "*",
|
|
10147
|
+
insertTextRules: CompletionItemInsertTextRule.KeepWhitespace,
|
|
10148
|
+
kind: CompletionItemKind.Keyword,
|
|
10149
|
+
range: void 0
|
|
10150
|
+
};
|
|
10151
|
+
switch (N) {
|
|
10152
|
+
case "tables": return { suggestions: [P, ...suggestNamesInScope(r, j, r.parse.ast(), [SymbolKind.Table, SymbolKind.Schema]).suggestions] };
|
|
10153
|
+
case "tablegroups": return { suggestions: [P, ...suggestNamesInScope(r, j, r.parse.ast(), [SymbolKind.TableGroup]).suggestions] };
|
|
10154
|
+
case "schemas": return { suggestions: [
|
|
10155
|
+
P,
|
|
10156
|
+
{
|
|
10157
|
+
label: DEFAULT_SCHEMA_NAME,
|
|
10158
|
+
insertText: DEFAULT_SCHEMA_NAME,
|
|
10159
|
+
insertTextRules: CompletionItemInsertTextRule.KeepWhitespace,
|
|
10160
|
+
kind: CompletionItemKind.Module,
|
|
10161
|
+
range: void 0
|
|
10162
|
+
},
|
|
10163
|
+
...suggestNamesInScope(r, j, r.parse.ast(), [SymbolKind.Schema]).suggestions
|
|
10164
|
+
] };
|
|
10165
|
+
case "notes": return { suggestions: [P, ...suggestNamesInScope(r, j, r.parse.ast(), [SymbolKind.Note]).suggestions] };
|
|
10166
|
+
default: return noSuggestions();
|
|
10167
|
+
}
|
|
10168
|
+
}
|
|
9727
10169
|
function suggestInIndex(r, j) {
|
|
9728
10170
|
return suggestColumnNameInIndexes(r, j);
|
|
9729
10171
|
}
|
|
@@ -9854,6 +10296,200 @@ var DBMLDefinitionProvider = class {
|
|
|
9854
10296
|
getSeverityValue(r) {
|
|
9855
10297
|
return r === "error" ? MarkerSeverity.Error : MarkerSeverity.Warning;
|
|
9856
10298
|
}
|
|
10299
|
+
}, dbmlMonarchTokensProvider = {
|
|
10300
|
+
tokenPostfix: ".dbml",
|
|
10301
|
+
brackets: [
|
|
10302
|
+
{
|
|
10303
|
+
open: "[",
|
|
10304
|
+
close: "]",
|
|
10305
|
+
token: "delimiter.square"
|
|
10306
|
+
},
|
|
10307
|
+
{
|
|
10308
|
+
open: "(",
|
|
10309
|
+
close: ")",
|
|
10310
|
+
token: "delimiter.parenthesis"
|
|
10311
|
+
},
|
|
10312
|
+
{
|
|
10313
|
+
open: "{",
|
|
10314
|
+
close: "}",
|
|
10315
|
+
token: "delimiter.curly"
|
|
10316
|
+
}
|
|
10317
|
+
],
|
|
10318
|
+
decls: [
|
|
10319
|
+
"project",
|
|
10320
|
+
"tablegroup",
|
|
10321
|
+
"table",
|
|
10322
|
+
"enum",
|
|
10323
|
+
"ref",
|
|
10324
|
+
"note",
|
|
10325
|
+
"tablepartial",
|
|
10326
|
+
"records",
|
|
10327
|
+
"checks",
|
|
10328
|
+
"diagramview"
|
|
10329
|
+
],
|
|
10330
|
+
dataTypes: /* @__PURE__ */ "TINYINT.SMALLINT.MEDIUMINT.INT.INTEGER.BIGINT.FLOAT.DOUBLE.DECIMAL.DEC.BIT.BOOL.REAL.MONEY.BINARY_FLOAT.BINARY_DOUBLE.smallmoney.ENUM.CHAR.BINARY.VARCHAR.VARBINARY.TINYBLOB.TINYTEXT.BLOB.TEXT.MEDIUMBLOB.MEDIUMTEXT.LONGBLOB.LONGTEXT.SET.INET6.UUID.NVARCHAR.NCHAR.NTEXT.IMAGE.VARCHAR2.NVARCHAR2.DATE.TIME.DATETIME.DATETIME2.TIMESTAMP.YEAR.smalldatetime.datetimeoffset.XML.sql_variant.uniqueidentifier.CURSOR.BFILE.CLOB.NCLOB.RAW".split("."),
|
|
10331
|
+
settings: [
|
|
10332
|
+
"indexes",
|
|
10333
|
+
"ref",
|
|
10334
|
+
"note",
|
|
10335
|
+
"headercolor",
|
|
10336
|
+
"pk",
|
|
10337
|
+
"null",
|
|
10338
|
+
"increment",
|
|
10339
|
+
"unique",
|
|
10340
|
+
"default",
|
|
10341
|
+
"note",
|
|
10342
|
+
"primary",
|
|
10343
|
+
"key",
|
|
10344
|
+
"name",
|
|
10345
|
+
"as",
|
|
10346
|
+
"color",
|
|
10347
|
+
"check",
|
|
10348
|
+
"tables",
|
|
10349
|
+
"tablegroups",
|
|
10350
|
+
"notes",
|
|
10351
|
+
"schemas"
|
|
10352
|
+
],
|
|
10353
|
+
symbols: /[=><!~?:&|+\-\/\^%]+/,
|
|
10354
|
+
escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
|
|
10355
|
+
newline: /[\r\n]/,
|
|
10356
|
+
digits: /\d+(_+\d+)*/,
|
|
10357
|
+
idtf: /[\p{L}0-9_]+/u,
|
|
10358
|
+
ignoreCase: !0,
|
|
10359
|
+
unicode: !0,
|
|
10360
|
+
tokenizer: {
|
|
10361
|
+
root: [
|
|
10362
|
+
[/[{}\[\]\(\)]/, "@bracket"],
|
|
10363
|
+
[/[,.:]/, "delimiter"],
|
|
10364
|
+
{ include: "@numbers" },
|
|
10365
|
+
{ include: "common" }
|
|
10366
|
+
],
|
|
10367
|
+
common: [
|
|
10368
|
+
{ include: "@whitespace" },
|
|
10369
|
+
[/[<>-]/, "operators"],
|
|
10370
|
+
[/\*/, "keyword.wildcard"],
|
|
10371
|
+
[/("[^"\\]*(?:\\.[^"\\]*)*")(\s+)(@idtf(?:\.@idtf*)*)/, [
|
|
10372
|
+
"string",
|
|
10373
|
+
"",
|
|
10374
|
+
"keyword"
|
|
10375
|
+
]],
|
|
10376
|
+
[/"([^"\\]|\\.)*$/, ""],
|
|
10377
|
+
[/'([^'\\]|\\.)*$/, ""],
|
|
10378
|
+
[
|
|
10379
|
+
/"/,
|
|
10380
|
+
"string",
|
|
10381
|
+
"@string_double"
|
|
10382
|
+
],
|
|
10383
|
+
[
|
|
10384
|
+
/'/,
|
|
10385
|
+
"string",
|
|
10386
|
+
"@string_single"
|
|
10387
|
+
],
|
|
10388
|
+
[
|
|
10389
|
+
/`/,
|
|
10390
|
+
"string",
|
|
10391
|
+
"@string_backtick"
|
|
10392
|
+
],
|
|
10393
|
+
[/(@idtf)(\s+)(@idtf(?:\.@idtf)*)/, { cases: {
|
|
10394
|
+
"$1@decls": [
|
|
10395
|
+
"keyword",
|
|
10396
|
+
"",
|
|
10397
|
+
"identifier"
|
|
10398
|
+
],
|
|
10399
|
+
"$1==not": { cases: {
|
|
10400
|
+
"$3==null": [
|
|
10401
|
+
"keyword",
|
|
10402
|
+
"",
|
|
10403
|
+
"keyword"
|
|
10404
|
+
],
|
|
10405
|
+
"@default": [
|
|
10406
|
+
"identifier",
|
|
10407
|
+
"",
|
|
10408
|
+
"identifier"
|
|
10409
|
+
]
|
|
10410
|
+
} },
|
|
10411
|
+
"@default": [
|
|
10412
|
+
"identifier",
|
|
10413
|
+
"",
|
|
10414
|
+
"keyword"
|
|
10415
|
+
]
|
|
10416
|
+
} }],
|
|
10417
|
+
[/@idtf/, { cases: {
|
|
10418
|
+
"@dataTypes": "keyword",
|
|
10419
|
+
"@decls": "keyword",
|
|
10420
|
+
"@settings": "keyword",
|
|
10421
|
+
"@default": "identifier"
|
|
10422
|
+
} }]
|
|
10423
|
+
],
|
|
10424
|
+
numbers: [
|
|
10425
|
+
[/0[xX][0-9a-fA-F]*/, "number"],
|
|
10426
|
+
[/[$][+-]*\d*(\.\d*)?/, "number"],
|
|
10427
|
+
[/((\d+(\.\d*)?)|(\.\d+))([eE][\-+]?\d+)?/, "number"],
|
|
10428
|
+
[/#([0-9A-F]{3}){1,2}/, "number.hex"]
|
|
10429
|
+
],
|
|
10430
|
+
string_double: [
|
|
10431
|
+
[/[^\\"]+/, "string"],
|
|
10432
|
+
[/@escapes/, "string.escape"],
|
|
10433
|
+
[/\\./, "string.escape.invalid"],
|
|
10434
|
+
[
|
|
10435
|
+
/"/,
|
|
10436
|
+
"string",
|
|
10437
|
+
"@pop"
|
|
10438
|
+
]
|
|
10439
|
+
],
|
|
10440
|
+
string_single: [
|
|
10441
|
+
[/[^\\']+/, "string"],
|
|
10442
|
+
[/@escapes/, "string.escape"],
|
|
10443
|
+
[/\\./, "string.escape.invalid"],
|
|
10444
|
+
[
|
|
10445
|
+
/'/,
|
|
10446
|
+
"string",
|
|
10447
|
+
"@pop"
|
|
10448
|
+
]
|
|
10449
|
+
],
|
|
10450
|
+
string_backtick: [
|
|
10451
|
+
[/[^\\`$]+/, "string"],
|
|
10452
|
+
[/@escapes/, "string.escape"],
|
|
10453
|
+
[
|
|
10454
|
+
/`/,
|
|
10455
|
+
"string",
|
|
10456
|
+
"@pop"
|
|
10457
|
+
]
|
|
10458
|
+
],
|
|
10459
|
+
endTripleQuotesString: [
|
|
10460
|
+
[/\\'/, "string"],
|
|
10461
|
+
[
|
|
10462
|
+
/(.*[^\\])?(\\\\)*'''/,
|
|
10463
|
+
"string",
|
|
10464
|
+
"@popall"
|
|
10465
|
+
],
|
|
10466
|
+
[/.*$/, "string"]
|
|
10467
|
+
],
|
|
10468
|
+
whitespace: [
|
|
10469
|
+
[/[ \t\r\n]+/, ""],
|
|
10470
|
+
[
|
|
10471
|
+
/\/\*/,
|
|
10472
|
+
"comment",
|
|
10473
|
+
"@comment"
|
|
10474
|
+
],
|
|
10475
|
+
[/\/\/.*$/, "comment"],
|
|
10476
|
+
[/'''(.*[^\\])?(\\\\)*'''/, "string"],
|
|
10477
|
+
[
|
|
10478
|
+
/'''.*$/,
|
|
10479
|
+
"string",
|
|
10480
|
+
"@endTripleQuotesString"
|
|
10481
|
+
]
|
|
10482
|
+
],
|
|
10483
|
+
comment: [
|
|
10484
|
+
[/[^\/*]+/, "comment"],
|
|
10485
|
+
[
|
|
10486
|
+
/\*\//,
|
|
10487
|
+
"comment",
|
|
10488
|
+
"@pop"
|
|
10489
|
+
],
|
|
10490
|
+
[/[\/*]/, "comment"]
|
|
10491
|
+
]
|
|
10492
|
+
}
|
|
9857
10493
|
}, services_exports = /* @__PURE__ */ __export({
|
|
9858
10494
|
CompletionItemInsertTextRule: () => CompletionItemInsertTextRule,
|
|
9859
10495
|
CompletionItemKind: () => CompletionItemKind,
|
|
@@ -9861,7 +10497,8 @@ var DBMLDefinitionProvider = class {
|
|
|
9861
10497
|
DBMLDefinitionProvider: () => DBMLDefinitionProvider,
|
|
9862
10498
|
DBMLDiagnosticsProvider: () => DBMLDiagnosticsProvider,
|
|
9863
10499
|
DBMLReferencesProvider: () => DBMLReferencesProvider,
|
|
9864
|
-
MarkerSeverity: () => MarkerSeverity
|
|
10500
|
+
MarkerSeverity: () => MarkerSeverity,
|
|
10501
|
+
dbmlMonarchTokensProvider: () => dbmlMonarchTokensProvider
|
|
9865
10502
|
}, 1);
|
|
9866
10503
|
function ast() {
|
|
9867
10504
|
return this.parse._().getValue().ast;
|
|
@@ -9960,7 +10597,7 @@ function containerScope(r) {
|
|
|
9960
10597
|
return this.container.element(r)?.symbol?.symbolTable;
|
|
9961
10598
|
}
|
|
9962
10599
|
let ScopeKind = /* @__PURE__ */ function(r) {
|
|
9963
|
-
return r[r.TABLE = 0] = "TABLE", r[r.ENUM = 1] = "ENUM", r[r.TABLEGROUP = 2] = "TABLEGROUP", r[r.INDEXES = 3] = "INDEXES", r[r.NOTE = 4] = "NOTE", r[r.REF = 5] = "REF", r[r.PROJECT = 6] = "PROJECT", r[r.CUSTOM = 7] = "CUSTOM", r[r.TOPLEVEL = 8] = "TOPLEVEL", r[r.TABLEPARTIAL = 9] = "TABLEPARTIAL", r[r.CHECKS = 10] = "CHECKS", r[r.RECORDS = 11] = "RECORDS", r;
|
|
10600
|
+
return r[r.TABLE = 0] = "TABLE", r[r.ENUM = 1] = "ENUM", r[r.TABLEGROUP = 2] = "TABLEGROUP", r[r.INDEXES = 3] = "INDEXES", r[r.NOTE = 4] = "NOTE", r[r.REF = 5] = "REF", r[r.PROJECT = 6] = "PROJECT", r[r.CUSTOM = 7] = "CUSTOM", r[r.TOPLEVEL = 8] = "TOPLEVEL", r[r.TABLEPARTIAL = 9] = "TABLEPARTIAL", r[r.CHECKS = 10] = "CHECKS", r[r.RECORDS = 11] = "RECORDS", r[r.DIAGRAMVIEW = 12] = "DIAGRAMVIEW", r;
|
|
9964
10601
|
}({});
|
|
9965
10602
|
function containerScopeKind(r) {
|
|
9966
10603
|
let j = this.container.element(r);
|
|
@@ -9976,13 +10613,14 @@ function containerScopeKind(r) {
|
|
|
9976
10613
|
case "tablepartial": return ScopeKind.TABLEPARTIAL;
|
|
9977
10614
|
case "checks": return ScopeKind.CHECKS;
|
|
9978
10615
|
case "records": return ScopeKind.RECORDS;
|
|
10616
|
+
case "diagramview": return ScopeKind.DIAGRAMVIEW;
|
|
9979
10617
|
default: return ScopeKind.CUSTOM;
|
|
9980
10618
|
}
|
|
9981
10619
|
}
|
|
9982
|
-
function applyTextEdits(r, j) {
|
|
9983
|
-
let
|
|
9984
|
-
for (let { start: r, end: j, newText:
|
|
9985
|
-
return
|
|
10620
|
+
function applyTextEdits(r, j, M = !1) {
|
|
10621
|
+
let N = M ? j : [...j].sort((r, j) => j.start - r.start), P = r;
|
|
10622
|
+
for (let { start: r, end: j, newText: M } of N) P = P.substring(0, r) + M + P.substring(j);
|
|
10623
|
+
return P;
|
|
9986
10624
|
}
|
|
9987
10625
|
function normalizeTableName(r) {
|
|
9988
10626
|
if (typeof r != "string") return {
|
|
@@ -10102,6 +10740,97 @@ function renameTable(r, j) {
|
|
|
10102
10740
|
for (let r of B.references) M.substring(r.start, r.end).replace(/"/g, "") === L && H.push(r);
|
|
10103
10741
|
return applyTextEdits(M, findReplacements(H, I, V, M));
|
|
10104
10742
|
}
|
|
10743
|
+
function findDiagramViewBlocks(r) {
|
|
10744
|
+
let j = [], M = new Lexer(r).lex();
|
|
10745
|
+
if (M.getErrors().length > 0) return j;
|
|
10746
|
+
let N = new Parser(r, M.getValue(), new SyntaxNodeIdGenerator()).parse();
|
|
10747
|
+
if (N.getErrors().length > 0) return j;
|
|
10748
|
+
let P = N.getValue().ast;
|
|
10749
|
+
for (let r of P.body) if (r.type?.value === "DiagramView") {
|
|
10750
|
+
let M = r.name ? destructureComplexVariable(r.name).unwrap_or([]) : [], N = M.length > 0 ? M[M.length - 1] : "";
|
|
10751
|
+
j.push({
|
|
10752
|
+
name: N,
|
|
10753
|
+
startIndex: r.start,
|
|
10754
|
+
endIndex: r.end
|
|
10755
|
+
});
|
|
10756
|
+
}
|
|
10757
|
+
return j;
|
|
10758
|
+
}
|
|
10759
|
+
function needsQuoting(r) {
|
|
10760
|
+
return !/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(r);
|
|
10761
|
+
}
|
|
10762
|
+
function quoteName(r) {
|
|
10763
|
+
return needsQuoting(r) ? `"${r.replace(/\\/g, "\\\\").replace(/"/g, "\\\"")}"` : r;
|
|
10764
|
+
}
|
|
10765
|
+
function generateDiagramViewBlock(r, j) {
|
|
10766
|
+
let M = [`DiagramView ${quoteName(r)} {`];
|
|
10767
|
+
if (j?.tables !== void 0 && j.tables !== null) if (j.tables.length === 0) M.push(" Tables { * }");
|
|
10768
|
+
else {
|
|
10769
|
+
let r = j.tables.map((r) => r.schemaName === "public" ? r.name : `${r.schemaName}.${r.name}`);
|
|
10770
|
+
M.push(" Tables {"), r.forEach((r) => M.push(` ${r}`)), M.push(" }");
|
|
10771
|
+
}
|
|
10772
|
+
return j?.stickyNotes !== void 0 && (j.stickyNotes === null || (j.stickyNotes.length === 0 ? M.push(" Notes { * }") : (M.push(" Notes {"), j.stickyNotes.forEach((r) => M.push(` ${r.name}`)), M.push(" }")))), j?.tableGroups !== void 0 && (j.tableGroups === null || (j.tableGroups.length === 0 ? M.push(" TableGroups { * }") : (M.push(" TableGroups {"), j.tableGroups.forEach((r) => M.push(` ${r.name}`)), M.push(" }")))), j?.schemas !== void 0 && (j.schemas === null || (j.schemas.length === 0 ? M.push(" Schemas { * }") : (M.push(" Schemas {"), j.schemas.forEach((r) => M.push(` ${r.name}`)), M.push(" }")))), M.push("}"), M.join("\n");
|
|
10773
|
+
}
|
|
10774
|
+
function syncDiagramView(r, j, M) {
|
|
10775
|
+
let N = M ?? findDiagramViewBlocks(r), P = [];
|
|
10776
|
+
for (let M of j) {
|
|
10777
|
+
let j = applyOperation(r, M, N);
|
|
10778
|
+
P.push(...j);
|
|
10779
|
+
}
|
|
10780
|
+
return P.sort((r, j) => j.start - r.start), {
|
|
10781
|
+
newDbml: applyTextEdits(r, P, !0),
|
|
10782
|
+
edits: P
|
|
10783
|
+
};
|
|
10784
|
+
}
|
|
10785
|
+
function applyOperation(r, j, M) {
|
|
10786
|
+
switch (j.operation) {
|
|
10787
|
+
case "create": return computeCreateEdit(r, j, M);
|
|
10788
|
+
case "update": return computeUpdateEdit(r, j, M);
|
|
10789
|
+
case "delete": return computeDeleteEdit(r, j, M);
|
|
10790
|
+
default: return [];
|
|
10791
|
+
}
|
|
10792
|
+
}
|
|
10793
|
+
function computeCreateEdit(r, j, M) {
|
|
10794
|
+
if (M.find((r) => r.name === j.name)) return computeUpdateEdit(r, j, M);
|
|
10795
|
+
let N = "\n\n" + generateDiagramViewBlock(j.name, j.visibleEntities) + "\n";
|
|
10796
|
+
return [{
|
|
10797
|
+
start: r.length,
|
|
10798
|
+
end: r.length,
|
|
10799
|
+
newText: N
|
|
10800
|
+
}];
|
|
10801
|
+
}
|
|
10802
|
+
function computeUpdateEdit(r, j, M) {
|
|
10803
|
+
let N = M.find((r) => r.name === j.name);
|
|
10804
|
+
if (!N) return [];
|
|
10805
|
+
let P = [];
|
|
10806
|
+
if (j.newName || j.visibleEntities) {
|
|
10807
|
+
let r = generateDiagramViewBlock(j.newName || j.name, j.visibleEntities);
|
|
10808
|
+
P.push({
|
|
10809
|
+
start: N.startIndex,
|
|
10810
|
+
end: N.endIndex,
|
|
10811
|
+
newText: r
|
|
10812
|
+
});
|
|
10813
|
+
}
|
|
10814
|
+
return P;
|
|
10815
|
+
}
|
|
10816
|
+
function computeDeleteEdit(r, j, M) {
|
|
10817
|
+
let N = M.find((r) => r.name === j.name);
|
|
10818
|
+
if (!N) return [];
|
|
10819
|
+
let P = N.startIndex, F = N.endIndex;
|
|
10820
|
+
for (; P > 0 && r[P - 1] === "\n";) {
|
|
10821
|
+
P--, P > 0 && r[P - 1] === "\r" && P--;
|
|
10822
|
+
let j = r.lastIndexOf("\n", P - 1) + 1;
|
|
10823
|
+
if (r.substring(j, P).trim() !== "") {
|
|
10824
|
+
P = N.startIndex, P > 0 && r[P - 1] === "\n" && (P--, P > 0 && r[P - 1] === "\r" && P--);
|
|
10825
|
+
break;
|
|
10826
|
+
}
|
|
10827
|
+
}
|
|
10828
|
+
return F < r.length && r[F] === "\r" && F++, F < r.length && r[F] === "\n" && F++, [{
|
|
10829
|
+
start: P,
|
|
10830
|
+
end: F,
|
|
10831
|
+
newText: ""
|
|
10832
|
+
}];
|
|
10833
|
+
}
|
|
10105
10834
|
var Compiler = class {
|
|
10106
10835
|
constructor() {
|
|
10107
10836
|
this.source = "", this.cache = /* @__PURE__ */ new Map(), this.nodeIdGenerator = new SyntaxNodeIdGenerator(), this.symbolIdGenerator = new NodeSymbolIdGenerator(), this.token = {
|
|
@@ -10158,6 +10887,12 @@ var Compiler = class {
|
|
|
10158
10887
|
renameTable(r, j) {
|
|
10159
10888
|
return renameTable.call(this, r, j);
|
|
10160
10889
|
}
|
|
10890
|
+
syncDiagramView(r, j) {
|
|
10891
|
+
return syncDiagramView(this.parse.source(), r, j);
|
|
10892
|
+
}
|
|
10893
|
+
findDiagramViewBlocks() {
|
|
10894
|
+
return findDiagramViewBlocks(this.parse.source());
|
|
10895
|
+
}
|
|
10161
10896
|
applyTextEdits(r) {
|
|
10162
10897
|
return applyTextEdits(this.parse.source(), r);
|
|
10163
10898
|
}
|
|
@@ -10170,4 +10905,4 @@ var Compiler = class {
|
|
|
10170
10905
|
};
|
|
10171
10906
|
}
|
|
10172
10907
|
};
|
|
10173
|
-
export { CompileError, CompileErrorCode, Compiler, ElementDeclarationNode, ElementKind, FALSY_VALUES, ProgramNode, ScopeKind, SyntaxNode, SyntaxNodeKind, SyntaxToken, SyntaxTokenKind, TRUTHY_VALUES, addDoubleQuoteIfNeeded, escapeString, extractNumericLiteral, extractSignedNumber, formatRecordValue, getLengthTypeParam, getNumericTypeParams, getRecordValueType, isBinaryType, isBooleanType, isDateTimeType, isEmptyStringLiteral, isFloatType, isFunctionExpression, isIntegerType, isNullish, isNumericType, isSerialType, isStringType, isValidIdentifier, normalizeTypeName, services_exports as services, splitQualifiedIdentifier, tryExtractBoolean, tryExtractDateTime, tryExtractEnum, tryExtractInteger, tryExtractNumeric, tryExtractString, unescapeString, validateForeignKeys, validatePrimaryKey, validateUnique };
|
|
10908
|
+
export { CompileError, CompileErrorCode, Compiler, ElementDeclarationNode, ElementKind, FALSY_VALUES, ProgramNode, ScopeKind, SyntaxNode, SyntaxNodeKind, SyntaxToken, SyntaxTokenKind, TRUTHY_VALUES, addDoubleQuoteIfNeeded, dbmlMonarchTokensProvider, escapeString, extractNumericLiteral, extractSignedNumber, formatRecordValue, getLengthTypeParam, getNumericTypeParams, getRecordValueType, isBinaryType, isBooleanType, isDateTimeType, isEmptyStringLiteral, isFloatType, isFunctionExpression, isIntegerType, isNullish, isNumericType, isSerialType, isStringType, isValidIdentifier, normalizeTypeName, services_exports as services, splitQualifiedIdentifier, tryExtractBoolean, tryExtractDateTime, tryExtractEnum, tryExtractInteger, tryExtractNumeric, tryExtractString, unescapeString, validateForeignKeys, validatePrimaryKey, validateUnique };
|