|
730 | 730 | `(,(car sig) ,item ,@(cdr sig))
|
731 | 731 | `(,item ,@sig)))
|
732 | 732 |
|
| 733 | +(define (linenode-string lno) |
| 734 | + (cond ((length= lno 2) (string " around line " (cadr lno))) |
| 735 | + ((length= lno 3) (string " around " (caddr lno) ":" (cadr lno))) |
| 736 | + (else ""))) |
| 737 | + |
733 | 738 | (define (ctor-signature name params bounds method-params sig)
|
734 | 739 | (if (null? params)
|
735 | 740 | (if (null? method-params)
|
|
774 | 779 | body))
|
775 | 780 | (lno (if (null? lnos) '() (car lnos))))
|
776 | 781 | (syntax-deprecation #f
|
777 |
| - (string "inner constructor " name "(...)" |
778 |
| - (cond ((length= lno 2) (string " around line " (cadr lno))) |
779 |
| - ((length= lno 3) (string " around " (caddr lno) ":" (cadr lno))) |
780 |
| - (else ""))) |
| 782 | + (string "inner constructor " name "(...)" (linenode-string lno)) |
781 | 783 | (deparse `(where (call (curly ,name ,@params) ...) ,@params)))))
|
782 | 784 | `(,keyword ,sig ,(ctor-body body params)))))))
|
783 | 785 |
|
@@ -3228,6 +3230,7 @@ f(x) = yt(x)
|
3228 | 3230 | (let ((code '())
|
3229 | 3231 | (filename 'none)
|
3230 | 3232 | (first-line #t)
|
| 3233 | + (current-loc #f) |
3231 | 3234 | (rett #f)
|
3232 | 3235 | (arg-map #f) ;; map arguments to new names if they are assigned
|
3233 | 3236 | (label-counter 0) ;; counter for generating label addresses
|
@@ -3320,7 +3323,8 @@ f(x) = yt(x)
|
3320 | 3323 | (and (pair? e) (or (eq? (car e) 'outerref)
|
3321 | 3324 | (eq? (car e) 'globalref))
|
3322 | 3325 | (eq? (cadr e) '_))))
|
3323 |
| - (syntax-deprecation #f "_ as an rvalue" "")) |
| 3326 | + (syntax-deprecation #f (string "_ as an rvalue" (linenode-string current-loc)) |
| 3327 | + "")) |
3324 | 3328 | (cond (tail (emit-return e1))
|
3325 | 3329 | (value e1)
|
3326 | 3330 | ((or (eq? e1 'true) (eq? e1 'false)) #f)
|
@@ -3561,6 +3565,7 @@ f(x) = yt(x)
|
3561 | 3565 | ((import importall using export line meta inbounds boundscheck simdloop)
|
3562 | 3566 | (let ((have-ret? (and (pair? code) (pair? (car code)) (eq? (caar code) 'return))))
|
3563 | 3567 | (cond ((eq? (car e) 'line)
|
| 3568 | + (set! current-loc e) |
3564 | 3569 | (if first-line
|
3565 | 3570 | (begin (set! first-line #f)
|
3566 | 3571 | (emit e))
|
|
0 commit comments