gexp: Preserve source location for #~ and #$ read extensions.
authorLudovic Courtès <ludo@gnu.org>
Wed, 16 Feb 2022 10:27:43 +0000 (11:27 +0100)
committerLudovic Courtès <ludo@gnu.org>
Wed, 16 Feb 2022 15:49:26 +0000 (16:49 +0100)
commitca155a20aea25003b03ef5e0420c77e416d5f425
tree73a8756b3a89dbbf85fde19e935da19c90c88472
parent176354c2f887942a9bdb6ccbdb754094eacd06fa
gexp: Preserve source location for #~ and #$ read extensions.

Read hash extensions preserve source location info as source properties
on their result.  However, in Guile 3.0.8, that location would be
dismissed, leading 'local-file' to fail to resolve file names relative
to the source directory.

Fixes <https://issues.guix.gnu.org/54003>.
Reported by Aleksandr Vityazev <avityazev@posteo.org>.

* guix/gexp.scm <eval-when> [read-syntax-redefined?, read-procedure]
[read-syntax*]: New variables.
[read-ungexp]: Adjust to expect either sexps or syntax objects.
[read-gexp]: Call 'read-procedure'.
* tests/gexp.scm ("local-file, relative file name, within gexp")
("local-file, relative file name, within gexp, compiled"): New tests.
guix/gexp.scm
tests/gexp.scm