lua: Lua 5.0-style arg auto-binding in vararg functions; assert-counter diagnostic +2 tests
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
This commit is contained in:
@@ -180,6 +180,13 @@
|
||||
(make-symbol "__varargs")
|
||||
(list (make-symbol "lua-varargs") (make-symbol "__args") n))))
|
||||
|
||||
(define
|
||||
lua-tx-function-arg-binding
|
||||
(fn (n)
|
||||
(list
|
||||
(make-symbol "arg")
|
||||
(list (make-symbol "lua-varargs-arg-table") (make-symbol "__args") n))))
|
||||
|
||||
(define
|
||||
lua-tx-function
|
||||
(fn
|
||||
@@ -200,7 +207,10 @@
|
||||
(let
|
||||
((all-bindings
|
||||
(if is-vararg
|
||||
(append bindings (list (lua-tx-function-varargs-binding (len params))))
|
||||
(append bindings
|
||||
(list
|
||||
(lua-tx-function-varargs-binding (len params))
|
||||
(lua-tx-function-arg-binding (len params))))
|
||||
bindings)))
|
||||
(list
|
||||
(make-symbol "fn")
|
||||
|
||||
Reference in New Issue
Block a user