suite: triage and promote literals/goto/events/nextvar files#251
Merged
Conversation
Address a batch of conformance gaps that surfaced when running each official Lua 5.3 suite file in isolation. nextvar.lua now passes fully; literals.lua, goto.lua, and events.lua run with targeted skip ranges instead of `:all`. Behavioural fixes: - lexer: long strings drop a leading newline and normalise CR/CRLF/LFCR to a single LF (§3.1). - parser: reject non-lvalue assignment targets (e.g. `0 = 1`) with a syntax error instead of crashing codegen. - scope: if/while/repeat/for bodies are their own lexical scopes; locals declared inside no longer leak past the block (§3.3.4). - executor: __eq follows Lua 5.3 selection rules — first operand's metamethod, falling back to the second's, without the same-function requirement — and is only consulted for table-vs-table. - executor: 0^(-n) yields the inf sentinel; NaN comparisons return false per IEEE 754. - stdlib/table.insert: raise "wrong number of arguments" for >3 args. - stdlib/ipairs: route lookups through __index so user-supplied metamethods drive iteration (§6.1). - stdlib/type(): raise "value expected" with no args. - stdlib/debug.getinfo(N): return the calling frame's line and source via the executor's current_position + call_stack. - stdlib/math: add math.modf (integer-preserving) and math.ult. - stdlib/string.find: handle negative init, init past length, and truthy (non-`true`) plain flag. - stdlib/string.byte: PUC-Lua posrelat semantics for i and j. Regressions pinned by new unit tests under test/lua/ covering each fix. mix test: 1914 passing, 0 failures, 26 skipped.
This was referenced May 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Triage of the Lua 5.3 official suite, fixing concrete gaps and promoting four files out of the broad
:allskip:nextvar.lua— fully passing (was:all)events.lua— runs with one targeted skip range (was:all)goto.lua— runs with one targeted skip range (was:all)literals.lua— runs with six targeted skip ranges (was:all)Remaining
:allfiles now carry specific reasons intest/lua53_skips.exs(e.g.checkerrorformat mismatches, missingutf8library, coroutines unimplemented) instead of "pending initial triage".Behavioural fixes
\r/\r\n/\n\rto\nper §3.1.0 = 1) with a syntax error instead of crashing codegen.if/while/repeat/forbodies are now their own lexical scopes — locals declared inside no longer leak past the block (§3.3.4).__eq: Lua 5.3 selection rules — first operand's metamethod, falling back to the second's; the same-function constraint from Lua 5.1 is dropped; only consulted for table-vs-table.0^(-n)yields the inf sentinel; NaN comparisons returnfalseper IEEE 754.table.insert: raise "wrong number of arguments" with more than 3 args.ipairs: route lookups through__indexso user metamethods drive iteration (§6.1).type(): raise "value expected" with no args (was returning"nil").debug.getinfo(N): return the calling frame's line and source via the executor'scurrent_position+call_stack.math: addmath.modf(preserves integer parts) andmath.ult.string.find: handle negativeinit,init > #s + 1, and truthy (non-true) plain flag.string.byte: PUC-Luaposrelatsemantics foriandj.Test plan
mix test— 1914 passing, 0 failures, 26 skipped (was 1907 passing before this PR)mix compile --warnings-as-errorsmix format(no diff)mix lua.suite --statusshows 4 files promoted out of:alltest/lua/lexer_test.exs,test/lua/vm/metatable_test.exs,test/lua/vm/nextvar_semantics_test.exspin each fix