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

Should the note about restricted productions include expressionless 'yield'? #1192

Open
DanielRosenwasser opened this Issue May 10, 2018 · 4 comments

Comments

Projects
None yet
6 participants
@DanielRosenwasser

DanielRosenwasser commented May 10, 2018

In https://tc39.github.io/ecma262/#sec-rules-of-automatic-semicolon-insertion, the noted restricted productions are not complete, but notice that

ReturnExpression
    return;

is documented, but not

YieldExpression
    yield

I believe the idea is just to illustrate the two possible conditions where an expression may or may not be present, so I think yield should be documented the same.

image

@littledan

This comment has been minimized.

Show comment
Hide comment
@littledan

littledan May 11, 2018

Member

@DanielRosenwasser I agree that we should document it similarly. PRs are welcome. cc @bmeck

Member

littledan commented May 11, 2018

@DanielRosenwasser I agree that we should document it similarly. PRs are welcome. cc @bmeck

@bmeck

This comment has been minimized.

Show comment
Hide comment
@bmeck

bmeck May 11, 2018

Member

Yes we should probably document this.

Member

bmeck commented May 11, 2018

Yes we should probably document this.

@allenwb

This comment has been minimized.

Show comment
Hide comment
@allenwb

allenwb May 11, 2018

Member

I'm less sure.

The origin of this text dates all the way back to ES1 when there were only three restricted productions in the language. In that context it probably made sense to list them there. But now that the list is long and growing, it's less clear that a redundant list makes sense. Redundant non-normative lists have perennially had the problem of getting out of date. Yet people tend to read them as if they are complete and normative.

My suggestion is that instead of trying to list all of the restricted production, to either delete the entire note, or to change it into providing a clarifying example of a single restricted production.

Member

allenwb commented May 11, 2018

I'm less sure.

The origin of this text dates all the way back to ES1 when there were only three restricted productions in the language. In that context it probably made sense to list them there. But now that the list is long and growing, it's less clear that a redundant list makes sense. Redundant non-normative lists have perennially had the problem of getting out of date. Yet people tend to read them as if they are complete and normative.

My suggestion is that instead of trying to list all of the restricted production, to either delete the entire note, or to change it into providing a clarifying example of a single restricted production.

@bterlson

This comment has been minimized.

Show comment
Hide comment
@bterlson

bterlson May 14, 2018

Member

I think we can keep this up to date personally. Since the grammar annex is auto-generated, it's a simple ctrl+F for restricted productions :)

Member

bterlson commented May 14, 2018

I think we can keep this up to date personally. Since the grammar annex is auto-generated, it's a simple ctrl+F for restricted productions :)

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