mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-07-07 13:16:36 +02:00
fixing rest parsing
This commit is contained in:
parent
014aa253d1
commit
28d119426c
1 changed files with 13 additions and 13 deletions
|
@ -541,11 +541,10 @@ div#footer {padding-bottom: 50px}
|
||||||
(lp (cdr ls) (cons (cons (car ls) i) vars) (+ i 1)))
|
(lp (cdr ls) (cons (cons (car ls) i) vars) (+ i 1)))
|
||||||
(else
|
(else
|
||||||
(extract body vars i)))))
|
(extract body vars i)))))
|
||||||
(else
|
(_
|
||||||
(let ((opts (map car (sort vars < cdr)))
|
(let* ((opts (map car (sort vars < cdr)))
|
||||||
(rest-var? (contains? x o)))
|
(rest-var? (contains? x o))
|
||||||
(append (reverse pre)
|
(tail (cond
|
||||||
(cond
|
|
||||||
((and (pair? opts) rest-var?)
|
((and (pair? opts) rest-var?)
|
||||||
(list (append opts o)))
|
(list (append opts o)))
|
||||||
(rest-var?
|
(rest-var?
|
||||||
|
@ -553,7 +552,8 @@ div#footer {padding-bottom: 50px}
|
||||||
((pair? opts)
|
((pair? opts)
|
||||||
(list opts))
|
(list opts))
|
||||||
(else
|
(else
|
||||||
'()))))))))))))
|
o))))
|
||||||
|
(append (reverse pre) tail))))))))))
|
||||||
|
|
||||||
(define (get-procedure-signature mod id proc)
|
(define (get-procedure-signature mod id proc)
|
||||||
(protect (exn (else '()))
|
(protect (exn (else '()))
|
||||||
|
|
Loading…
Add table
Reference in a new issue