barmark 0.23.0 → 0.23.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/CHANGELOG.md CHANGED
@@ -9,6 +9,16 @@ Releases follow the process in [RELEASING.md](RELEASING.md).
9
9
 
10
10
  ## [Unreleased]
11
11
 
12
+ ## [0.23.1] - 2026-11-10
13
+
14
+ ### Changed
15
+
16
+ - **Words on a rehearsal mark's cell get a suggestion.** They are still
17
+ an error (`| @B "Play 3 times" C |`), now with a suggestion, as a chord
18
+ on a mark has: the mark a cell of its own and the words on the bar
19
+ (`| @B | "Play 3 times" C |`). There is none when no slot is left for
20
+ the words or the cell has a one-bar meter (stem-shovel issue 16, ask 7).
21
+
12
22
  ## [0.23.0] - 2026-11-10
13
23
 
14
24
  Grammar changes: an unreadable slot keeps its bar, stacked chord
@@ -844,7 +854,8 @@ The first working release: the reference parser and printer for the
844
854
 
845
855
  - **A placeholder package that holds the `barmark` name** while the spec and parser are written.
846
856
 
847
- [Unreleased]: https://github.com/kevinpeckham/barmark/compare/barmark-v0.23.0...HEAD
857
+ [Unreleased]: https://github.com/kevinpeckham/barmark/compare/barmark-v0.23.1...HEAD
858
+ [0.23.1]: https://github.com/kevinpeckham/barmark/compare/barmark-v0.23.0...barmark-v0.23.1
848
859
  [0.23.0]: https://github.com/kevinpeckham/barmark/compare/barmark-v0.22.0...barmark-v0.23.0
849
860
  [0.22.0]: https://github.com/kevinpeckham/barmark/compare/barmark-v0.21.0...barmark-v0.22.0
850
861
  [0.21.0]: https://github.com/kevinpeckham/barmark/compare/barmark-v0.20.0...barmark-v0.21.0
@@ -424,18 +424,22 @@ function rehearsalCell(bare, meter, words) {
424
424
  problem: "a rehearsal mark is @ and a label of letters and digits, like @B or @17",
425
425
  token: mark,
426
426
  };
427
+ const others = withWords(list, words, at);
428
+ // The mark's own cell, the rest on the bar; with no slot left the words have no bar to go on.
429
+ const split = list.length > 1 && !meter ? { suggestion: `| ${mark} | ${others} |` } : {};
427
430
  if (words.length)
428
- return { problem: "words go on a bar, not on a rehearsal mark", token: mark };
431
+ return { problem: "words go on a bar, not on a rehearsal mark", token: mark, ...split };
429
432
  if (meter)
430
433
  return { problem: "a one-bar meter cannot go on a rehearsal mark", token: mark };
431
434
  if (list.length === 1)
432
435
  return { cell: { kind: "rehearsal", label: mark.slice(1) } };
433
- const others = list.filter((_, i) => i !== at).join(" ");
434
- return {
435
- problem: "a rehearsal mark is a cell of its own",
436
- token: mark,
437
- suggestion: `| ${mark} | ${others} |`,
438
- };
436
+ return { problem: "a rehearsal mark is a cell of its own", token: mark, ...split };
437
+ }
438
+ /** A cell's tokens with its words back in their places, in straight quotes, leaving out token `skip`. */
439
+ function withWords(list, words, skip) {
440
+ const quoted = (i) => words.filter((w) => w.at === i).map((w) => `"${w.text}"`);
441
+ const out = list.flatMap((t, i) => [...quoted(i), ...(i === skip ? [] : [t])]);
442
+ return [...out, ...quoted(list.length)].join(" ");
439
443
  }
440
444
  /** An unreadable slot (grammar principle 4): unknown harmony keeping what the author wrote. */
441
445
  const unreadable = (text, dotted) => ({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "barmark",
3
- "version": "0.23.0",
3
+ "version": "0.23.1",
4
4
  "description": "Markdown-inspired plain-text notation for chord charts: a parser, a canonical printer and Harte-label conversion.",
5
5
  "type": "module",
6
6
  "exports": {