Skip to content

fix: move comment out of the foreign return table#6

Merged
Unisay merged 1 commit into
masterfrom
fix/euclideanring-foreign-comment
Jun 13, 2026
Merged

fix: move comment out of the foreign return table#6
Unisay merged 1 commit into
masterfrom
fix/euclideanring-foreign-comment

Conversation

@Unisay

@Unisay Unisay commented Jun 13, 2026

Copy link
Copy Markdown
Collaborator

Follow-up to #5.

The Lua 5.1 compat commit left the math.maxinteger note inside the returned table in Data/EuclideanRing.lua. pslua's foreign parser treats only the lines before return as a verbatim header and parses the rest as Lua, so a comment in the table is rejected with unexpected '-' and Data.EuclideanRing fails to link.

This slipped through CI because scripts/build ran each pslua invocation unchecked — the script exited 0 and the run went green while the linker error scrolled past in the log. set -euo pipefail makes a codegen failure fail the build, so this class of error can't pass silently again.

Verified locally: nix develop -c ./scripts/build now links Data.EuclideanRing and exits 0.

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.
@Unisay Unisay merged commit e924d7e into master Jun 13, 2026
1 check passed
@Unisay Unisay deleted the fix/euclideanring-foreign-comment branch June 13, 2026 20:29
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