|
1154 | 1154 | (parse-atom s))))
|
1155 | 1155 |
|
1156 | 1156 | (define (parse-def s is-func anon)
|
1157 |
| - (let ((ex (parse-unary-prefix s))) |
1158 |
| - (if (and (pair? ex) (eq? (car ex) 'macrocall)) |
1159 |
| - ex |
1160 |
| - (let* ((sig (if (or (and is-func (reserved-word? ex)) (initial-reserved-word? ex)) |
1161 |
| - (error (string "invalid name \"" ex "\"")) |
1162 |
| - (parse-call-chain s ex #f))) |
1163 |
| - (decl-sig |
1164 |
| - (if (and is-func (eq? (peek-token s) '|::|)) |
1165 |
| - (begin (take-token s) |
1166 |
| - `(|::| ,sig ,(parse-call s))) |
1167 |
| - sig))) |
1168 |
| - (if (eq? (peek-token s) 'where) |
1169 |
| - (parse-where-chain s decl-sig) |
1170 |
| - decl-sig))))) |
| 1157 | + (let* ((ex (parse-unary-prefix s)) |
| 1158 | + (sig |
| 1159 | + (if (and (pair? ex) (eq? (car ex) 'macrocall)) ex |
| 1160 | + (if (or (and is-func (reserved-word? ex)) (initial-reserved-word? ex)) |
| 1161 | + (error (string "invalid name \"" ex "\"")) |
| 1162 | + (parse-call-chain s ex #f)))) |
| 1163 | + (decl-sig |
| 1164 | + (if (and is-func (eq? (peek-token s) '|::|)) |
| 1165 | + (begin (take-token s) |
| 1166 | + `(|::| ,sig ,(parse-call s))) |
| 1167 | + sig))) |
| 1168 | + (if (eq? (peek-token s) 'where) |
| 1169 | + (parse-where-chain s decl-sig) |
| 1170 | + decl-sig))) |
1171 | 1171 |
|
1172 | 1172 | (define (disallowed-space-error lno ex t)
|
1173 | 1173 | (error (string "space before \"" t "\" not allowed in \""
|
|
1331 | 1331 |
|
1332 | 1332 | (define (valid-func-sig? paren sig)
|
1333 | 1333 | (and (pair? sig)
|
1334 |
| - (or (eq? (car sig) 'macrocall) |
1335 |
| - (eq? (car sig) 'call) |
1336 |
| - (eq? (car sig) 'tuple) |
| 1334 | + (or (memq (car sig) '(macrocall call tuple)) |
1337 | 1335 | (and paren (eq? (car sig) 'block))
|
1338 | 1336 | (and paren (eq? (car sig) '...))
|
1339 | 1337 | (and (eq? (car sig) '|::|)
|
1340 | 1338 | (pair? (cadr sig))
|
1341 |
| - (eq? (car (cadr sig)) 'call)) |
| 1339 | + (memq (car (cadr sig)) '(call macrocall))) |
1342 | 1340 | (and (eq? (car sig) 'where)
|
1343 | 1341 | (valid-func-sig? paren (cadr sig))))))
|
1344 | 1342 |
|
|
0 commit comments