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
{{ message }}
Repository navigation
Arrangement.Parse rejects a chart whose sections are separated by two blank lines or by a whitespace-only line #339
Arrangement.TryParse (Semantics.Music/Arrangement.cs:96) splits the text on exactly "\n\n". It then passes each block to Section.TryParse without trimming it. Section.TryParse requires the block's first character to be [ (Section.cs:116-118). Two layouts break this:
Three newlines between sections. The next block starts with "\n", so it fails the [ check.
A blank line holding a space or tab ("\n \n"). The split never happens, so two sections are read as one block.
Either way the whole parse fails.
Reproduced against HEAD 9c64b67, starting from a valid arrangement a with a Verse and a Chorus:
Arrangement.Parse(a.ToString()) round-trips. CRLF input is also fine.
Arrangements are hand-written chart files. An extra blank line between sections, or an editor leaving trailing whitespace on the separator line, makes a valid chart unparseable. The error doesn't point at the cause.
Suggested fix
Split into lines and treat any run of empty or whitespace-only lines as one section separator. Alternatively, trim leading and trailing newlines from each block and drop blocks that are empty after trimming.
Acceptance criteria
Both variants above parse equal to a.
The existing arrangement round-trip tests still pass.
Priority: Medium. Hand-written charts with an extra blank line, or trailing whitespace on the separator line, fail to parse, and the error doesn't point at the cause. Nothing is lost silently, and the fix is local.
Area:Semantics.Music/Arrangement.cs:96 (section split) and Section.TryParse.
Activity
matt-edmondson commentedon Sep 30, 2026
Triage
Semantics.Music/Arrangement.cs:96(section split) andSection.TryParse.Generated by Claude Code