@lionweb/validation 0.6.1-beta.0 → 0.6.1-beta.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.
Files changed (160) hide show
  1. package/dist/diff/LionWebJsonDiff.d.ts.map +1 -1
  2. package/dist/diff/LionWebJsonDiff.js +18 -23
  3. package/dist/diff/LionWebJsonDiff.js.map +1 -1
  4. package/dist/diff/changes/ContainmentChange.d.ts +2 -2
  5. package/dist/diff/changes/ContainmentChange.d.ts.map +1 -1
  6. package/dist/diff/changes/ContainmentChange.js.map +1 -1
  7. package/dist/diff/changes/ReferenceChange.d.ts +3 -3
  8. package/dist/diff/changes/ReferenceChange.d.ts.map +1 -1
  9. package/dist/diff/changes/ReferenceChange.js.map +1 -1
  10. package/dist/index.d.ts +2 -0
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +2 -0
  13. package/dist/index.js.map +1 -1
  14. package/dist/issues/LanguageIssues.d.ts +37 -13
  15. package/dist/issues/LanguageIssues.d.ts.map +1 -1
  16. package/dist/issues/LanguageIssues.js +49 -13
  17. package/dist/issues/LanguageIssues.js.map +1 -1
  18. package/dist/issues/ReferenceIssues.d.ts +6 -6
  19. package/dist/issues/ReferenceIssues.d.ts.map +1 -1
  20. package/dist/issues/ReferenceIssues.js +6 -6
  21. package/dist/issues/ReferenceIssues.js.map +1 -1
  22. package/dist/issues/SyntaxIssues.d.ts +9 -9
  23. package/dist/issues/SyntaxIssues.d.ts.map +1 -1
  24. package/dist/issues/SyntaxIssues.js +9 -9
  25. package/dist/issues/SyntaxIssues.js.map +1 -1
  26. package/dist/issues/ValidationIssue.d.ts +7 -1
  27. package/dist/issues/ValidationIssue.d.ts.map +1 -1
  28. package/dist/issues/ValidationIssue.js +9 -1
  29. package/dist/issues/ValidationIssue.js.map +1 -1
  30. package/dist/json/LionWebJson.d.ts +1 -14
  31. package/dist/json/LionWebJson.d.ts.map +1 -1
  32. package/dist/json/LionWebJson.js +4 -14
  33. package/dist/json/LionWebJson.js.map +1 -1
  34. package/dist/json/LionWebJsonChunkWrapper.d.ts +20 -8
  35. package/dist/json/LionWebJsonChunkWrapper.d.ts.map +1 -1
  36. package/dist/json/LionWebJsonChunkWrapper.js +50 -22
  37. package/dist/json/LionWebJsonChunkWrapper.js.map +1 -1
  38. package/dist/json/M3definitions.d.ts +176 -0
  39. package/dist/json/M3definitions.d.ts.map +1 -0
  40. package/dist/json/M3definitions.js +174 -0
  41. package/dist/json/M3definitions.js.map +1 -0
  42. package/dist/json/NodeUtils.d.ts +3 -9
  43. package/dist/json/NodeUtils.d.ts.map +1 -1
  44. package/dist/json/NodeUtils.js +18 -31
  45. package/dist/json/NodeUtils.js.map +1 -1
  46. package/dist/json/index.d.ts +1 -2
  47. package/dist/json/index.d.ts.map +1 -1
  48. package/dist/json/index.js +1 -2
  49. package/dist/json/index.js.map +1 -1
  50. package/dist/languages/CompositeLionWebLanguageWrapper.d.ts +24 -0
  51. package/dist/languages/CompositeLionWebLanguageWrapper.d.ts.map +1 -0
  52. package/dist/languages/CompositeLionWebLanguageWrapper.js +56 -0
  53. package/dist/languages/CompositeLionWebLanguageWrapper.js.map +1 -0
  54. package/dist/languages/LanguageRegistry.d.ts +19 -0
  55. package/dist/languages/LanguageRegistry.d.ts.map +1 -0
  56. package/dist/languages/LanguageRegistry.js +37 -0
  57. package/dist/languages/LanguageRegistry.js.map +1 -0
  58. package/dist/languages/LanguageUtils.d.ts +35 -0
  59. package/dist/languages/LanguageUtils.d.ts.map +1 -0
  60. package/dist/languages/LanguageUtils.js +52 -0
  61. package/dist/languages/LanguageUtils.js.map +1 -0
  62. package/dist/languages/LionCore-M3.json +2356 -0
  63. package/{src/json/std-builtins-copy.json → dist/languages/LionCore-builtins.json} +57 -52
  64. package/dist/languages/LionWebLanguageWrapper.d.ts +31 -0
  65. package/dist/languages/LionWebLanguageWrapper.d.ts.map +1 -0
  66. package/dist/languages/LionWebLanguageWrapper.js +69 -0
  67. package/dist/languages/LionWebLanguageWrapper.js.map +1 -0
  68. package/dist/languages/MetaPointerMap.d.ts +11 -0
  69. package/dist/languages/MetaPointerMap.d.ts.map +1 -0
  70. package/dist/languages/MetaPointerMap.js +39 -0
  71. package/dist/languages/MetaPointerMap.js.map +1 -0
  72. package/dist/languages/index.d.ts +3 -0
  73. package/dist/languages/index.d.ts.map +1 -0
  74. package/dist/languages/index.js +3 -0
  75. package/dist/languages/index.js.map +1 -0
  76. package/dist/runners/FileUtils.d.ts +4 -4
  77. package/dist/runners/FileUtils.d.ts.map +1 -1
  78. package/dist/runners/FileUtils.js +8 -32
  79. package/dist/runners/FileUtils.js.map +1 -1
  80. package/dist/runners/RunCheckFolder.js +3 -1
  81. package/dist/runners/RunCheckFolder.js.map +1 -1
  82. package/dist/runners/RunCheckFolderWithLanguage.js +7 -3
  83. package/dist/runners/RunCheckFolderWithLanguage.js.map +1 -1
  84. package/dist/runners/RunCheckOneFile.js +3 -1
  85. package/dist/runners/RunCheckOneFile.js.map +1 -1
  86. package/dist/runners/RunCheckOneFileWithLanguage.js +12 -3
  87. package/dist/runners/RunCheckOneFileWithLanguage.js.map +1 -1
  88. package/dist/runners/Utils.d.ts.map +1 -1
  89. package/dist/runners/Utils.js +0 -1
  90. package/dist/runners/Utils.js.map +1 -1
  91. package/dist/util/graphs.d.ts +18 -0
  92. package/dist/util/graphs.d.ts.map +1 -0
  93. package/dist/util/graphs.js +27 -0
  94. package/dist/util/graphs.js.map +1 -0
  95. package/dist/validators/LionWebLanguageReferenceValidator.d.ts +5 -4
  96. package/dist/validators/LionWebLanguageReferenceValidator.d.ts.map +1 -1
  97. package/dist/validators/LionWebLanguageReferenceValidator.js +96 -34
  98. package/dist/validators/LionWebLanguageReferenceValidator.js.map +1 -1
  99. package/dist/validators/LionWebLanguageValidator.d.ts +15 -3
  100. package/dist/validators/LionWebLanguageValidator.d.ts.map +1 -1
  101. package/dist/validators/LionWebLanguageValidator.js +54 -21
  102. package/dist/validators/LionWebLanguageValidator.js.map +1 -1
  103. package/dist/validators/LionWebReferenceValidator.d.ts.map +1 -1
  104. package/dist/validators/LionWebReferenceValidator.js +0 -5
  105. package/dist/validators/LionWebReferenceValidator.js.map +1 -1
  106. package/dist/validators/LionWebSyntaxValidator.d.ts +1 -1
  107. package/dist/validators/LionWebSyntaxValidator.js +1 -1
  108. package/dist/validators/LionWebValidator.d.ts +3 -3
  109. package/dist/validators/LionWebValidator.d.ts.map +1 -1
  110. package/dist/validators/LionWebValidator.js +5 -8
  111. package/dist/validators/LionWebValidator.js.map +1 -1
  112. package/package.json +5 -5
  113. package/src/diff/LionWebJsonDiff.ts +18 -23
  114. package/src/diff/changes/ContainmentChange.ts +1 -1
  115. package/src/diff/changes/ReferenceChange.ts +2 -2
  116. package/src/index.ts +2 -0
  117. package/src/issues/LanguageIssues.ts +49 -14
  118. package/src/issues/ReferenceIssues.ts +6 -6
  119. package/src/issues/SyntaxIssues.ts +9 -9
  120. package/src/issues/ValidationIssue.ts +12 -2
  121. package/src/json/LionCore_M3.json +2320 -0
  122. package/src/json/LionCore_builtins.json +231 -0
  123. package/src/json/LionWebJson.ts +5 -14
  124. package/src/json/LionWebJsonChunkWrapper.ts +59 -30
  125. package/src/json/M3definitions.ts +177 -0
  126. package/src/json/NodeUtils.ts +21 -39
  127. package/src/json/index.ts +1 -2
  128. package/src/languages/CompositeLionWebLanguageWrapper.ts +57 -0
  129. package/src/languages/LanguageRegistry.ts +44 -0
  130. package/src/languages/LanguageUtils.ts +61 -0
  131. package/src/languages/LionCore-M3.json +2356 -0
  132. package/src/languages/LionCore-builtins.json +372 -0
  133. package/src/languages/LionWebLanguageWrapper.ts +95 -0
  134. package/src/languages/MetaPointerMap.ts +40 -0
  135. package/src/languages/index.ts +2 -0
  136. package/src/runners/FileUtils.ts +9 -36
  137. package/src/runners/RunCheckFolder.ts +3 -1
  138. package/src/runners/RunCheckFolderWithLanguage.ts +7 -7
  139. package/src/runners/RunCheckOneFile.ts +3 -1
  140. package/src/runners/RunCheckOneFileWithLanguage.ts +12 -7
  141. package/src/runners/Utils.ts +0 -1
  142. package/src/tmp.json +574 -0
  143. package/src/tryout.js +21 -0
  144. package/src/util/graphs.ts +36 -0
  145. package/src/validators/LionWebLanguageReferenceValidator.ts +110 -48
  146. package/src/validators/LionWebLanguageValidator.ts +62 -21
  147. package/src/validators/LionWebReferenceValidator.ts +0 -5
  148. package/src/validators/LionWebSyntaxValidator.ts +2 -2
  149. package/src/validators/LionWebValidator.ts +5 -9
  150. package/structure.puml +25 -0
  151. package/dist/json/LanguageUtils.d.ts +0 -9
  152. package/dist/json/LanguageUtils.d.ts.map +0 -1
  153. package/dist/json/LanguageUtils.js +0 -30
  154. package/dist/json/LanguageUtils.js.map +0 -1
  155. package/dist/json/LionWebLanguageDefinition.d.ts +0 -48
  156. package/dist/json/LionWebLanguageDefinition.d.ts.map +0 -1
  157. package/dist/json/LionWebLanguageDefinition.js +0 -126
  158. package/dist/json/LionWebLanguageDefinition.js.map +0 -1
  159. package/src/json/LanguageUtils.ts +0 -52
  160. package/src/json/LionWebLanguageDefinition.ts +0 -144
