abc2midi: allow %%MIDIdef macros to be defined anywhere (#23)

* abc2midi: allow %%MIDIdef macros to be defined anywhere

Fix also some lost CHANGES from previous commit.

abc2midi: allow %%MIDIdef macros to be defined anywhere, including before the first X: field (outside any tune). Previously %%MIDIdef was only handled inside event_specific() after the started_parsing check,so macros defined in the file header were silently ignored.
The %%MIDIdef handling has been moved before the started_parsing check in event_specific() in store.c since macro definitions are context-independent.

* Update the golden test files since X:, R: and C: are now emitted
This commit is contained in:
Ronan Keryell
2026-04-23 06:21:48 -07:00
committed by GitHub
parent 22ad87cd72
commit 6ecbbde0fd
7 changed files with 84 additions and 7 deletions

View File

@@ -15706,6 +15706,16 @@ in event_refno() in store.c.
Man page updated in doc/abc2midi.1.
March 31 2026 [RK]
abc2midi: allow %%MIDIdef macros to be defined anywhere, including
before the first X: field (outside any tune). Previously %%MIDIdef was
only handled inside event_specific() after the started_parsing check,
so macros defined in the file header were silently ignored. The
%%MIDIdef handling has been moved before the started_parsing check in
event_specific() in store.c since macro definitions are
context-independent.
2026 April 01
build: added CMake build system (CMakeLists.txt, CMakePresets.json)
alongside the existing autoconf build. Three presets are provided:
@@ -15714,4 +15724,3 @@ files (midifile.c, parseabc.c, music_utils.c, parser2.c) are compiled
once via OBJECT libraries. The build exports compile_commands.json
for LSP/clangd support. Note: the codebase requires -std=gnu89 until
the K&R-to-ANSI prototype migration is completed.