|
1408 | 1408 | (loop lst nxt)
|
1409 | 1409 | (let ((params (parse-arglist s closer)))
|
1410 | 1410 | `(vcat ,@params ,@lst ,nxt))))
|
1411 |
| - ((#\] #\}) |
| 1411 | + ((#\]) |
1412 | 1412 | (error (string "unexpected \"" t "\"")))
|
1413 | 1413 | (else
|
1414 | 1414 | (error "missing separator in array expression")))))))
|
|
1758 | 1758 | (else
|
1759 | 1759 | (error "missing separator in tuple")))))))))
|
1760 | 1760 |
|
1761 |
| - ;; cell expression |
| 1761 | + ;; TODO this awaits a decision on {} syntax in 0.4 |
1762 | 1762 | ((eqv? t #\{ )
|
1763 |
| - (take-token s) |
1764 |
| - (if (eqv? (require-token s) #\}) |
1765 |
| - (begin (take-token s) '(cell1d)) |
1766 |
| - (let ((vex (parse-cat s #\}))) |
1767 |
| - (if (null? vex) |
1768 |
| - '(cell1d) |
1769 |
| - (case (car vex) |
1770 |
| - ((comprehension) |
1771 |
| - `(typed_comprehension (top Any) ,@(cdr vex))) |
1772 |
| - ((dict_comprehension) |
1773 |
| - `(typed_dict_comprehension (=> (top Any) (top Any)) ,@(cdr vex))) |
1774 |
| - ((dict) |
1775 |
| - `(typed_dict (=> (top Any) (top Any)) ,@(cdr vex))) |
1776 |
| - ((hcat) |
1777 |
| - `(cell2d 1 ,(length (cdr vex)) ,@(cdr vex))) |
1778 |
| - (else ; (vcat ...) |
1779 |
| - (if (and (pair? (cadr vex)) (eq? (caadr vex) 'row)) |
1780 |
| - (let ((nr (length (cdr vex))) |
1781 |
| - (nc (length (cdadr vex)))) |
1782 |
| - ;; make sure all rows are the same length |
1783 |
| - (if (not (every |
1784 |
| - (lambda (x) |
1785 |
| - (and (pair? x) |
1786 |
| - (eq? (car x) 'row) |
1787 |
| - (length= (cdr x) nc))) |
1788 |
| - (cddr vex))) |
1789 |
| - (error "inconsistent shape in cell expression")) |
1790 |
| - `(cell2d ,nr ,nc |
1791 |
| - ,@(apply append |
1792 |
| - ;; transpose to storage order |
1793 |
| - (apply map list |
1794 |
| - (map cdr (cdr vex)))))) |
1795 |
| - (if (any (lambda (x) (and (pair? x) |
1796 |
| - (eq? (car x) 'row))) |
1797 |
| - (cddr vex)) |
1798 |
| - (error "inconsistent shape in cell expression") |
1799 |
| - `(cell1d ,@(cdr vex)))))))))) |
| 1763 | + (error "{} syntax for Any arrays / dicts has been removed in 0.4dev")) |
1800 | 1764 |
|
1801 | 1765 | ;; cat expression
|
1802 | 1766 | ((eqv? t #\[ )
|
|
0 commit comments