w3c / ttml2

Timed Text Markup Language 2 (TTML2)
https://w3c.github.io/ttml2/
Other
41 stars 16 forks source link

Clarify escape in literal convention (#987). #1173

Closed skynavga closed 4 years ago

skynavga commented 4 years ago

Closes #987.

skynavga commented 4 years ago

Why does \ require escaping in string literals?

Because '\' in syntax literals is considered an escape character. Indeed, to get one backslash to appear here in a github comment, I am forced to use two backslashes. If one had only a bare single backslash in a specified string literal, then it would be interpreted as an escape for whatever character follows, which if no character follows, would be a syntax error due to an incomplete escape.

palemieux commented 4 years ago

What about one of the following existing escaping mechanisms:

Just trying to avoid defining yet another escaping mechanism.

Because '\' in syntax literals is considered an escape character.

Not in ANBF syntax, for example.

skynavga commented 4 years ago

Moving this PR (and related Issue) to 3ED, as the commenter is asking for a change unrelated to the original issue which was merely to clarify the meaning of \\ and not to question the existence of the convention.

css-meeting-bot commented 4 years ago

The Timed Text Working Group just discussed Clarify escape in literal convention (#987). ttml2#1173, and agreed to the following:

The full IRC log of that discussion <nigel> Topic: Clarify escape in literal convention (#987). ttml2#1173
<nigel> github: https://github.com/w3c/ttml2/pull/1173
<nigel> Nigel: We seem to be trying to escape backslashes here without defining an escape mechanism.
<nigel> .. Perhaps we don't need to do anything here?
<nigel> Glenn: In TTML2 we introduced something absent from TTML1. In `<quoted-string>` in TTML2 we introduce an
<nigel> .. escaping mechanism.
<nigel> -> https://w3c.github.io/ttml2/index.html#content-value-quoted-string `<quoted-string>` in TTML2 ED
<cyril> rrsagent, pointer
<RRSAgent> See https://www.w3.org/2019/11/07-tt-irc#T16-45-30
<nigel> Nigel: We invoke a backslash in the syntax there.
<nigel> Glenn: If you look at TTML1 3rd Ed ... It's there.
<nigel> Nigel: TTML1 3rd Ed has it under `<familyName>`
<nigel> Glenn: [looks] it's in TTML1 2nd Ed too, maybe I didn't look well enough and it's in 1st Ed too!
<nigel> .. It wasn't in 1st Ed, we added it in 2nd Ed. So it's been around a while, but not in the very beginning. We didn't use it
<nigel> .. in any of TTML1 in the syntax descriptions, we didn't use the double backquote.
<nigel> .. When we normalised the syntax in TTML2 we changed all the literals to string literals; we had used character literals
<nigel> .. with single quotes in TTML1 2nd and 3rd Edition.
<nigel> Nigel: Why don't we do something really simple here, to say where we use `\\` what we mean is a single backslash?
<nigel> .. The PR has a "for example" but I'm proposing making it not an example, but the rule.
<nigel> Glenn: Problem is you could escape quotation marks.
<nigel> Nigel: But we don't
<nigel> Glenn: But we could
<nigel> Nigel: But we don't
<nigel> Glenn: The quotation marks are only significant only after escape processing should ...
<nigel> Nigel: But it's our choice in the spec if we use that anywhere and I don't believe we do, so we don't need this.
<nigel> Glenn: Ah I see what you're saying. Are you sure we don't?
<nigel> Nigel: It's worth checking
<nigel> Glenn: You're correct we don't at present do that.
<nigel> Nigel: So the only thing we need to define is that \\ means \ in the document content.
<nigel> Glenn: Just remove "after escape processing"?
<nigel> Nigel: Also make the note in 2190-2192 in this PR normal spec text and remove "For example,"
<nigel> Glenn: Oh I see what you're saying.
<nigel> Pierre: If I understand, instead of making a blanket statement about escaping, merely state this specific case?
<nigel> Nigel: Yes
<nigel> Pierre: I agree with that, it's the simplest and safest approach.
<nigel> Glenn: OK, regarding lines 2188 and 2189, shall I revert those to the original text?
<nigel> Nigel: I would say so, yes.
<nigel> Glenn: Ok so revert those and then change 2190-2193 to normative text and remove the "for example" and that's it.
<nigel> Nigel: Yes
<nigel> Glenn: Sounds good, I can do that. I'll change this to 2nd Ed CR milestone.
<nigel> Nigel: Brilliant, thank you.
<nigel> SUMMARY: @skynavga to make changes as minuted above.
skynavga commented 4 years ago

@palemieux can you approve or drop you change request?