Skip to content

fix: align Lua 5.2 string and table argument conversion - #381

Merged
akeit0 merged 3 commits into
mainfrom
codex/pr-lua52-string-table-arguments
Oct 27, 2026
Merged

akeit0 merged 3 commits into
mainfrom
codex/pr-lua52-string-table-arguments

Conversation

@akeit0

@akeit0 akeit0 commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

Truncate fractional string indices, character codes, repetition counts and table insert/remove positions before applying bounds. string.rep('ab',2.9,':') now returns ab:ab. Share safe index conversion so large positions cannot wrap, and evaluate sort's length metamethod before validating the comparator.

Also return string.char's rented builder buffer when argument validation fails. Tests cover fractional and extreme positions, byte/UTF-16 character ranges, failure recovery and sort side-effect order. The full test suite passes on .NET 8/10; CSharpier passes.

@akeit0
akeit0 force-pushed the codex/pr-lua52-numeric-coercion branch from 4411bb5 to 10f4662 Compare October 27, 2026 02:56
@akeit0
akeit0 force-pushed the codex/pr-lua52-string-table-arguments branch from d549634 to 05051bb Compare October 27, 2026 02:56
@akeit0
akeit0 force-pushed the codex/pr-lua52-numeric-coercion branch from 10f4662 to f7bd5df Compare October 27, 2026 03:11
@akeit0
akeit0 force-pushed the codex/pr-lua52-string-table-arguments branch from 05051bb to 385f661 Compare October 27, 2026 03:11
@akeit0
akeit0 changed the base branch from codex/pr-lua52-numeric-coercion to main October 27, 2026 03:28
@akeit0
akeit0 marked this pull request as ready for review October 27, 2026 03:28
@akeit0
akeit0 force-pushed the codex/pr-lua52-string-table-arguments branch from 385f661 to fd783ab Compare October 27, 2026 03:28
@akeit0
akeit0 merged commit c7806ac into main Oct 27, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant