lua_dardo_plus 0.3.0
lua_dardo_plus: ^0.3.0 copied to clipboard
A maintained fork of LuaDardo - Lua 5.3 virtual machine written in pure Dart. Fixes critical bugs in math.random, error messages, return statements, and userdata metatables.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
0.3.0 - 2024-12-29 #
Added #
- Web Platform Support (#28): Full web compatibility via platform abstraction layer
- Conditional imports for
dart:io(native) and web stub PlatformServicessingleton for cross-platform file/process operations- Customizable
printCallbackfor output redirection - Web-safe
oslibrary (time functions work, file operations throwUnsupportedError)
- Conditional imports for
- Async Dart Function Support (#9): Call async Dart functions from Lua
DartFunctionAsynctype:Future<int> Function(LuaState ls)registerAsync(name, func)- Register async function as globalpushDartFunctionAsync(func)- Push async function onto stackpushDartClosureAsync(func, nUpvals)- Push async closure with upvaluescallAsync(nArgs, nResults)- Call function asynchronouslypCallAsync(nArgs, nResults, errFunc)- Protected async calldoStringAsync(code)- Execute Lua string asynchronouslydoFileAsync(path)- Execute Lua file asynchronously
luaUpvalueIndex(i)helper function for accessing upvalues in closures- 93 new tests (136 total, up from 43)
Fixed #
math.minbug: Was returning maximum value instead of minimum (comparison logic inverted)math.modfbug: Was returning only fractional part (return count was 1 instead of 2)
Changed #
- Replaced deprecated
pedanticwithlints: ^4.0.0in dev_dependencies - Updated
testto^1.25.0
0.2.0 - 2024-12-29 #
Added #
- Coroutine Support: Full implementation of Lua coroutine library
coroutine.create(f)- Create a new coroutinecoroutine.resume(co, ...)- Start or resume a coroutinecoroutine.yield(...)- Suspend coroutine executioncoroutine.status(co)- Get coroutine status (running/suspended/dead)coroutine.running()- Get the currently running coroutinecoroutine.wrap(f)- Create a wrapped coroutine function
- New API interfaces:
LuaCoroutineLib,LuaDebug - Thread type support in
LuaValue.typeOf()andLuaValue.typeName() ThreadStatus.luaDeadfor completed coroutines- 10 new coroutine tests
Fixed #
- Issue #13:
string.gsubnow works correctly- Fixed infinite loop when using unlimited replacement (n=-1)
- Fixed off-by-one error in string slicing
- Fixed original string modification during iteration
0.1.0 - 2024-12-29 #
Added #
- Forked from arcticfox1919/LuaDardo v0.0.5
- Comprehensive test suite for bug fixes (21 tests)
- Per-instance metatable support for
Userdataclass - Source location information in error messages (
[source:line]format) CONTRIBUTING.mdwith branch strategy and workflow documentation
Fixed #
- Issue #24:
math.randomnow correctly includes upper bound and supports negative rangesmath.random(1, 10)can now return 10math.random(-10, 10)works correctly
- Issue #33: Error messages now include source file and line number information
- Issue #34:
returnwithout value no longer causes runtime errorreturnandreturn;correctly return nil
- Issue #36: Userdata metatables are now per-instance instead of shared globally
Changed #
- Renamed package from
lua_dardotolua_dardo_plus - Updated SDK constraint to
>=2.17.0 <4.0.0 - Improved README with migration guide and feature documentation
Previous Releases (Original LuaDardo) #
0.0.4 #
- Upgrade null safety
0.0.3 #
- Fix the bug of the table constructor
- Add auxiliary API for reference(
ref/unRef)
0.0.2 #
- Add Lua userdata support
- Fix lexical analysis BUG
0.0.1 #
- A full lua virtual machine
- Support some standard libraries, e.g. String, Math, etc.
- Experimental nature only, not yet fully tested