fix: move comment out of the foreign return table#6
Merged
Conversation
pslua's foreign parser only treats lines before "return" as a verbatim
header; a comment inside the returned table is parsed as Lua and
rejected ("unexpected '-'"). The Lua 5.1 compat commit left the
math.maxinteger note inside the table, so linking Data.EuclideanRing
failed.
scripts/build swallowed that: each pslua call ran unchecked, so the
script exited 0 and CI went green while the linker error scrolled past.
Add set -euo pipefail so a codegen failure actually fails the build.
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.
Follow-up to #5.
The Lua 5.1 compat commit left the
math.maxintegernote inside the returned table inData/EuclideanRing.lua. pslua's foreign parser treats only the lines beforereturnas a verbatim header and parses the rest as Lua, so a comment in the table is rejected withunexpected '-'andData.EuclideanRingfails to link.This slipped through CI because
scripts/buildran eachpsluainvocation unchecked — the script exited 0 and the run went green while the linker error scrolled past in the log.set -euo pipefailmakes a codegen failure fail the build, so this class of error can't pass silently again.Verified locally:
nix develop -c ./scripts/buildnow linksData.EuclideanRingand exits 0.