Skip to content

Conversation

etaoins
Copy link
Contributor

@etaoins etaoins commented Jan 31, 2018

Currently ', " and \ are escaped as \', \" and \\ respectively. This leads to confusing messages such as error: unknown start of token: \\ when encountering a single backslash.

Fix by emitting printable ASCII characters directly. This will still escape \r, \n, \t and Unicode characters.

Fixes #47902

Currently ', " and \ are escaped as \', \" and \\ respectively. This
leads to confusing messages such as `error: unknown start of token: \\`
when encountering a single backslash.

Fix by emitting printable ASCII characters directly. This will still
escape \r, \n, \t and Unicode characters.

Fixes #47902
@rust-highfive
Copy link
Contributor

r? @petrochenkov

(rust_highfive has picked a reviewer for you, use r? to override)

@petrochenkov
Copy link
Contributor

Thanks!
@bors r+

@bors
Copy link
Collaborator

bors commented Jan 31, 2018

📌 Commit b9441f2 has been approved by petrochenkov

@petrochenkov petrochenkov added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Jan 31, 2018
kennytm added a commit to kennytm/rust that referenced this pull request Feb 2, 2018
…r-msg, r=petrochenkov Improve char escaping in lexer messages Currently ', " and \ are escaped as \', \" and \\ respectively. This leads to confusing messages such as `error: unknown start of token: \\` when encountering a single backslash. Fix by emitting printable ASCII characters directly. This will still escape \r, \n, \t and Unicode characters. Fixes rust-lang#47902
@Mark-Simulacrum
Copy link
Member

@bors rollup

bors added a commit that referenced this pull request Feb 3, 2018
Rollup of 10 pull requests

- Successful merges: #46156, #47829, #47842, #47898, #47914, #47916, #47919, #47942, #47951, #47973
- Failed merges: #47753
@bors bors merged commit b9441f2 into rust-lang:master Feb 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants