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 escape in literal convention (#987). #1173

Merged
merged 2 commits into from
Nov 9, 2019

Conversation

skynavga
Copy link
Collaborator

@skynavga skynavga commented Oct 4, 2019

Closes #987.

@skynavga skynavga added this to the 2ED-FPWD milestone Oct 4, 2019
@skynavga skynavga self-assigned this Oct 4, 2019
Copy link
Contributor

@palemieux palemieux left a comment

Choose a reason for hiding this comment

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

Why does \ require escaping in string literals?

@skynavga
Copy link
Collaborator Author

skynavga commented Oct 5, 2019

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
Copy link
Contributor

palemieux commented Oct 11, 2019

What about one of the following existing escaping mechanisms:

  • double-quoted-string
  • escaping as used in XML attributes

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
Copy link
Collaborator Author

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.

@skynavga skynavga modified the milestones: 2ED-CR, 3ED Oct 11, 2019
spec/ttml2.xml Show resolved Hide resolved
@css-meeting-bot
Copy link
Member

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

  • SUMMARY: @skynavga to make changes as minuted above.
The full IRC log of that discussion <nigel> Topic: Clarify escape in literal convention (#987). ttml2#1173
<nigel> github: https://github.com//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 skynavga removed the agenda label Nov 7, 2019
@skynavga skynavga modified the milestones: 3ED, 2ED-CR Nov 7, 2019
@skynavga
Copy link
Collaborator Author

skynavga commented Nov 8, 2019

@palemieux can you approve or drop you change request?

@skynavga skynavga merged commit d614574 into master Nov 9, 2019
@skynavga skynavga deleted the issue-0987-escape-in-literal branch November 9, 2019 01:06
@skynavga skynavga removed their assignment Nov 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clarify that \\ in specification literals means a single backslash.
4 participants