Backwards arrow compound punctuator
Nobody has claimed this yet.
- Dominant language
- reStructuredText
- Stars
- 497
- Forks
- 41
- Avg merge
- 3h 52m
- Merged PRs (30d)
- 4
Description
Hi. (I read the contribution guidelines and I think I'm flagging this for you as a mistake in the spec, rather than as an upstream change. I hope this is helpful.)
rustc rejects <-: it is lexed as a single token, which isn't legal anywhere. For < followed by - one must write < - :
error: unexpected token: `<-`
--> src/main.rs:2:22
|
2 | println!("{}", 4 <- 3);
| ^^
|
help: if you meant to write a comparison against a negative value, add a space in between `<` and `-`
However the spec section 2 doesn't seem to discuss this. I think this should probably be fixed by adding <- to the table of compund punctuators (2.2.8) and the table of punctuator names (2.2.13).
The impact seems very low; it just means that rustc rejects some programs that the spec regards as correct.
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
Locate the FLS source for spec section 2 and read the compound punctuators table in 2.2.8 alongside the punctuator names table in 2.2.13. Update both tables to account for <-, then verify that the specification consistently describes this lexical case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100