Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify tab can be escaped (or not) in basic strings #878

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions toml.md
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,8 @@ For convenience, some popular characters have a compact escape sequence.
\UXXXXXXXX - unicode (U+XXXXXXXX)
```

Tab characters can be used either directly or in their escaped form `\t`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is covered on line 277. I'm not sure what this clarification achieves.

Copy link
Author

@abravalheri abravalheri Feb 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @pradyunsg, thank you very much for the review.

I don't think line 277 covers the same content though.

Line 277 says that \t is a escape code for the tab character, but it does not explicitly say tab characters can be used directly also.

That in theory is covered by line 266. However it is hard to understand because of the double negative, and it is immediately followed by an example that shows an escaped character.

The idea of this addition is to explicitly state it can be used both ways, which is not explicitly stated elsewhere.

As a non native speaker, I had a hard time processing this info, so I was hoping to make it clearer.

Copy link
Author

@abravalheri abravalheri Feb 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In other ways the information I am hoping to convey with that phrase is that people should not be afraid of using an "unescaped" tab char (which is not covered on line 277).


Any Unicode character may be escaped with the `\uXXXX` or `\UXXXXXXXX` forms.
The escape codes must be valid Unicode [scalar
values](https://unicode.org/glossary/#unicode_scalar_value).
Expand Down