guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/05: gexp: Properly report substitution errors.


From: Ludovic Courtès
Subject: 01/05: gexp: Properly report substitution errors.
Date: Sun, 1 Jan 2017 22:31:25 +0000 (UTC)

civodul pushed a commit to branch master
in repository guix.

commit 4a6e889feba7bb382bb9e356d15e8260a256ced4
Author: Ludovic Courtès <address@hidden>
Date:   Sun Jan 1 18:17:29 2017 +0100

    gexp: Properly report substitution errors.
    
    * guix/gexp.scm (gexp)[substitute-ungexp]: Wrap body in 'with-syntax'
    and pass EXP as the last argument to 'syntax-error'.
    [substitute-ungexp-splicing]: Pass EXP as the last argument to
    'syntax-error'.
---
 guix/gexp.scm |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/guix/gexp.scm b/guix/gexp.scm
index 6f63afe..79a7b18 100644
--- a/guix/gexp.scm
+++ b/guix/gexp.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2014, 2015, 2016 Ludovic Courtès <address@hidden>
+;;; Copyright © 2014, 2015, 2016, 2017 Ludovic Courtès <address@hidden>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -846,9 +846,9 @@ environment."
       (match (assoc exp substs)
         ((_ id)
          id)
-        (_
-         #'(syntax-error "error: no 'ungexp' substitution"
-                         #'ref))))
+        (_                                        ;internal error
+         (with-syntax ((exp exp))
+           #'(syntax-error "error: no 'ungexp' substitution" exp)))))
 
     (define (substitute-ungexp-splicing exp substs)
       (syntax-case exp ()
@@ -860,7 +860,7 @@ environment."
                         #,(substitute-references #'(rest ...) substs))))
            (_
             #'(syntax-error "error: no 'ungexp-splicing' substitution"
-                            #'ref))))))
+                            exp))))))
 
     (define (substitute-references exp substs)
       ;; Return a variant of EXP where all the cars of SUBSTS have been



reply via email to

[Prev in Thread] Current Thread [Next in Thread]