@@ -0,0 +1,37 @@
1
+ import { CompositeLionWebLanguageWrapper } from "./CompositeLionWebLanguageWrapper.js";
2
+ /**
3
+ * Collection of language definitions
4
+ */
5
+ export class LanguageRegistry {
6
+ constructor() {
7
+ this.languages = new CompositeLionWebLanguageWrapper({ nodes: [], languages: [], serializationFormatVersion: "2023.1" });
8
+ }
9
+ addLanguage(lionWebLanguage) {
10
+ // console.log("LanguageRegistry.add: " + lionWebLanguage.name + " " + lionWebLanguage.jsonChunk.nodes.length)
11
+ this.languages.addLanguage(lionWebLanguage);
12
+ }
13
+ clear() {
14
+ this.languages = new CompositeLionWebLanguageWrapper({ nodes: [], languages: [], serializationFormatVersion: "2023.1" });
15
+ }
16
+ getLanguage(pointer) {
17
+ return this.languages.languageMap.get(pointer.language)?.get(pointer.version);
18
+ }
19
+ /**
20
+ * Gets the node with _metaPointer_ in any of the known languages
21
+ * @param metaPointer
22
+ */
23
+ getNodeByMetaPointer(metaPointer) {
24
+ return this.languages.getNodeByMetaPointer(metaPointer);
25
+ }
26
+ findNode(nodeId) {
27
+ for (const chunk of this.languages.languages) {
28
+ const node = chunk.getNode(nodeId);
29
+ if (node !== undefined) {
30
+ return node;
31
+ }
32
+ }
33
+ return undefined;
34
+ }
35
+ }
36
+ // export const KnownLanguages = new LanguageRegistry()
37
+ //# sourceMappingURL=LanguageRegistry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LanguageRegistry.js","sourceRoot":"","sources":["../../src/languages/LanguageRegistry.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,+BAA+B,EAAE,MAAM,sCAAsC,CAAA;AAGtF;;GAEG;AACH,MAAM,OAAO,gBAAgB;IAA7B;QACI,cAAS,GAAoC,IAAI,+BAA+B,CAAC,EAAC,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,0BAA0B,EAAE,QAAQ,EAAC,CAAC,CAAA;IAiCtJ,CAAC;IA/BG,WAAW,CAAC,eAAuC;QAC/C,+GAA+G;QAE/G,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,eAAe,CAAC,CAAA;IAC/C,CAAC;IAED,KAAK;QACD,IAAI,CAAC,SAAS,GAAG,IAAI,+BAA+B,CAAC,EAAC,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,0BAA0B,EAAE,QAAQ,EAAC,CAAC,CAAA;IAC1H,CAAC;IAED,WAAW,CAAC,OAA+B;QACvC,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;IACjF,CAAC;IAED;;;OAGG;IACH,oBAAoB,CAAC,WAAmC;QACpD,OAAO,IAAI,CAAC,SAAS,CAAC,oBAAoB,CAAC,WAAW,CAAC,CAAA;IAC3D,CAAC;IAED,QAAQ,CAAC,MAAiB;QACtB,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,CAAC;YAC3C,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;YAClC,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;gBACrB,OAAO,IAAI,CAAA;YACf,CAAC;QACL,CAAC;QACD,OAAO,SAAS,CAAA;IACpB,CAAC;CACJ;AAED,uDAAuD"}
@@ -0,0 +1,35 @@
1
+ import { LionWebJsonNode, LionWebJsonChunk } from "../json/LionWebJson.js";
2
+ export declare const LionCore_M3_Json: LionWebJsonChunk;
3
+ export declare const LionCore_builtins_Json: LionWebJsonChunk;
4
+ export declare function isLionCoreLanguage(node: LionWebJsonNode): boolean;
5
+ /**
6
+ * Does _node_ represent a language concept?
7
+ * @param node
8
+ */
9
+ export declare const isConcept: (node: LionWebJsonNode) => boolean;
10
+ /**
11
+ * Does _node_ represent a language annotation?
12
+ * @param node
13
+ */
14
+ export declare const isAnnotation: (node: LionWebJsonNode) => boolean;
15
+ /**
16
+ * Does _node_ represent a language interface?
17
+ * @param node
18
+ */
19
+ export declare const isInterface: (node: LionWebJsonNode) => boolean;
20
+ /**
21
+ * Does _node_ represent a language property?
22
+ * @param node
23
+ */
24
+ export declare const isProperty: (node: LionWebJsonNode) => boolean;
25
+ /**
26
+ * Does _node_ represent a language containment?
27
+ * @param node
28
+ */
29
+ export declare const isContainment: (node: LionWebJsonNode) => boolean;
30
+ /**
31
+ * Does _node_ represent a language reference?
32
+ * @param node
33
+ */
34
+ export declare const isReference: (node: LionWebJsonNode) => boolean;
35
+ //# sourceMappingURL=LanguageUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LanguageUtils.d.ts","sourceRoot":"","sources":["../../src/languages/LanguageUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,eAAe,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAO9F,eAAO,MAAM,gBAAgB,kBAAkC,CAAA;AAC/D,eAAO,MAAM,sBAAsB,kBAAwC,CAAA;AAE3E,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,eAAe,WAEvD;AAED;;;GAGG;AACH,eAAO,MAAM,SAAS,SAAU,eAAe,KAAG,OAEjD,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,YAAY,SAAU,eAAe,KAAG,OAEpD,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,WAAW,SAAU,eAAe,KAAG,OAEnD,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,UAAU,SAAU,eAAe,KAAG,OAElD,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,aAAa,SAAU,eAAe,KAAG,OAErD,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,WAAW,SAAU,eAAe,KAAG,OAEnD,CAAA"}
@@ -0,0 +1,52 @@
1
+ import { isEqualMetaPointer } from "../json/LionWebJson.js";
2
+ import { LION_CORE_M3_KEY, MetaPointers } from "../json/M3definitions.js";
3
+ import LionCore_M3 from "./LionCore-M3.json" assert { type: "json" };
4
+ import LionCore_builtins from "./LionCore-builtins.json" assert { type: "json" };
5
+ export const LionCore_M3_Json = LionCore_M3;
6
+ export const LionCore_builtins_Json = LionCore_builtins;
7
+ export function isLionCoreLanguage(node) {
8
+ return node.classifier.language === LION_CORE_M3_KEY && node.classifier.version === "2023.1";
9
+ }
10
+ /**
11
+ * Does _node_ represent a language concept?
12
+ * @param node
13
+ */
14
+ export const isConcept = (node) => {
15
+ return isEqualMetaPointer(node.classifier, MetaPointers.Concept);
16
+ };
17
+ /**
18
+ * Does _node_ represent a language annotation?
19
+ * @param node
20
+ */
21
+ export const isAnnotation = (node) => {
22
+ return isEqualMetaPointer(node.classifier, MetaPointers.Annotation);
23
+ };
24
+ /**
25
+ * Does _node_ represent a language interface?
26
+ * @param node
27
+ */
28
+ export const isInterface = (node) => {
29
+ return isEqualMetaPointer(node.classifier, MetaPointers.Interface);
30
+ };
31
+ /**
32
+ * Does _node_ represent a language property?
33
+ * @param node
34
+ */
35
+ export const isProperty = (node) => {
36
+ return isEqualMetaPointer(node.classifier, MetaPointers.Property);
37
+ };
38
+ /**
39
+ * Does _node_ represent a language containment?
40
+ * @param node
41
+ */
42
+ export const isContainment = (node) => {
43
+ return isEqualMetaPointer(node.classifier, MetaPointers.Containment);
44
+ };
45
+ /**
46
+ * Does _node_ represent a language reference?
47
+ * @param node
48
+ */
49
+ export const isReference = (node) => {
50
+ return isEqualMetaPointer(node.classifier, MetaPointers.Reference);
51
+ };
52
+ //# sourceMappingURL=LanguageUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LanguageUtils.js","sourceRoot":"","sources":["../../src/languages/LanguageUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAqC,MAAM,wBAAwB,CAAA;AAE9F,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAEzE,OAAO,WAAW,MAAM,oBAAoB,CAAC,SAAS,IAAI,EAAE,MAAM,EAAE,CAAA;AACpE,OAAO,iBAAiB,MAAM,0BAA0B,CAAC,SAAS,IAAI,EAAE,MAAM,EAAE,CAAA;AAEhF,MAAM,CAAC,MAAM,gBAAgB,GAAG,WAA+B,CAAA;AAC/D,MAAM,CAAC,MAAM,sBAAsB,GAAG,iBAAqC,CAAA;AAE3E,MAAM,UAAU,kBAAkB,CAAC,IAAqB;IACpD,OAAO,IAAI,CAAC,UAAU,CAAC,QAAQ,KAAK,gBAAgB,IAAI,IAAI,CAAC,UAAU,CAAC,OAAO,KAAK,QAAQ,CAAA;AAChG,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,IAAqB,EAAW,EAAE;IACxD,OAAO,kBAAkB,CAAC,IAAI,CAAC,UAAU,EAAE,YAAY,CAAC,OAAO,CAAC,CAAA;AACpE,CAAC,CAAA;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,IAAqB,EAAW,EAAE;IAC3D,OAAO,kBAAkB,CAAC,IAAI,CAAC,UAAU,EAAE,YAAY,CAAC,UAAU,CAAC,CAAA;AACvE,CAAC,CAAA;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,IAAqB,EAAW,EAAE;IAC1D,OAAO,kBAAkB,CAAC,IAAI,CAAC,UAAU,EAAE,YAAY,CAAC,SAAS,CAAC,CAAA;AACtE,CAAC,CAAA;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,IAAqB,EAAW,EAAE;IACzD,OAAO,kBAAkB,CAAC,IAAI,CAAC,UAAU,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAA;AACrE,CAAC,CAAA;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,IAAqB,EAAW,EAAE;IAC5D,OAAO,kBAAkB,CAAC,IAAI,CAAC,UAAU,EAAE,YAAY,CAAC,WAAW,CAAC,CAAA;AACxE,CAAC,CAAA;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,IAAqB,EAAW,EAAE;IAC1D,OAAO,kBAAkB,CAAC,IAAI,CAAC,UAAU,EAAE,YAAY,CAAC,SAAS,CAAC,CAAA;AACtE,CAAC,CAAA"}