|
240 | 240 | (pair? (caddr e)) (memq (car (caddr e)) '(quote inert)) |
241 | 241 | (symbol? (cadr (caddr e)))))) |
242 | 242 |
|
243 | | -;; e.g. Base.(:+) is deprecated in favor of Base.:+ |
244 | | -(define (deprecate-dotparen e) |
245 | | - (if (and (length= e 3) (eq? (car e) '|.|) |
246 | | - (or (atom? (cadr e)) (sym-ref? (cadr e))) |
247 | | - (length= (caddr e) 2) (eq? (caaddr e) 'tuple) |
248 | | - (pair? (cadr (caddr e))) (memq (caadr (caddr e)) '(quote inert))) |
249 | | - (let* ((s_ (cdadr (caddr e))) |
250 | | - (s (if (symbol? s_) s_ |
251 | | - (if (and (length= s_ 1) (symbol? (car s_))) (car s_) #f)))) |
252 | | - (if s |
253 | | - (let ((newe (list (car e) (cadr e) (cadr (caddr e)))) |
254 | | - (S (deparse `(quote ,s)))) ; #16295 |
255 | | - (syntax-deprecation (string (deparse (cadr e)) ".(" S ")") |
256 | | - (string (deparse (cadr e)) "." S) #f) |
257 | | - newe) |
258 | | - e)) |
259 | | - e)) |
260 | | - |
261 | 243 | ;; convert final (... x) to (curly Vararg x) |
262 | 244 | (define (dots->vararg a) |
263 | 245 | (if (null? a) a |
|
1019 | 1001 | ((eq? (car name) 'call) |
1020 | 1002 | (let* ((head (cadr name)) |
1021 | 1003 | (argl (cddr name)) |
1022 | | - (name (deprecate-dotparen head)) |
1023 | | - (op (let ((op_ (maybe-undotop name))) ; handle .op -> broadcast deprecation |
1024 | | - (if op_ |
1025 | | - (syntax-deprecation (string "function " (deparse name) "(...)") |
1026 | | - (string "function Base.broadcast(::typeof(" (deparse op_) "), ...)") #f)) |
1027 | | - op_)) |
1028 | | - (name (if op '(|.| Base (inert broadcast)) name)) |
| 1004 | + (name (check-dotop head)) |
1029 | 1005 | (annotations (map (lambda (a) `(meta ,(cadr a) ,(arg-name (caddr a)))) |
1030 | 1006 | (filter nospecialize-meta? argl))) |
1031 | 1007 | (body (insert-after-meta (caddr e) annotations)) |
1032 | 1008 | (argl (map (lambda (a) |
1033 | 1009 | (if (nospecialize-meta? a) (caddr a) a)) |
1034 | 1010 | argl)) |
1035 | | - (argl (if op (cons `(|::| (call (core Typeof) ,op)) argl) argl)) |
1036 | 1011 | (raw-typevars (or where '())) |
1037 | 1012 | (sparams (map analyze-typevar raw-typevars)) |
1038 | 1013 | (adj-decl (lambda (n) (if (and (decl? n) (length= n 2)) |
|
1893 | 1868 | ((|.|) |
1894 | 1869 | ;; a.b = |
1895 | 1870 | (let* ((a (cadr lhs)) |
1896 | | - (b_ (caddr lhs)) |
1897 | | - (b (if (and (length= b_ 2) (eq? (car b_) 'tuple)) |
1898 | | - (begin |
1899 | | - (syntax-deprecation |
1900 | | - (string (deparse a) ".(" (deparse (cadr b_)) ") = ...") |
1901 | | - (string "setfield!(" (deparse a) ", " (deparse (cadr b_)) ", ...)") #f) |
1902 | | - (cadr b_)) |
1903 | | - b_)) |
| 1871 | + (b (caddr lhs)) |
1904 | 1872 | (rhs (caddr e))) |
| 1873 | + (if (and (length= b 2) (eq? (car b) 'tuple)) |
| 1874 | + (error (string "invalid syntax \"" |
| 1875 | + (string (deparse a) ".(" (deparse (cadr b)) ") = ...") "\""))) |
1905 | 1876 | (let ((aa (if (symbol-like? a) a (make-ssavalue))) |
1906 | 1877 | (bb (if (or (atom? b) (symbol-like? b) (and (pair? b) (quoted? b))) |
1907 | 1878 | b (make-ssavalue))) |
|
0 commit comments