Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upsuffix "opt" are missing in one line grammar (ex. 13.7.4.5) #908
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment
Hide comment
kotarondo
May 4, 2017
Another example for Note2
In 13.3.3.2 Static Semantics: ContainsExpression
BindingElement: BindingPattern Initializer
Return true.
Here you can insert 'opt' suffix after 'Initializer' without any formal contradiction on the spec, but it produces an unexpected specification.
kotarondo
commented
May 4, 2017
Another example for Note2In 13.3.3.2 Static Semantics: ContainsExpression
Here you can insert 'opt' suffix after 'Initializer' without any formal contradiction on the spec, but it produces an unexpected specification. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
kotarondo commentedMay 2, 2017
Summary
For example, in 13.7.4.5
current draft and ES7 displays one line grammar as
If it is read literally, it does not define anything on the following grammar.
This is not what we intend.
On the other hand, ES6 displays:
This is more comprehensive because "opt" is expanded as shown in "5.1.5 Grammar Notation".
NOTE1: How are "opt" suffixes dropped ?
Actually, in the raw html document, these Expressions are given opt suffix,
but they are not displayed because of "ecmarkup.css" line 249:
Here "collapsed" attributes on "emu-production" are given in the build process.
Precisely, they are given in grammarkdown/out/lib/emitter/ecmarkup.js line 36:
where grammarkdown is a npm module called from ecmarkup build tool.
By the way, opt suffixes are DISPLAYED in multiline grammars (ex. 13.7.4.4)
because node.body.kind === tokens_1.SyntaxKind.RightHandSideList.
Anyway, I think the specification contents must be self-contained except for its displaying formats (fonts, etc). Outside format tools must not change the specification contents.
Note2
You can not say "opt suffix is automatically inserted when the corresponding Syntax has it."
because expanded grammars may be referred separately.
For example, In 13.3.2.4
Here we can not insert opt suffix after Initializer
although the corresponding Syntax has it.