CR in string continuation escapes
Nobody has claimed this yet.
- Dominant language
- reStructuredText
- Stars
- 497
- Forks
- 41
- Avg merge
- 3h 52m
- Merged PRs (30d)
- 4
Description
Rust accepts the following as a simple string literal, even though it contains a CR:"a\␊␍b" (where ␊ indicates an LF control character and ␍ indicates a CR control character).
The FLS defines StringContinuation in §2.4.6.1:2 (fls_wawtu6j3fiqn) as follows:
StringContinuation is the character sequence 0x5C 0x0A (reverse solidus, new line).
With that definition, the above example would be rejected.
The Reference models this situation by treating all the characters which will be removed by the string continuation escape as part of the escape.
I think it would make sense to look at this together with describing how literals containing StringContinuation are evaluated (#590).
NB the Reference has a note (in expr.literal.continuation) saying that the behaviour of string continuation escapes may change in a backwards-incompatible manner in future.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with FLS §2.4.6.1:2, the Reference's expr.literal.continuation note, and issue #590. Compare the formal StringContinuation definition with the Reference's treatment of removed characters, then clarify the specification consistently with literal evaluation. Done means the CR behavior and any compatibility implications are explicitly described.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100