Skip to content

Editorial: Stylize strings as values.#396

Merged
leobalter merged 2 commits intotc39:masterfrom
bocoup:string-literal-conversion
Dec 20, 2019
Merged

Editorial: Stylize strings as values.#396
leobalter merged 2 commits intotc39:masterfrom
bocoup:string-literal-conversion

Conversation

@spectranaut
Copy link

This follows the convention set in ECMA-262 to format strings as literals (*"string*" instead of `"string"`, see PR: tc39/ecma262#1733) and closes #54.

There is also one commit that adds a link in 5. Notational Conventions to ECMA-262.

While reviewing, consider the following conventions from ECMA-262 that I'm not positive apply here:

  • Tilde for spec-interal values: I couldn't find an example of a spec internal value in ECMA-402 that is not also a string specified somewhere else, such as the IANA Time Zone Database or Unicode. Because the string is not an internal arbitrary value it doesn't seem like we should use ~.
  • Notation for code points: I don't have an opinion on whether we should stylize characters the way ECMA-262 now stylizing code points, I'm curious if others do.

Copy link
Member

@rkirsling rkirsling left a comment

Choose a reason for hiding this comment

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

Woot! I'm so jealous that 402 is a multi-file spec. 😄


<p>
EXAMPLES `"ß"` (U+00DF) must not match or be mapped to `"SS"` (U+0053, U+0053). `"ı"` (U+0131) must not match or be mapped to `"I"` (U+0049).
EXAMPLES *"ß"* (U+00DF) must not match or be mapped to *"SS"* (U+0053, U+0053). *"ı"* (U+0131) must not match or be mapped to *"I"* (U+0049).
Copy link
Member

Choose a reason for hiding this comment

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

The only concern I see is that we may wish to change cases like *"ß"* (U+00DF) to `ß` (U+00DF) throughout this file, in alignment with, say, Note 4 of 21.2.2.8.2 in 262.

I don't have a strong opinion on this though, particularly since we're referring to these as "characters". (@jmdyck, what do you think?)

Copy link

Choose a reason for hiding this comment

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

It seems to me that it's incorrect for the preceding para to talk about ES String values as if they consist of Unicode code points.

Copy link
Member

Choose a reason for hiding this comment

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

I believe this can be done through a separate patch if necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

All string literals must be code formatted

4 participants