@r_masseater/song-format 0.2.1 → 0.2.3

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 (35) hide show
  1. package/dist/als-to-fumx.mjs +3 -3
  2. package/dist/als-to-fumx.mjs.map +1 -1
  3. package/dist/convert-als.mjs +1 -1
  4. package/dist/convert-als.mjs.map +1 -1
  5. package/dist/fumx-language-server.mjs +18 -2
  6. package/dist/fumx-language-server.mjs.map +1 -1
  7. package/dist/{fumx-module-CqxUe07y.mjs → fumx-module-BxN-liut.mjs} +27 -4
  8. package/dist/fumx-module-BxN-liut.mjs.map +1 -0
  9. package/dist/{fumx-module-CtXvLKU1.mjs → fumx-module-C1v5AGSG.mjs} +26 -3
  10. package/dist/fumx-module-C1v5AGSG.mjs.map +1 -0
  11. package/dist/index.mjs +1 -1
  12. package/dist/language.mjs +1 -1
  13. package/dist/mapper.mjs +1 -1
  14. package/dist/midi-to-fumx.mjs +2 -2
  15. package/dist/package-Ck3ET08d.mjs +37 -0
  16. package/dist/package-Ck3ET08d.mjs.map +1 -0
  17. package/dist/{read-song-BzqX5MuZ.mjs → read-song-C7MGcv8n.mjs} +11 -5
  18. package/dist/read-song-C7MGcv8n.mjs.map +1 -0
  19. package/dist/{read-song-CzMPm8u8.mjs → read-song-CmIfnGfX.mjs} +11 -5
  20. package/dist/read-song-CmIfnGfX.mjs.map +1 -0
  21. package/dist/{round-trip-Cz8iQlpW.mjs → round-trip-DIqLFW0h.mjs} +7 -7
  22. package/dist/round-trip-DIqLFW0h.mjs.map +1 -0
  23. package/dist/song-report.mjs +5 -5
  24. package/dist/song-report.mjs.map +1 -1
  25. package/dist/{transform-BoSDqqPW.mjs → transform-CEJ9wvbl.mjs} +2 -2
  26. package/dist/{transform-BoSDqqPW.mjs.map → transform-CEJ9wvbl.mjs.map} +1 -1
  27. package/dist/vite.mjs +2 -2
  28. package/package.json +3 -3
  29. package/dist/fumx-module-CqxUe07y.mjs.map +0 -1
  30. package/dist/fumx-module-CtXvLKU1.mjs.map +0 -1
  31. package/dist/read-song-BzqX5MuZ.mjs.map +0 -1
  32. package/dist/read-song-CzMPm8u8.mjs.map +0 -1
  33. package/dist/round-trip-Cz8iQlpW.mjs.map +0 -1
  34. package/dist/run-main-Bf32CgzU.mjs +0 -26
  35. package/dist/run-main-Bf32CgzU.mjs.map +0 -1
@@ -1,6 +1,6 @@
1
- import * as langium from "langium";
2
- import { AstUtils, DefaultScopeProvider, EmptyFileSystem, StreamScope, UriUtils, createDefaultCoreModule, createDefaultSharedCoreModule, inject, isReference, loadGrammarFromJson } from "langium";
3
1
  import { Array, Match, Option, Predicate, Record, String as String$1, pipe } from "effect";
2
+ import * as langium from "langium";
3
+ import { AstUtils, DefaultLexerErrorMessageProvider, DefaultScopeProvider, EmptyFileSystem, LangiumParserErrorMessageProvider, StreamScope, UriUtils, createDefaultCoreModule, createDefaultSharedCoreModule, inject, isReference, loadGrammarFromJson } from "langium";
4
4
  import { Note } from "tonal";
5
5
  // generated/langium/ast.ts
6
6
  /******************************************************************************
@@ -12458,6 +12458,29 @@ const compileSong = (song) => {
12458
12458
  ]
12459
12459
  };
12460
12460
  };
12461
+ // src/features/read-song/model/syntax-messages.ts
12462
+ const unexpected = (actual) => pipe(Array.head(actual), Option.map((token) => token.image), Option.filter(String$1.isNonEmpty), Option.match({
12463
+ onNone: () => "Unexpected end of file.",
12464
+ onSome: (image) => `Unexpected \`${image}\`.`
12465
+ }));
12466
+ const SyntaxMessagesModule = { parser: {
12467
+ ParserErrorMessageProvider: () => {
12468
+ const langium = new LangiumParserErrorMessageProvider();
12469
+ return {
12470
+ buildMismatchTokenMessage: (options) => langium.buildMismatchTokenMessage(options),
12471
+ buildNotAllInputParsedMessage: (options) => langium.buildNotAllInputParsedMessage(options),
12472
+ buildNoViableAltMessage: ({ actual }) => unexpected(actual),
12473
+ buildEarlyExitMessage: ({ actual }) => unexpected(actual)
12474
+ };
12475
+ },
12476
+ LexerErrorMessageProvider: () => {
12477
+ const langium = new DefaultLexerErrorMessageProvider();
12478
+ return {
12479
+ buildUnexpectedCharactersMessage: (fullText, startOffset, length) => `Unexpected character \`${String$1.slice(startOffset, startOffset + length)(fullText)}\`.`,
12480
+ buildUnableToPopLexerModeMessage: (token) => langium.buildUnableToPopLexerModeMessage(token)
12481
+ };
12482
+ }
12483
+ } };
12461
12484
  // src/features/read-song/model/fumx-module.ts
12462
12485
  const FumxModule = { references: { ScopeProvider: scopeProviderOf } };
12463
12486
  const registerChecks = (fumx) => {
@@ -12472,7 +12495,7 @@ const registerChecks = (fumx) => {
12472
12495
  };
12473
12496
  const createFumxServices = () => {
12474
12497
  const shared = inject(createDefaultSharedCoreModule(EmptyFileSystem), FumxGeneratedSharedModule);
12475
- const fumx = inject(createDefaultCoreModule({ shared }), FumxGeneratedModule, FumxModule);
12498
+ const fumx = inject(createDefaultCoreModule({ shared }), FumxGeneratedModule, FumxModule, SyntaxMessagesModule);
12476
12499
  shared.ServiceRegistry.register(fumx);
12477
12500
  registerChecks(fumx);
12478
12501
  return {
@@ -12482,4 +12505,4 @@ const createFumxServices = () => {
12482
12505
  };
12483
12506
  export { importedUriOf as a, fractionOf as c, FumxGrammar as d, FumxTerminals as f, compileSong as i, FumxGeneratedModule as l, createFumxServices as n, isNamed as o, isSong as p, registerChecks as r, TICKS_PER_WHOLE as s, FumxModule as t, FumxGeneratedSharedModule as u };
12484
12507
 
12485
- //# sourceMappingURL=fumx-module-CqxUe07y.mjs.map
12508
+ //# sourceMappingURL=fumx-module-BxN-liut.mjs.map