-
Notifications
You must be signed in to change notification settings - Fork 856
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
Conversation
As discussed in toml-lang#877, the current description of basic strings in the docs say that tab characters are allowed. However this text is immediately followed by an example that uses escaped tabs `\t`, which make it a bit ambiguous and hard to understand. The change introduced here explicitly says that tabs can be used either directly or in the escaped form.
c9a41e1
to
ea47153
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for filing this PR! I'm not sure that there's any value in duplicating information that's literally mentioned in a code block above, in prose.
@@ -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`. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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).
Closed in favour of #875 😄 |
As discussed in #877, the current description of basic strings in the docs say that tab characters are allowed.
However this text does it using a double negative (
except... other than...
), and is immediately followed by an example that uses escaped tabs\t
. As a consequence it is a bit hard to understand.The change introduced here explicitly says that tabs can be used either directly or in its escaped form.