1837 Commits

Author SHA1 Message Date
Alex Orlenko 1f970824b4 Support user thread creation callback (Luau) 2025-03-28 11:51:35 +00:00
Alex Orlenko 8d864e2687 Reduce stack operations when creating userdata 2025-03-22 14:23:59 +00:00
Alex Orlenko b0140cdb9e Add Chunk::name(), Chunk::environment() and Chunk::mode() functions.
They can be used to retrieve existing chunk params.
2025-03-22 09:31:24 +00:00
Alex Orlenko 806817212e Rename Lua::init_from_ptr to Lua::get_or_init_from_ptr.
Return reference to `&Lua` with unbound lifetime (chosen by user).
2025-03-21 21:28:30 +00:00
Alex Orlenko 95c623e94d Use c string literal where appropriate 2025-03-21 15:57:15 +00:00
Alex Orlenko 0a1a1fe0b6 Move some userdata helpers from crate::util to crate::userdata::util 2025-03-21 15:13:53 +00:00
Alex Orlenko 4fe7d151a1 Refactor userdata-wrappers feature.
Support borrowing underlying data in `UserDataRef` and `UserDataRefMut`.
2025-03-21 14:19:38 +00:00
Alex Orlenko edbf1e9150 Change Lua library name constants from &str to *const c_char.
It makes easier to pass them to Lua API functions.
2025-03-14 23:10:14 +00:00
Alex Orlenko 69011a89d2 Revert "Add initial pluto support"
This reverts commit 0ed11e4134.
2025-03-14 22:59:06 +00:00
Alex Orlenko 0ed11e4134 Add initial pluto support
Pluto is a superset of Lua 5.4 with a focus on general-purpose programming.
`pluto` feature also enables `lua54` feature since they are compatible and share the same API.
2025-03-14 11:38:07 +00:00
Alex Orlenko 0ce599aff2 Update test case 2025-03-13 17:41:13 +00:00
Alex Orlenko 1ebb4b468a Support 52-bit integers for Luau
Simply to float conversion (it actually never fails or goes out of range)
2025-03-13 16:18:44 +00:00
Alex Orlenko 5ab97666d7 Fix clippy warnings 2025-03-07 22:34:50 +00:00
Alex Orlenko e706ae4fcb Remove Roblox from references to Luau
Closes #537
2025-02-24 19:03:36 +00:00
Alex Orlenko ae7cdcb934 Remove (internal) borrow counter and use instead "locked" flag and strong reference counter 2025-02-14 14:41:37 +00:00
Alex Orlenko dacddfa967 Add Variadic to prelude 2025-02-14 12:08:57 +00:00
Alex Orlenko a01b032c35 Add bstr/serde dependency if serialize feature flag is enabled 2025-02-11 13:39:21 +00:00
Alex Orlenko 18497f1528 Add library constants support for Luau compiler.
Add ability to specify compile-time constants for known library members.
2025-02-11 00:16:22 +00:00
Alex Orlenko 28e8f56989 Fix tests 2025-02-09 22:17:25 +00:00
Alex Orlenko c1f8abba9e Do not allow recursive warnings (Lua 5.4) 2025-02-09 15:08:52 +00:00
Alex Orlenko d1a587f49a Wrap hooks in refcounter instead of box, same as previously.
This allows to obtain independent clone of closure.
Ensure that stack is always clean when running thread hook.
2025-02-08 22:11:11 +00:00
Alex Orlenko 5bbd23ed1a Fix hook tests 2025-02-08 11:51:38 +00:00
Alex Orlenko 74b4601b48 Rework Lua hooks:
- Support global hooks inherited by new threads
- Support thread hooks, where each thread can have its own hook

