Skip to content

Better source locations for Scheme errors

Jean Abou Samra requested to merge jeanas/lilypond:scm-locs into master

This makes for better error messages for Scheme code embedded in LilyPond files. In particular, a source location is now included. It points (most of the time) to the precise Scheme subexpression, not to the start of the whole block of Scheme code.

Two main things need to be done for this:

  1. Use the compiler to run code. The evaluator does not keep track of source locations.
  2. Fix the error handling logic. LilyPond catches Scheme errors in order to continue anyway (unless -dno-protected-scheme-parsing was passed). The code for doing that was losing error locations.

As a prelude to point 1, there are various fixes to account for discrepancies between the compiler and the evaluator (cough).

Furthermore, since the compiler emits warnings, all Guile warnings are now silenced. This also applies to the messages emitted while auto-compiling in make bytecode, which now only prints "Generating Guile bytecode ..." and nothing else.

Fixes #5992 (closed)

Edited by Jean Abou Samra

Merge request reports