-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Normative: plug some holes in the coverage of syntax-directed operations #1301
Conversation
spec.html
Outdated
<emu-alg> | ||
1. Return *false*. | ||
</emu-alg> | ||
<emu-grammar>ObjectBindingPattern : `{` BindingPropertyList `,` BindingRestProperty `}`</emu-grammar> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks weird since we don't list the chain production, but makes sense.
@bmeck, are you still requesting changes on this PR? |
spec.html
Outdated
<emu-grammar> | ||
ObjectBindingPattern : | ||
`{` `}` | ||
`{` BindingRestProperty `}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively (and more analogous to BindingRestElement), we could return true false from BindingRestProperty : ...
BindingIdentifier instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why true?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, I meant false.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could, and let the chain rule take care of ContainsExpression for
ObjectBindingPattern : `{` BindingRestProperty `}`
but then for consistency, we'd also have to change the alg for
ObjectBindingPattern : `{` BindingPropertyList `,` BindingRestProperty `}`
from
1. Return ContainsExpression of |BindingPropertyList|.
to
1. Let _has_ be ContainsExpression of |BindingPropertyList|.
1. If _has_ is *true*, return *true*.
1. Return ContainsExpression of |BindingRestProperty|.
Personally, I don't think the analogy with BindingRestElement
is worth the added complication.
Changing from Editorial to Normative based on this comment from @ljharb. |
Rebased to master and added 3 more commits. |
forced-pushed to resolve a merge-conflict. (PR #1608 added a definition for IsSimpleParameterList in a way that was different from (but equivalent to) my former 5th commit, which has now disappeared.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rubberstamp based on editor call and previous approvals
(See also #1861, though it's slightly nonobvious what the right thing is in that case.) |
…ons (tc39#1301) - CoveredCallExpression: change production When an SDO is applied to a Parse Node, the appropriate definition of the SDO is the one for the production of which the Parse Node is an instance (ignoring the complication of chain productions). The only invocation of CoveredCallExpression is on a |CoverCallExpressionAndAsyncArrowHead|, so we expect CoveredCallExpression to be defined on CoverCallExpressionAndAsyncArrowHead : MemberExpression Arguments not CallExpression : CoverCallExpressionAndAsyncArrowHead - BoundNames: add def for ObjectBindingPattern BoundNames was missing a definition for ObjectBindingPattern : `{` BindingPropertyList `,` BindingRestProperty `}` - ContainsExpression: add a few defs ContainsExpression was missing definitions for: ObjectBindingPattern : `{` BindingRestProperty `}` ObjectBindingPattern : `{` BindingPropertyList `,` BindingRestProperty `}` ArrowParameters : CoverParenthesizedExpressionAndArrowParameterList - ExpectedArgumentCount: add a few defs ExpectedArgumentCount was missing definitions for: FormalParameters : FunctionRestParameter FormalParameterList : FormalParameter ArrowParameters : CoverParenthesizedExpressionAndArrowParameterList - CoveredFormalsList: add a def CoveredFormalsList was missing a definition for CoverParenthesizedExpressionAndArrowParameterList : `(` Expression `,` `)` - IteratorBindingInitialization: add a def IteratorBindingInitialization was missing a definition for: ArrowParameters : CoverParenthesizedExpressionAndArrowParameterList - HasCallInTailPosition: add a few defs HasCallInTailPosition was missing definitions for the 3 IterationStatement : `for` `await` `(` productions. - define 3 SDOs on empty FunctionStatementList specifically: - ContainsDuplicateLabels - ContainsUndefinedBreakTarget - ContainsUndefinedContinueTarget - MV: add def for Hex4Digits PR tc39#984 added a reference to "the MV of |Hex4Digits|" (in the definition of CharacterValue) but didn't add a definition for it. Extract one from the definition for "the SV of |Hex4Digits|". - eliminate unsupported "SV of |SourceCharacter|" We have rules that say the TRV of something is: - the SV of the |SourceCharacter| that is that single code point; or - the SV of the |SourceCharacter| that is that |HexDigit|. but there's no definition for the SV of |SourceCharacter|. We could add such a definition, except that these usages are already odd, in that they introduce a |SourceCharacter| nonterminal when there isn't one in the parse tree. So instead, fix that oddity by eliminating the references to SV and |SourceCharacter|. And since I'm in the neighborhood, The TRV of a |HexDigit| ... is weird. No other SDO rule is written that way. Change it to: The TRV of <emu-grammar>HexDigit :: ....</emu-grammar> ...
(I think there are still some coverage holes in Evaluation, but that's a bit tricky.)
(Plus there's the bug in VarScopedDeclarations addressed by PR #1284.)