@accordproject/concerto-cto 4.2.0 → 5.0.0-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 (66) hide show
  1. package/dist/esm/chunk-ADZEFNZ5.mjs +46 -0
  2. package/dist/esm/chunk-ADZEFNZ5.mjs.map +7 -0
  3. package/dist/esm/chunk-JIDG6RUM.mjs +11851 -0
  4. package/dist/esm/chunk-JIDG6RUM.mjs.map +7 -0
  5. package/dist/esm/chunk-KXXMUWWS.mjs +370 -0
  6. package/dist/esm/chunk-KXXMUWWS.mjs.map +7 -0
  7. package/dist/esm/chunk-N5WVDVIT.mjs +831 -0
  8. package/dist/esm/chunk-N5WVDVIT.mjs.map +7 -0
  9. package/dist/esm/chunk-TXONDDFZ.mjs +53 -0
  10. package/dist/esm/chunk-TXONDDFZ.mjs.map +7 -0
  11. package/dist/esm/chunk-WNU2QZFD.mjs +40 -0
  12. package/dist/esm/chunk-WNU2QZFD.mjs.map +7 -0
  13. package/dist/esm/external.mjs +15 -0
  14. package/dist/esm/external.mjs.map +7 -0
  15. package/dist/esm/index.mjs +23 -0
  16. package/dist/esm/index.mjs.map +7 -0
  17. package/dist/esm/parseexception.mjs +12 -0
  18. package/dist/esm/parseexception.mjs.map +7 -0
  19. package/dist/esm/parserMain.mjs +16 -0
  20. package/dist/esm/parserMain.mjs.map +7 -0
  21. package/dist/esm/printer.mjs +12 -0
  22. package/dist/esm/printer.mjs.map +7 -0
  23. package/dist/esm-browser/chunk-ABBFUZVB.mjs +374 -0
  24. package/dist/esm-browser/chunk-ABBFUZVB.mjs.map +7 -0
  25. package/dist/esm-browser/chunk-E5UYTZNO.mjs +1696 -0
  26. package/dist/esm-browser/chunk-E5UYTZNO.mjs.map +7 -0
  27. package/dist/esm-browser/chunk-MSZDQHW6.mjs +66 -0
  28. package/dist/esm-browser/chunk-MSZDQHW6.mjs.map +7 -0
  29. package/dist/esm-browser/chunk-OMK4IF4X.mjs +48 -0
  30. package/dist/esm-browser/chunk-OMK4IF4X.mjs.map +7 -0
  31. package/dist/esm-browser/chunk-SEXNR5Y5.mjs +11851 -0
  32. package/dist/esm-browser/chunk-SEXNR5Y5.mjs.map +7 -0
  33. package/dist/esm-browser/chunk-VCWYA55K.mjs +933 -0
  34. package/dist/esm-browser/chunk-VCWYA55K.mjs.map +7 -0
  35. package/dist/esm-browser/chunk-YAX4W2RL.mjs +56 -0
  36. package/dist/esm-browser/chunk-YAX4W2RL.mjs.map +7 -0
  37. package/dist/esm-browser/external.mjs +14 -0
  38. package/dist/esm-browser/external.mjs.map +7 -0
  39. package/dist/esm-browser/index.mjs +27 -0
  40. package/dist/esm-browser/index.mjs.map +7 -0
  41. package/dist/esm-browser/parseexception.mjs +10 -0
  42. package/dist/esm-browser/parseexception.mjs.map +7 -0
  43. package/dist/esm-browser/parserMain.mjs +15 -0
  44. package/dist/esm-browser/parserMain.mjs.map +7 -0
  45. package/dist/esm-browser/printer.mjs +11 -0
  46. package/dist/esm-browser/printer.mjs.map +7 -0
  47. package/dist/external.d.ts +11 -5
  48. package/dist/external.js +6 -2
  49. package/dist/external.js.map +1 -1
  50. package/dist/index.d.ts +4 -4
  51. package/dist/index.js +11 -8
  52. package/dist/index.js.map +1 -1
  53. package/dist/parseexception.d.ts +2 -1
  54. package/dist/parseexception.js +6 -4
  55. package/dist/parseexception.js.map +1 -1
  56. package/dist/parser.js +374 -171
  57. package/dist/parser.js.map +1 -1
  58. package/dist/parserMain.d.ts +5 -5
  59. package/dist/parserMain.js +47 -6
  60. package/dist/parserMain.js.map +1 -1
  61. package/dist/printer.d.ts +3 -3
  62. package/dist/printer.js +4 -1
  63. package/dist/printer.js.map +1 -1
  64. package/package.json +19 -11
  65. package/dist/concerto-cto.js +0 -2
  66. package/dist/concerto-cto.js.LICENSE.txt +0 -12
