lua: loadstring returns compiled fn (errors propagate cleanly); parse-fail → (nil, err)
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:
@@ -1500,9 +1500,12 @@
|
||||
(define
|
||||
lua-loadstring
|
||||
(fn (src)
|
||||
(let ((compiled (lua-transpile src)))
|
||||
(fn (&rest args)
|
||||
(eval-expr (list (make-symbol "let") (list) compiled))))))
|
||||
(guard
|
||||
(e (true (list (quote lua-multi) nil (str e))))
|
||||
(let ((compiled (lua-transpile src)))
|
||||
(let ((wrapped (list (make-symbol "fn") (list (make-symbol "&rest") (make-symbol "__args"))
|
||||
(list (make-symbol "let") (list) compiled))))
|
||||
(eval-expr wrapped))))))
|
||||
|
||||
(define loadstring lua-loadstring)
|
||||
(define load lua-loadstring)
|
||||
|
||||
Reference in New Issue
Block a user