guix-commits
[Top][All Lists]
Advanced

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

02/03: utils: Add 'location->source-properties'.


From: ???
Subject: 02/03: utils: Add 'location->source-properties'.
Date: Wed, 13 Apr 2016 01:17:29 +0000

iyzsong pushed a commit to branch master
in repository guix.

commit f7df1e3efb4d4a67065b0eddc7eb02a8cb81fa21
Author: 宋文武 <address@hidden>
Date:   Wed Apr 6 18:31:12 2016 +0800

    utils: Add 'location->source-properties'.
    
    * guix/utils (location-source->properties): New procedure.
---
 guix/utils.scm |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/guix/utils.scm b/guix/utils.scm
index f566a99..a0e9439 100644
--- a/guix/utils.scm
+++ b/guix/utils.scm
@@ -61,6 +61,7 @@
             location-line
             location-column
             source-properties->location
+            location->source-properties
 
             nix-system->gnu-triplet
             gnu-triplet->nix-system
@@ -895,3 +896,10 @@ etc."
     ;; In accordance with the GCS, start line and column numbers at 1.  Note
     ;; that unlike LINE and `port-column', COL is actually 1-indexed here...
     (location file (and line (+ line 1)) col)))
+
+(define (location->source-properties loc)
+  "Return the source property association list based on the info in LOC,
+a location object."
+  `((line     . ,(and=> (location-line loc) 1-))
+    (column   . ,(location-column loc))
+    (filename . ,(location-file loc))))



reply via email to

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