Skip to content

Fix reserved-body to use quoted rather than literal #415

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

Merged
merged 2 commits into from
Jul 24, 2023

Conversation

eemeli
Copy link
Collaborator

@eemeli eemeli commented Jul 10, 2023

This was missed in #364, which was introduced before but merged after #374. Previously included in #414.

reserved-body needs to allow for quoted values (which were named literal at the time of its writing) to support expressions like

{^foo |some {text} here|}

as the {} within the | quotes does not need to be escaped.

As is, the ABNF is a bit broken for reserved-body as there are characters that are valid as either reserved-char or literal.

@eemeli eemeli added the Agenda+ Requested for upcoming teleconference label Jul 10, 2023
@eemeli eemeli requested review from aphillips and stasm July 10, 2023 08:58
@aphillips
Copy link
Member

Actually, I think this might be wrong. The idea was that the contents of reserved-body would be completely opaque and have no predefined structure. Thus I think it might be:

reserved = (reserved-start / private-start) *text

Note that text requires that { and } be escaped, which is necessary because those characters are part of the enclosing syntax.

Copy link
Member

@aphillips aphillips left a comment

Choose a reason for hiding this comment

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

See comment.

@eemeli
Copy link
Collaborator Author

eemeli commented Jul 10, 2023

Actually, I think this might be wrong. The idea was that the contents of reserved-body would be completely opaque and have no predefined structure. Thus I think it might be:

reserved = (reserved-start / private-start) *text

Note that text requires that { and } be escaped, which is necessary because those characters are part of the enclosing syntax.

My comment on this in the original PR still stands: #374 (comment)

@aphillips
Copy link
Member

If one unreserved a sigil, e.g. @, the specification would include a production for the unreserved value. Updated processors would parse inside the resulting placeholder. Non-updated processors would ignore the entire placeholder. There is no need to reserve the literal quote sigil in a private use or reserved block because it doesn't mean anything there--and it is important that it not mean anything there.

The reserved-body production does not allow {@foo bar={|literal|}} (which is your example) because the { and } inside the body have to be escaped--but that escaping would prevent bar's assignment when @ becomes unreserved. We currently don't allow any nested placeholders, so escaping { and } works. But reserving the quote character means that the reserved body has to be changed.

@eemeli
Copy link
Collaborator Author

eemeli commented Jul 11, 2023

@aphillips I think we're trying to do two different things here.

When #374 was merged as b3b9feb on 24 April, the relevant spec ended up with:

literal = "|" *(literal-char / literal-escape) "|"

reserved-body = *( [s] 1*(reserved-char / reserved-escape / literal))

I'm trying to fix an oversight that was introduced in b042c4a merging #364 on 5 June, which should have included the changes of this PR. As a result of that PR, we ended up with:

literal = quoted / unquoted

quoted = "|" *(quoted-char / quoted-escape) "|"

reserved-body = *( [s] 1*(reserved-char / reserved-escape / literal))

Notice how reserved-body should have been updated, but it was not. This is what I want to fix here.

If we would like to reconsider the actual makeup of reserved-body, that is a different discussion that would be much clearer after this PR is merged, when our starting point would not be a broken ABNF.

@aphillips
Copy link
Member

@eemeli Fair enough. I created #417 as a placeholder for fixing the reserved production.

@aphillips aphillips merged commit e52a5c2 into unicode-org:main Jul 24, 2023
@eemeli eemeli deleted the fix-reserved branch July 24, 2023 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Agenda+ Requested for upcoming teleconference
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants