diff options
Diffstat (limited to 'module/language/tree-il.scm')
-rw-r--r-- | module/language/tree-il.scm | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/module/language/tree-il.scm b/module/language/tree-il.scm index 9ff7158b8..43f5f985e 100644 --- a/module/language/tree-il.scm +++ b/module/language/tree-il.scm @@ -1,4 +1,4 @@ -;;;; Copyright (C) 2009-2014,2017-2020,2022-2023 Free Software Foundation, Inc. +;;;; Copyright (C) 2009-2014,2017-2020,2022-2023,2025 Free Software Foundation, Inc. ;;;; ;;;; This library is free software; you can redistribute it and/or ;;;; modify it under the terms of the GNU Lesser General Public @@ -20,9 +20,9 @@ #:use-module (srfi srfi-1) #:use-module (srfi srfi-11) #:use-module (ice-9 match) + #:use-module (ice-9 source-properties) #:use-module (system base syntax) - #:export ((tree-il-src/ensure-alist . tree-il-src) - (tree-il-src . tree-il-srcv) + #:export (tree-il-src <void> void? make-void void-src <const> const? make-const const-src const-exp <primitive-ref> primitive-ref? make-primitive-ref primitive-ref-src primitive-ref-name @@ -136,19 +136,6 @@ (<prompt> escape-only? tag body handler) (<abort> tag args tail)) -(define tree-il-src/ensure-alist - (make-procedure-with-setter - (lambda (tree) - "Return the source location of TREE as a source property alist." - ;; psyntax gives us "source vectors"; convert them lazily to reduce - ;; allocations. - (match (tree-il-src tree) - (#(file line column) - `((filename . ,file) (line . ,line) (column . ,column))) - (src - src))) - (lambda (tree src) - (set! (tree-il-src tree) src)))) @@ -166,7 +153,10 @@ (define (location x) (and (pair? x) (let ((props (source-properties x))) - (and (pair? props) props)))) + (and (pair? props) + (vector (assq-ref props 'filename) + (assq-ref props 'line) + (assq-ref props 'column)))))) (define (parse-tree-il exp) (let ((loc (location exp)) |