[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] GNU Guile branch, master, updated. release_1-9-4-14-gb70
From: |
Ludovic Courtès |
Subject: |
[Guile-commits] GNU Guile branch, master, updated. release_1-9-4-14-gb70f43e |
Date: |
Wed, 21 Oct 2009 22:54:13 +0000 |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".
http://git.savannah.gnu.org/cgit/guile.git/commit/?id=b70f43e318b60f00776fae5580914f31937ec0d8
The branch, master has been updated
via b70f43e318b60f00776fae5580914f31937ec0d8 (commit)
via b6d2306d4011909d02c655124f08aaf990a0c07d (commit)
from 60c8ad9ea3e84c4957d978afc6c311b490e8e5b2 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit b70f43e318b60f00776fae5580914f31937ec0d8
Author: Ludovic Courtès <address@hidden>
Date: Thu Oct 22 00:51:53 2009 +0200
Remove obsolete `save-stack' case.
* module/ice-9/boot-9.scm (save-stack): Remove obsolete `tk-stack' case.
commit b6d2306d4011909d02c655124f08aaf990a0c07d
Author: Ludovic Courtès <address@hidden>
Date: Thu Oct 22 00:37:36 2009 +0200
Have `-Wunbound-variable' account for GOOPS top-level definitions.
* module/language/tree-il/analyze.scm (goops-toplevel-definition): New
procedure.
(report-possibly-unbound-variables): Check for GOOPS top-level
definitions.
* test-suite/tests/tree-il.test ("warnings")["GOOPS definitions are
visible"]: New test.
-----------------------------------------------------------------------
Summary of changes:
module/ice-9/boot-9.scm | 2 --
module/language/tree-il/analyze.scm | 28 ++++++++++++++++++++++++++++
test-suite/tests/tree-il.test | 15 +++++++++++++++
3 files changed, 43 insertions(+), 2 deletions(-)
diff --git a/module/ice-9/boot-9.scm b/module/ice-9/boot-9.scm
index 7af2fd4..5852477 100644
--- a/module/ice-9/boot-9.scm
+++ b/module/ice-9/boot-9.scm
@@ -2630,8 +2630,6 @@ module '(ice-9 q) '(make-q q-length))}."
(apply make-stack #t save-stack primitive-eval #t 0 narrowing))
((load-stack)
(apply make-stack #t save-stack 0 #t 0 narrowing))
- ((tk-stack)
- (apply make-stack #t save-stack tk-stack-mark #t 0 narrowing))
((#t)
(apply make-stack #t save-stack 0 1 narrowing))
(else
diff --git a/module/language/tree-il/analyze.scm
b/module/language/tree-il/analyze.scm
index 42ad74d..352462f 100644
--- a/module/language/tree-il/analyze.scm
+++ b/module/language/tree-il/analyze.scm
@@ -633,6 +633,23 @@
(defs toplevel-info-defs) ;; (VARIABLE-NAME ...)
(locs toplevel-info-locs)) ;; (LOCATION ...)
+(define (goops-toplevel-definition proc args)
+ ;; If application of PROC to ARGS is a GOOPS top-level definition, return
+ ;; the name of the variable being defined; otherwise return #f. This
+ ;; assumes knowledge of the current implementation of `define-class' et al.
+ (record-case proc
+ ((<module-ref> mod public? name)
+ (and (equal? mod '(oop goops))
+ (not public?)
+ (eq? name 'toplevel-define!)
+ (pair? args) (pair? (cdr args)) (null? (cddr args))
+ (record-case (car args)
+ ((<const> exp)
+ (and (symbol? exp)
+ exp))
+ (else #f))))
+ (else #f)))
+
;; TODO: Combine with `report-unused-variables' so we don't traverse the tree
;; once for each warning type.
@@ -682,6 +699,17 @@
(make-toplevel-info (alist-delete name refs eq?)
(cons name defs)
locs))
+
+ ((<application> proc args)
+ ;; Check for a dynamic top-level definition, as is
+ ;; done by code expanded from GOOPS macros.
+ (let ((name (goops-toplevel-definition proc args)))
+ (if (symbol? name)
+ (make-toplevel-info (alist-delete name refs
+ eq?)
+ (cons name defs)
+ locs)
+ (make-toplevel-info refs defs locs))))
(else
(make-toplevel-info refs defs locs)))))
diff --git a/test-suite/tests/tree-il.test b/test-suite/tests/tree-il.test
index ffc1785..90dde7d 100644
--- a/test-suite/tests/tree-il.test
+++ b/test-suite/tests/tree-il.test
@@ -651,4 +651,19 @@
(define chbouib 5)")))
(read-and-compile in
#:env m
+ #:opts %opts-w-unbound)))))))
+
+ (pass-if "GOOPS definitions are visible"
+ (let ((m (make-module))
+ (v (gensym)))
+ (beautify-user-module! m)
+ (module-use! m (resolve-interface '(oop goops)))
+ (null? (call-with-warnings
+ (lambda ()
+ (let ((in (open-input-string
+ "(define-class <foo> ()
+ (bar #:getter foo-bar))
+ (define z (foo-bar (make <foo>)))")))
+ (read-and-compile in
+ #:env m
#:opts %opts-w-unbound)))))))))
hooks/post-receive
--
GNU Guile
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Guile-commits] GNU Guile branch, master, updated. release_1-9-4-14-gb70f43e,
Ludovic Courtès <=