You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: accept * N anywhere in the track header, not only the first slot (#6)
* fix: accept `* N` anywhere in the track header, not only the first slot
`* N` was recognized only immediately after `gen <id>`. Anywhere else it fell
through to the key/value loop and became a macro param literally named `*`, so
track Pad id pad gen gameBoyDmg layer 0 * 16
silently lost its pattern length and played as ONE bar. No error — the length
just became the default.
Emit always writes `* N` first, which is why this survived: it only bites
hand-written and generated files. tish-gba has 24 such track lines across 4
songs, and two of them bake differently because of it — found by diffing the
baked ROM data before and after moving that repo onto this parser.
Now `* N` and the trailing `key value` pairs are accepted in any order, and a
`*` that names no valid length is an error rather than a dropped token — a
length that quietly becomes 1 is the worst kind of wrong.
Corpus case 002 gains both orderings; coverage holds at 100%.
* fix(test): pin the new `* N` orderings from the Rust side too
Copy file name to clipboardExpand all lines: docs/DECK_GRAMMAR.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -72,6 +72,7 @@ track <displayName> id <channelId> gen <generatorId|macro> [ * <N|inf> ] [ <para
72
72
73
73
-`* N` — **pattern length** in bars (default 1). Channel spans `N × 16` steps and repeats. `* inf` / `* infinite` clears an explicit finite length.
74
74
- Trailing `key value` pairs — **macro parameter overrides** when `gen` is a macro name.
75
+
-`* N` and the `key value` pairs may appear in **any order** after `gen <id>`. Emit writes `* N` first; a `*` that names no valid length is an error, never a silently dropped token.
75
76
-`generatorId` spellings are host-registered (`registerGeneratorIdAliases`). Undeclared ids pass through as-is.
0 commit comments