Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Clarify that open-close elements are placeholders, not expressions #540

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
Dec 3, 2023

Conversation

eemeli
Copy link
Collaborator

@eemeli eemeli commented Nov 29, 2023

I noticed that the open-close design doc was in places (like its title...) talking about expressions when it's really about placeholders. In our current syntax, those are synonymous, but the change we're proposing here would make them different, and while markup would be a placeholder, it would not be an expression.

Requesting fast-tracking, as we're currently discussing this in #537.

@eemeli eemeli added design Design document or issues related to design fast-track Editorial change permitted to use fast-track merge rules labels Nov 29, 2023
@eemeli eemeli requested review from aphillips and stasm November 29, 2023 10:26
@aphillips
Copy link
Member

I think that's not quite true. All placeholders are expressions and they would still be expressions after all the various changes. However, the converse would not hold true. Not all expressions are placeholders. So the current text isn't wrong (with current spec wording) and wouldn't technically be wrong post all the changes. But I do think we should clarify the doc, hence giving an approval.

I will note that @stasm has proposed alternatives that do not use placeholders to solve spannable. I don't personally care for these options, but they would use functions to implement spannable and those would be expressions in all senses of the term.

@@ -1,4 +1,4 @@
# Open/Close Expressions
# Open/Close Placeholders
Copy link
Member

Choose a reason for hiding this comment

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

I think we would be better off calling this design "spannable" but don't care that much about it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

All of the options currently being considered are placeholders in a pattern; hence my suggested name for this.

Copy link
Collaborator

Choose a reason for hiding this comment

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

+1 to titling this design doc "Spannables". If you agree, please also rename the file.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I would prefer "placeholders".

@eemeli
Copy link
Collaborator Author

eemeli commented Nov 29, 2023

I think that's not quite true. All placeholders are expressions and they would still be expressions after all the various changes. However, the converse would not hold true. Not all expressions are placeholders. So the current text isn't wrong (with current spec wording) and wouldn't technically be wrong post all the changes. But I do think we should clarify the doc, hence giving an approval.

Do note that the proposed design includes this change to the ABNF:

placeholder = expression / markup
markup = "{" [s] markup-body [s] "}"

The explicit definition of the rule as not being an expression is needed to prevent it from showing up in e.g. local variable declarations. So after the changes here, not all placeholders will be expressions.

@aphillips
Copy link
Member

Is this ready to merge? @stasm looking for any comments.

Copy link
Collaborator

@stasm stasm left a comment

Choose a reason for hiding this comment

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

I think it's good enough to use placeholders here to mean non-text pattern parts.

@@ -1,4 +1,4 @@
# Open/Close Expressions
# Open/Close Placeholders
Copy link
Collaborator

Choose a reason for hiding this comment

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

+1 to titling this design doc "Spannables". If you agree, please also rename the file.

@aphillips
Copy link
Member

@eemeli can you respond to the titling comment yay or nay so I can merge this?

@aphillips
Copy link
Member

Merging fast track fixes.

@aphillips aphillips merged commit f359856 into unicode-org:main Dec 3, 2023
@eemeli eemeli deleted the placeholderize-open-close branch December 3, 2023 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design Design document or issues related to design fast-track Editorial change permitted to use fast-track merge rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants