mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-28 16:00:22 +02:00
fix alpha-rename for kwargs
* module/language/tree-il/optimize.scm (alpha-rename): Fix alpha-renaming of keyword arguments.
This commit is contained in:
parent
a4c7fe5cde
commit
c829531a46
1 changed files with 12 additions and 2 deletions
|
@ -65,9 +65,19 @@ references to the new symbols."
|
|||
(append req
|
||||
(or opt '())
|
||||
(if rest (list rest) '())
|
||||
(if kw (map cadr (cdr kw)) '()))))
|
||||
(match kw
|
||||
((aok? (_ name _) ...) name)
|
||||
(_ '())))))
|
||||
(mapping (fold vhash-consq mapping gensyms new)))
|
||||
(make-lambda-case src req opt rest kw inits new
|
||||
(make-lambda-case src req opt rest
|
||||
(match kw
|
||||
((aok? (kw name old) ...)
|
||||
(cons aok? (map list
|
||||
kw
|
||||
name
|
||||
(take-right new (length old)))))
|
||||
(_ #f))
|
||||
inits new
|
||||
(loop body mapping)
|
||||
(and alt (loop alt mapping)))))
|
||||
(($ <lexical-ref> src name gensym)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue