diff options
Diffstat (limited to 'module/language')
-rw-r--r-- | module/language/cps.scm | 3 | ||||
-rw-r--r-- | module/language/cps/compile-bytecode.scm | 1 | ||||
-rw-r--r-- | module/language/cps/spec.scm | 3 | ||||
-rw-r--r-- | module/language/ecmascript/array.scm | 5 | ||||
-rw-r--r-- | module/language/ecmascript/compile-tree-il.scm | 3 | ||||
-rw-r--r-- | module/language/ecmascript/function.scm | 13 | ||||
-rw-r--r-- | module/language/elisp/boot.el | 5 | ||||
-rw-r--r-- | module/language/elisp/compile-tree-il.scm | 7 | ||||
-rw-r--r-- | module/language/elisp/lexer.scm | 3 | ||||
-rw-r--r-- | module/language/elisp/parser.scm | 3 | ||||
-rw-r--r-- | module/language/tree-il.scm | 24 | ||||
-rw-r--r-- | module/language/tree-il/analyze.scm | 8 | ||||
-rw-r--r-- | module/language/tree-il/compile-bytecode.scm | 4 | ||||
-rw-r--r-- | module/language/tree-il/compile-cps.scm | 10 | ||||
-rw-r--r-- | module/language/tree-il/debug.scm | 2 | ||||
-rw-r--r-- | module/language/tree-il/letrectify.scm | 4 | ||||
-rw-r--r-- | module/language/tree-il/peval.scm | 4 | ||||
-rw-r--r-- | module/language/tree-il/spec.scm | 3 | ||||
-rw-r--r-- | module/language/wisp.scm | 3 |
19 files changed, 55 insertions, 53 deletions
diff --git a/module/language/cps.scm b/module/language/cps.scm index 42ebb0fe6..aefb68e0e 100644 --- a/module/language/cps.scm +++ b/module/language/cps.scm @@ -1,6 +1,6 @@ ;;; Continuation-passing style (CPS) intermediate language (IL) -;; Copyright (C) 2013-2015,2017-2018,2020,2021 Free Software Foundation, Inc. +;; Copyright (C) 2013-2015,2017-2018,2020,2021,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 @@ -116,6 +116,7 @@ (define-module (language cps) #:use-module (ice-9 match) + #:use-module (ice-9 source-properties) #:use-module (srfi srfi-9) #:use-module (srfi srfi-9 gnu) #:use-module (srfi srfi-11) diff --git a/module/language/cps/compile-bytecode.scm b/module/language/cps/compile-bytecode.scm index bb530c7c6..8ff16cfa5 100644 --- a/module/language/cps/compile-bytecode.scm +++ b/module/language/cps/compile-bytecode.scm @@ -506,7 +506,6 @@ (#('bytevector? #f (a)) (unary emit-bytevector? a)) (#('thread? #f (a)) (unary emit-thread? a)) (#('weak-set? #f (a)) (unary emit-weak-set? a)) - (#('weak-table? #f (a)) (unary emit-weak-table? a)) (#('array? #f (a)) (unary emit-array? a)) (#('bitvector? #f (a)) (unary emit-bitvector? a)) (#('smob? #f (a)) (unary emit-smob? a)) diff --git a/module/language/cps/spec.scm b/module/language/cps/spec.scm index 5864203cb..780b982e0 100644 --- a/module/language/cps/spec.scm +++ b/module/language/cps/spec.scm @@ -1,6 +1,6 @@ ;;; Continuation-passing style (CPS) intermediate language (IL) -;; Copyright (C) 2015 Free Software Foundation, Inc. +;; Copyright (C) 2015, 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,6 +20,7 @@ (define-module (language cps spec) #:use-module (ice-9 match) + #:use-module (ice-9 source-properties) #:use-module (system base language) #:use-module (language cps) #:use-module (language cps intmap) diff --git a/module/language/ecmascript/array.scm b/module/language/ecmascript/array.scm index 997034584..ea9b9ace1 100644 --- a/module/language/ecmascript/array.scm +++ b/module/language/ecmascript/array.scm @@ -1,6 +1,6 @@ ;;; ECMAScript for Guile -;; Copyright (C) 2009, 2010 Free Software Foundation, Inc. +;; Copyright (C) 2009, 2010, 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 @@ -22,6 +22,7 @@ #:use-module (oop goops) #:use-module (language ecmascript base) #:use-module (language ecmascript function) + #:use-module (ice-9 weak-tables) #:export (*array-prototype* new-array)) @@ -43,7 +44,7 @@ #:value new-array #:constructor new-array)) -(hashq-set! *program-wrappers* new-array *array-prototype*) +(doubly-weak-hash-table-set! *program-wrappers* new-array *array-prototype*) (pput *array-prototype* 'prototype *array-prototype*) (pput *array-prototype* 'constructor new-array) diff --git a/module/language/ecmascript/compile-tree-il.scm b/module/language/ecmascript/compile-tree-il.scm index d61f7120d..6acdd3b4f 100644 --- a/module/language/ecmascript/compile-tree-il.scm +++ b/module/language/ecmascript/compile-tree-il.scm @@ -1,6 +1,6 @@ ;;; ECMAScript for Guile -;; Copyright (C) 2009, 2011, 2016 Free Software Foundation, Inc. +;; Copyright (C) 2009, 2011, 2016, 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 @@ -21,6 +21,7 @@ (define-module (language ecmascript compile-tree-il) #:use-module (language tree-il) #:use-module (ice-9 receive) + #:use-module (ice-9 source-properties) #:use-module (system base pmatch) #:use-module (srfi srfi-1) #:export (compile-tree-il)) diff --git a/module/language/ecmascript/function.scm b/module/language/ecmascript/function.scm index 72edc4e61..0d5c24852 100644 --- a/module/language/ecmascript/function.scm +++ b/module/language/ecmascript/function.scm @@ -1,6 +1,6 @@ ;;; ECMAScript for Guile -;; Copyright (C) 2009 Free Software Foundation, Inc. +;; Copyright (C) 2009, 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 @@ -19,6 +19,7 @@ ;;; Code: (define-module (language ecmascript function) + #:use-module (ice-9 weak-tables) #:use-module (oop goops) #:use-module (language ecmascript base) #:export (*function-prototype* *program-wrappers*)) @@ -51,28 +52,28 @@ (apply (js-value this) args)))) (define-method (pget (o <applicable>) p) - (let ((wrapper (hashq-ref *program-wrappers* o))) + (let ((wrapper (doubly-weak-hash-table-ref *program-wrappers* o))) (if wrapper (pget wrapper p) (pget *function-prototype* p)))) (define-method (pput (o <applicable>) p v) - (let ((wrapper (hashq-ref *program-wrappers* o))) + (let ((wrapper (doubly-weak-hash-table-ref *program-wrappers* o))) (if wrapper (pput wrapper p v) (let ((wrapper (make <js-program-wrapper> #:value o #:class "Function" #:prototype *function-prototype*))) - (hashq-set! *program-wrappers* o wrapper) + (doubly-weak-hash-table-set! *program-wrappers* o wrapper) (pput wrapper p v))))) (define-method (js-prototype (o <applicable>)) - (let ((wrapper (hashq-ref *program-wrappers* o))) + (let ((wrapper (doubly-weak-hash-table-ref *program-wrappers* o))) (if wrapper (js-prototype wrapper) #f))) (define-method (js-constructor (o <applicable>)) - (let ((wrapper (hashq-ref *program-wrappers* o))) + (let ((wrapper (doubly-weak-hash-table-ref *program-wrappers* o))) (if wrapper (js-constructor wrapper) #f))) diff --git a/module/language/elisp/boot.el b/module/language/elisp/boot.el index f55722a9a..608c7c960 100644 --- a/module/language/elisp/boot.el +++ b/module/language/elisp/boot.el @@ -1,6 +1,6 @@ ;;; Guile Emacs Lisp -*- lexical-binding: t -*- -;;; Copyright (C) 2011 Free Software Foundation, Inc. +;;; Copyright (C) 2011, 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 License as @@ -505,7 +505,8 @@ (defun lax-plist-put (plist property value) (%plist-put plist property value #'equal)) -(defvar plist-function (funcall (@ (guile) make-object-property))) +(defvar plist-function + (funcall (@ (ice-9 object-properties) make-object-property))) (defun symbol-plist (symbol) (funcall plist-function symbol)) diff --git a/module/language/elisp/compile-tree-il.scm b/module/language/elisp/compile-tree-il.scm index adbeb2005..81211a0a1 100644 --- a/module/language/elisp/compile-tree-il.scm +++ b/module/language/elisp/compile-tree-il.scm @@ -1,6 +1,6 @@ ;;; Guile Emacs Lisp -;; Copyright (C) 2009-2011, 2013, 2018 Free Software Foundation, Inc. +;; Copyright (C) 2009-2011, 2013, 2018, 2025 Free Software Foundation, Inc. ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -20,6 +20,7 @@ ;;; Code: (define-module (language elisp compile-tree-il) + #:use-module (ice-9 source-properties) #:use-module (language elisp bindings) #:use-module (language elisp runtime) #:use-module (language tree-il) @@ -69,7 +70,9 @@ (and (pair? x) (let ((props (source-properties x))) (and (not (null? props)) - props)))) + (vector (assq-ref props 'filename) + (assq-ref props 'line) + (assq-ref props 'column)))))) ;;; Values to use for Elisp's nil and t. diff --git a/module/language/elisp/lexer.scm b/module/language/elisp/lexer.scm index 5a0e6b3ff..f77f0c1c2 100644 --- a/module/language/elisp/lexer.scm +++ b/module/language/elisp/lexer.scm @@ -1,6 +1,6 @@ ;;; Guile Emacs Lisp -;;; Copyright (C) 2009, 2010, 2013 Free Software Foundation, Inc. +;;; Copyright (C) 2009, 2010, 2013, 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,6 +20,7 @@ (define-module (language elisp lexer) #:use-module (ice-9 regex) + #:use-module (ice-9 source-properties) #:export (get-lexer get-lexer/1)) ;;; This is the lexical analyzer for the elisp reader. It is diff --git a/module/language/elisp/parser.scm b/module/language/elisp/parser.scm index a7aeff014..586abbf7e 100644 --- a/module/language/elisp/parser.scm +++ b/module/language/elisp/parser.scm @@ -1,6 +1,6 @@ ;;; Guile Emacs Lisp -;;; Copyright (C) 2009, 2010 Free Software Foundation, Inc. +;;; Copyright (C) 2009, 2010, 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 @@ -19,6 +19,7 @@ ;;; Code: (define-module (language elisp parser) + #:use-module (ice-9 source-properties) #:use-module (language elisp lexer) #:export (read-elisp)) 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)) diff --git a/module/language/tree-il/analyze.scm b/module/language/tree-il/analyze.scm index 418a7ccb0..c081c8844 100644 --- a/module/language/tree-il/analyze.scm +++ b/module/language/tree-il/analyze.scm @@ -71,7 +71,7 @@ given `tree-il' element." (cdr results)))))) ;; Extending and shrinking the location stack. - (define (extend-locs x locs) (cons (tree-il-srcv x) locs)) + (define (extend-locs x locs) (cons (tree-il-src x) locs)) (define (shrink-locs x locs) (cdr locs)) (let ((results @@ -114,7 +114,7 @@ given `tree-il' element." ;; accordingly. (let ((refs (binding-info-refs info)) (vars (binding-info-vars info)) - (src (tree-il-srcv x))) + (src (tree-il-src x))) (define (extend inner-vars inner-names) (fold (lambda (var name vars) (vhash-consq var (list name src) vars)) @@ -525,7 +525,7 @@ given `tree-il' element." (match (vhash-assq name defs) ((_ . previous-definition) (warning 'shadowed-toplevel src name - (tree-il-srcv previous-definition)) + (tree-il-src previous-definition)) defs) (#f (vhash-consq name x defs)))) @@ -926,7 +926,7 @@ given `tree-il' element." (values #f #f)))))))) (let ((args (call-args call)) - (src (tree-il-srcv call))) + (src (tree-il-src call))) (call-with-values (lambda () (arities proc)) (lambda (name arities) (define matches? diff --git a/module/language/tree-il/compile-bytecode.scm b/module/language/tree-il/compile-bytecode.scm index a581b7f6c..947715ca6 100644 --- a/module/language/tree-il/compile-bytecode.scm +++ b/module/language/tree-il/compile-bytecode.scm @@ -1,6 +1,6 @@ ;;; Lightweight compiler directly from Tree-IL to bytecode -;; Copyright (C) 2020-2021,2023 Free Software Foundation, Inc. +;; Copyright (C) 2020-2021,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 License as published by @@ -604,7 +604,7 @@ (() (let () (define x-thunk - (let ((src (tree-il-srcv exp))) + (let ((src (tree-il-src exp))) (make-lambda src '() (make-lambda-case src '() #f #f #f '() '() exp #f)))) (values (cons (make-closure 'init x-thunk #f '()) diff --git a/module/language/tree-il/compile-cps.scm b/module/language/tree-il/compile-cps.scm index ea5be8aa8..6dcb16963 100644 --- a/module/language/tree-il/compile-cps.scm +++ b/module/language/tree-il/compile-cps.scm @@ -1,6 +1,6 @@ ;;; Continuation-passing style (CPS) intermediate language (IL) -;; Copyright (C) 2013-2015,2017-2021,2023 Free Software Foundation, Inc. +;; Copyright (C) 2013-2015,2017-2021,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 @@ -1309,7 +1309,7 @@ use as the proc slot." (define (init-default-value cps name sym subst init body) (match (hashq-ref subst sym) ((orig-var subst-var box?) - (let ((src (tree-il-srcv init))) + (let ((src (tree-il-src init))) (define (maybe-box cps k make-body) (if box? (with-cps cps @@ -1964,10 +1964,10 @@ use as the proc slot." (lambda (cps thunk) (with-cps cps (letk kbody ($kargs () () - ($continue krest (tree-il-srcv body) + ($continue krest (tree-il-src body) ($primcall 'call-thunk/no-inline #f (thunk))))) - (build-term ($prompt kbody khargs (tree-il-srcv body) + (build-term ($prompt kbody khargs (tree-il-src body) #f tag))))))) (with-cps cps (letv prim vals apply) @@ -2223,7 +2223,7 @@ integer." (letk kclause ($kclause ('() '() #f '() #f) kbody #f)) ($ ((lambda (cps) (let ((init (build-cont - ($kfun (tree-il-srcv exp) '() init ktail kclause)))) + ($kfun (tree-il-src exp) '() init ktail kclause)))) (with-cps (persistent-intmap (intmap-replace! cps kinit init)) kinit)))))))) diff --git a/module/language/tree-il/debug.scm b/module/language/tree-il/debug.scm index 2dec39bd0..cf55196fb 100644 --- a/module/language/tree-il/debug.scm +++ b/module/language/tree-il/debug.scm @@ -244,7 +244,7 @@ (visit tail env)) (_ (error "unexpected tree-il" exp))) - (match (tree-il-srcv exp) + (match (tree-il-src exp) (#f #t) (#((or #f (? string?)) (? exact-integer?) (? exact-integer?)) #t) (src (error "bad src" src))) diff --git a/module/language/tree-il/letrectify.scm b/module/language/tree-il/letrectify.scm index 0f9c6aa3c..3b79d24fa 100644 --- a/module/language/tree-il/letrectify.scm +++ b/module/language/tree-il/letrectify.scm @@ -1,6 +1,6 @@ ;;; transformation of top-level bindings into letrec* -;; Copyright (C) 2019-2021,2023 Free Software Foundation, Inc. +;; Copyright (C) 2019-2021,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 @@ -190,7 +190,7 @@ (cons name names) (cons var vars) (cons val vals) tail)) (_ - (make-letrec (tree-il-srcv tail) #t + (make-letrec (tree-il-src tail) #t (list name) (list var) (list val) tail)))) diff --git a/module/language/tree-il/peval.scm b/module/language/tree-il/peval.scm index 27a0acbcb..5940c00f0 100644 --- a/module/language/tree-il/peval.scm +++ b/module/language/tree-il/peval.scm @@ -1,6 +1,6 @@ ;;; Tree-IL partial evaluator -;; Copyright (C) 2011-2014,2017,2019-2024 Free Software Foundation, Inc. +;; Copyright (C) 2011-2014,2017,2019-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 @@ -110,7 +110,7 @@ "Discard all but the first value of X." (if (singly-valued-expression? x) x - (make-primcall (tree-il-srcv x) 'values (list x)))) + (make-primcall (tree-il-src x) 'values (list x)))) ;; Peval will do a one-pass analysis on the source program to determine ;; the set of assigned lexicals, and to identify unreferenced and diff --git a/module/language/tree-il/spec.scm b/module/language/tree-il/spec.scm index 05decf1a9..57f67bc9b 100644 --- a/module/language/tree-il/spec.scm +++ b/module/language/tree-il/spec.scm @@ -1,6 +1,6 @@ ;;; Tree Intermediate Language -;; Copyright (C) 2009-2011,2013,2015,2020 Free Software Foundation, Inc. +;; Copyright (C) 2009-2011,2013,2015,2020,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 @@ -21,6 +21,7 @@ (define-module (language tree-il spec) #:use-module (system base language) #:use-module (ice-9 match) + #:use-module (ice-9 source-properties) #:use-module (language tree-il) #:use-module ((language tree-il analyze) #:select (make-analyzer)) #:use-module ((language tree-il optimize) #:select (make-lowerer)) diff --git a/module/language/wisp.scm b/module/language/wisp.scm index d53a886a1..97bb508a6 100644 --- a/module/language/wisp.scm +++ b/module/language/wisp.scm @@ -1,6 +1,6 @@ ;;; Wisp -;; Copyright (C) 2013, 2017, 2018, 2020, 2024 Free Software Foundation, Inc. +;; Copyright (C) 2013, 2017, 2018, 2020, 2024, 2025, 2025 Free Software Foundation, Inc. ;; Copyright (C) 2014--2023 Arne Babenhauserheide. ;; Copyright (C) 2023 Maxime Devos <maximedevos@telenet.be> @@ -37,6 +37,7 @@ #:use-module (srfi srfi-1) #:use-module (srfi srfi-11); for let-values #:use-module (srfi srfi-9); for records + #:use-module (ice-9 source-properties) #:use-module (ice-9 rw); for write-string/partial #:use-module (ice-9 match)) |