0a40b91d7902367a2fec139ad5d5a883322c8729 — Evan Hanson 3 months ago 3c96b67
Avoid warnings for problems originating outside the current source file
2 files changed, 18 insertions(+), 2 deletions(-)

M lib/beaker.scm
M tests/examples.scm
M lib/beaker.scm => lib/beaker.scm +15 -2
@@ 31,6 31,7 @@
  (define global-identifiers (make-vector 32 '()))
  (define warnings (make-vector 128 '()))
  (define deferred-analysers '())
  (define line-number-database (make-vector 1024 '()))

  (define for-each* (flip for-each))

@@ 291,8 292,20 @@
        ;; NOTE we expand the form first so that the compiler's
        ;; syntax checks run and we can assume the form is valid
        (receive (x* m) (next x e c)
          (analyse-expression x)
          (values x* m)))))
          (fluid-let ((##sys#line-number-database line-number-database))
            (analyse-expression x)
            (values x* m))))))

   (let ((done #f)
         (next (or (user-preprocessor-pass) values)))
     (lambda (x)
       (when (and (not done) ##sys#line-number-database)
         (set! done #t)
         (hash-table-for-each (lambda (k v)
                                (hash-table-set! line-number-database k v))
       (next x))))

   (let ((next (or (user-pass) values)))

M tests/examples.scm => tests/examples.scm +3 -0
@@ 30,3 30,6 @@

(let* ((x x)) (let* ((y y)) (void x y))) ;> ("examples.scm:31" warning nested-let*)
(let* ((x x)) (let ((y y)) (void x y)))

;; https://todo.sr.ht/~evhan/beaker/5
(module foo ())