This should also allow to enable hooks for async calls.
Related to #489 #347
2025-02-07 22:42:17 +00:00
Joel Natividad a89800b949 Typos config and ci (#523)
* typos configuration file
* typos CI
2025-02-05 19:02:48 +00:00
Alex Orlenko 2b6172ef38 Fix tests 2025-02-05 19:01:07 +00:00
Joel Natividad 20f7ce097d Fix typos (#522)
* fix various typos in the codebase

* fix typos in CHANGELOG.md
2025-02-05 16:16:20 +00:00
Andrew Farkas 6882e0434e Fix version number in changelog (#521) 2025-02-04 07:33:33 +00:00
Alex Orlenko fca38a6637 Imporove BorrowedStr/BorrowedBytes ergonomic.
Implement `FromLua` and `IntoLua` for these types to allow working with them directly.
2025-01-30 23:07:02 +00:00
Alex Orlenko cdd6a99136 Support Thread::resume_error call (Luau)
This method uses Luau-specific C API extension `lua_resumerror`
that allow to throw an error immediately when resuming a thead.
Closes #500 #513
2025-01-28 22:57:26 +00:00
Alex Orlenko 21d39a069d Pass &Scope instead of &mut Scope to Lua::scope closure.
It was a leftover from an experimental implementation that has been removed.
2025-01-28 18:23:18 +00:00
Alex Orlenko 58965c6255 Move lifetime from AsChunk<'a> to AsChunk::source 2025-01-28 18:17:29 +00:00
Alex Orlenko 8574682ffc Improve From/Into Lua char conversion 2025-01-28 10:41:10 +00:00
tk 47bc372096 impl FromLua/IntoLua for char (#516) 2025-01-28 10:10:28 +00:00
Alex Orlenko d376cb9403 Enable Thread::reset() for all Lua versions 2025-01-28 10:08:16 +00:00
Alex Orlenko ea5ecccf02 Change AsyncThread<A, R> to AsyncThread<R>.
Push arguments in `Thread::into_async()` to the thread during the call instead of first poll.
The pushed arguments will be automatically used on resume.
Fixes #508 and relates to #500.
2025-01-28 10:08:08 +00:00
Alex Orlenko cf71edc492 Update README (set main branch for development) 2025-01-28 10:07:41 +00:00
Alex Orlenko 9caf3542d9 v0.10.3 v0.10.3 2025-01-27 21:33:51 +00:00
Alex Orlenko cb45db05fa Update README/CHANGELOG 2025-01-27 21:33:24 +00:00
Alex Orlenko d1cb2a9a96 mlua-sys: v0.6.7 2025-01-27 21:20:47 +00:00
Alex Orlenko aa3f6ba46c Fix prototype of new Luau compiler options and methods 2025-01-27 21:19:31 +00:00
Alex Orlenko cc57bed4c8 Update Luau to 0.657 2025-01-27 14:19:40 +00:00
Radiant b5d38ab2e3 Set Default for LuaValue to be nil. (#512) 2025-01-19 23:52:58 +00:00
Alex Orlenko cd4091f64d Allow exhaustive match on Value.
It was not possible because `ValueRef` variant in `Value::Other` was private.
Closes #502 and #503
2024-12-10 23:37:19 +00:00
Alex Orlenko 91e069a77e Optimize (and simplify) protected mode for Rust function calls 2024-12-07 00:04:12 +00:00
Alex Orlenko cacd3dc70f Add Table::set_safeenv method (Luau) 2024-12-04 10:40:49 +00:00
Alex Orlenko 6f6cda0099 v0.10.2 v0.10.2 2024-12-01 13:04:06 +00:00
Alex Orlenko d51ce86142 mlua-sys: v0.6.6 2024-12-01 12:56:39 +00:00
Alex Orlenko aa061bce6f mlua_derive: v0.10.1 2024-12-01 12:55:50 +00:00
Alex Orlenko 1c6b6ad801 Fix tests 2024-12-01 12:54:35 +00:00
Evie 031854fa2a Switch proc-macro-error to proc-macro-error2 (#493) 2024-11-30 22:37:40 +00:00