Closed truj closed 3 years ago
You're right, that's a very good point.
I'd like to do some research into "standard"/common approaches to compiler error messages. I would think that parse errors should almost always include a line and column number, whenever it's possible to do so. There is probably some popular format that I should copy that would make it easier to use the Alda compiler as a linter and hook it up with text editors.
I'm adding a task to the Alda v2 project to make sure that I end up doing this in Alda v2. I did some testing just now, and the v2 parser is already in a state where we have at least the line number in hand, and I think it should be easy enough to add the column too.
Given a score like piano: /e
, Alda v1's error message is:
[27713] ERROR No previous note with which to create a chord.
Alda v2's error message is:
/tmp/foo.alda:1 Unexpected Separator `/` at the top level
Which contains the filename and line number, and it'll be nice if I can add the column number too, like /tmp/foo.alda:1:8
.
I've fixed this in Alda v2. I'll leave this issue open just in case somebody feels like fixing it in Alda v1; will close when Alda v2 is released.
On second thought, I'm going to go ahead and close this. Alda v2 is coming soon! :fireworks:
I have decompiled a MIDI file to ALDA using Midica. In order to test this file, I tried to re-convert it to MIDI using ALDA. I got the following error message:
The file is quite large, so this error message is not very helpful to find the bug.
Proposed Solution: Error messages should contain the line number and column of the source file where the error occurred.