State the bare-CR line rule in C-220 and C-225 - #112
Merged
Merged
Conversation
…tor's string.lines and fs line splitter Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ngs_bare_cr fixture Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
almide/almide#2813 (reported by atzurody): the incumbent wasm leg stripped a trailing bare
\rfrom the last line ofstring.lines/fs.read_lines/fs.fold_lines—"abc\r"read as["abc"]where native (str::lines) and the structural leg read["abc\r"].The ledger text invited it: C-220 and C-225 said "one trailing \r stripped per line", which is exactly the incumbent's behaviour on an unterminated last line. And the reference evaluator carried the same rule — both
string.lines(ref/src/stdlib.rs) and the fs splittersplit_lines(ref/src/stdlib_ext.rs) popped a\rfrom the final unterminated line.\r; a\ris removed only together with the\nit precedes.spec/wasm_cross/line_endings_bare_cr.almd(evidence for both): CR at the end, doubled at the end, ending the last of two lines, mid-line, before a CRLF, and alone — each line printed with its CRs spelled out, overstring.lines,fs.read_lines,fs.fold_lines(String / Int / fallible) andfs.for_each_line.Local:
conformance.py --legs cross,refover the new fixture plusstring_lines.almd/fs_read_lines.almdagainst the fixed almide build: 3/3 cross, 3/3 ref (judged, no abstain). All pre-commit gates green.The implementation PR (almide) follows after this merges and the pin advances.