Skip to content

fix: align Lua 5.2 printf rules and quoted numeric strings - #383

Merged
akeit0 merged 5 commits into
mainfrom
codex/pr-lua52-printf
Oct 27, 2026
Merged

akeit0 merged 5 commits into
mainfrom
codex/pr-lua52-printf

Conversation

@akeit0

@akeit0 akeit0 commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

Apply Lua 5.2's finite printf defaults, precision, flags, sign/prefix padding and integer coercion, and support hexadecimal/octal conversions. Numeric %q now quotes the existing numeric text: loading string.format('%q',1.5) returns the string '1.5'. Reject unsupported %q types and ignore its width/precision/flags.

Malformed format suffixes now raise Lua errors instead of CLR indexing exceptions, and argument errors identify the correct conversion argument. Numeric precision and special-value spelling are handled separately in #384.

Validation: all 3,240 finite native-format comparisons agree; the full test suite passes on .NET 8/10; all four library targets build; CSharpier passes.

@akeit0
akeit0 force-pushed the codex/pr-lua52-printf branch from 40527c1 to 8f5f178 Compare October 27, 2026 02:56
@akeit0
akeit0 force-pushed the codex/pr-lua52-pattern-semantics branch from af9d933 to de564a8 Compare October 27, 2026 02:56
@akeit0
akeit0 force-pushed the codex/pr-lua52-printf branch from 8f5f178 to 1c99995 Compare October 27, 2026 03:11
@akeit0
akeit0 force-pushed the codex/pr-lua52-pattern-semantics branch from de564a8 to 25d22c2 Compare October 27, 2026 03:11
@akeit0
akeit0 changed the base branch from codex/pr-lua52-pattern-semantics 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-printf branch from 1c99995 to d2d1fe5 Compare October 27, 2026 03:28
@akeit0
akeit0 merged commit ad530ca 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