@@ -0,0 +1,46 @@
1
+ import { createRequire as __createRequire } from "module";
2
+ const require = __createRequire(import.meta.url);
3
+
4
+ // src/parseexception.ts
5
+ import { BaseFileException } from "@accordproject/concerto-util";
6
+ var ParseException = class extends BaseFileException {
7
+ /**
8
+ * Create an ParseException
9
+ * @param {string} message - the message for the exception
10
+ * @param {string | object} [fileLocation] - the file location associated with the exception
11
+ * @param {string} [fileName] - the file name associated with the exception
12
+ * @param {string} [fullMessageOverride] - the pre-existing full message
13
+ * @param {string} [component] - the component which throws this error
14
+ */
15
+ constructor(message, fileLocation, fileName, fullMessageOverride, component) {
16
+ let fullMessage = message;
17
+ let suffix = "";
18
+ if (fileName) {
19
+ suffix += " File " + fileName;
20
+ }
21
+ if (fileLocation) {
22
+ if (fileLocation.end && fileLocation.start) {
23
+ if (fileLocation.end.offset && fileLocation.start.offset) {
24
+ if (fileLocation.end.offset - fileLocation.start.offset === 1) {
25
+ fileLocation.end.column = fileLocation.start.column;
26
+ fileLocation.end.offset = fileLocation.start.offset;
27
+ }
28
+ }
29
+ }
30
+ if (suffix) {
31
+ suffix += " line " + fileLocation.start.line + " column " + fileLocation.start.column;
32
+ } else {
33
+ suffix += " Line " + fileLocation.start.line + " column " + fileLocation.start.column;
34
+ }
35
+ }
36
+ fullMessage += suffix;
37
+ super(message, fileLocation, fullMessageOverride || fullMessage, fileName, component);
38
+ }
39
+ };
40
+ var parseexception_default = ParseException;
41
+
42
+ export {
43
+ ParseException,
44
+ parseexception_default
45
+ };
46
+ //# sourceMappingURL=chunk-ADZEFNZ5.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/parseexception.ts"],
4
+ "sourcesContent": ["/*\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { BaseFileException } from '@accordproject/concerto-util';\n\n/**\n * Exception throws when a Concerto file is syntactically invalid\n * @extends BaseFileException\n * @see See {@link BaseFileException}\n * @class\n * @memberof module:concerto-core\n * @private\n */\nclass ParseException extends (BaseFileException as any) {\n /**\n * Create an ParseException\n * @param {string} message - the message for the exception\n * @param {string | object} [fileLocation] - the file location associated with the exception\n * @param {string} [fileName] - the file name associated with the exception\n * @param {string} [fullMessageOverride] - the pre-existing full message\n * @param {string} [component] - the component which throws this error\n */\n constructor(message: string, fileLocation?: {\n start: {\n line: number;\n column: number;\n offset: number;\n };\n end?: {\n line: number;\n column: number;\n offset: number;\n };\n }, fileName?: string, fullMessageOverride?: string, component?: string) {\n let fullMessage = message;\n let suffix = '';\n\n // Add the file name onto the message if it has been set.\n if (fileName) {\n suffix += ' File ' + fileName;\n }\n\n // The parser does not give us back the end location of an invalid token.\n // Making the end column equal to the start column makes use of\n // vscodes default behaviour of selecting an entire word\n if (fileLocation) {\n if (fileLocation.end && fileLocation.start) {\n if (fileLocation.end.offset && fileLocation.start.offset) {\n if (fileLocation.end.offset - fileLocation.start.offset === 1) {\n fileLocation.end.column = fileLocation.start.column;\n fileLocation.end.offset = fileLocation.start.offset;\n }\n }\n }\n if (suffix) {\n suffix+= ' line ' + fileLocation.start.line + ' column ' + fileLocation.start.column;\n } else {\n suffix+= ' Line ' + fileLocation.start.line + ' column ' + fileLocation.start.column;\n }\n }\n\n fullMessage += suffix;\n super(message, fileLocation, fullMessageOverride || fullMessage, fileName, component);\n }\n}\n\nexport { ParseException };\nexport default ParseException; "],
5
+ "mappings": ";;;;AAcA,SAAS,yBAAyB;AAUlC,IAAM,iBAAN,cAA8B,kBAA0B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASpD,YAAY,SAAiB,cAW1B,UAAmB,qBAA8B,WAAoB;AACpE,QAAI,cAAc;AAClB,QAAI,SAAS;AAGb,QAAI,UAAU;AACV,gBAAU,WAAW;AAAA,IACzB;AAKA,QAAI,cAAc;AACd,UAAI,aAAa,OAAO,aAAa,OAAO;AACxC,YAAI,aAAa,IAAI,UAAU,aAAa,MAAM,QAAQ;AACtD,cAAI,aAAa,IAAI,SAAS,aAAa,MAAM,WAAW,GAAG;AAC3D,yBAAa,IAAI,SAAS,aAAa,MAAM;AAC7C,yBAAa,IAAI,SAAS,aAAa,MAAM;AAAA,UACjD;AAAA,QACJ;AAAA,MACJ;AACA,UAAI,QAAQ;AACR,kBAAS,WAAW,aAAa,MAAM,OAAO,aAAa,aAAa,MAAM;AAAA,MAClF,OAAO;AACH,kBAAS,WAAW,aAAa,MAAM,OAAO,aAAa,aAAa,MAAM;AAAA,MAClF;AAAA,IACJ;AAEA,mBAAe;AACf,UAAM,SAAS,cAAc,uBAAuB,aAAa,UAAU,SAAS;AAAA,EACxF;AACJ;AAGA,IAAO,yBAAQ;",
6
+ "names": []
7
+ }