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 upStatementList incorrectly linked in chapter 15 #365
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jmdyck
Feb 6, 2016
Collaborator
In issue #370, @bterlson said:
I still need to implement a primary attribute in emu due to the usage of real productions in clause 5 (eg. WhileStatement).
E.g., an attribute on <emu-grammar> that says "Don't link to these productions, they're just examples"?
But consider this generalization of the problem: when Annex B mentions a nonterminal (in a production or in prose), and there's a production for that nonterminal in Annex B, the mention should presumably link to the Annex B production. But currently, if there's a production for that nonterminal in the body of the spec, it'll link to that one instead. [edit: see issue #326]
So however you solve the Annex B problem, you could probably use the same mechanism to solve the clause 5 problem.
I had been thinking that, instead of the boolean attribute suggested above, you could have an attribute ('arena', say), that takes a name, e.g. <emu-grammar arena="annexB"> which would then generate fragment identifiers like #prod-annexB-DecimalIntegerLiteral. The problem with that is, an attribute on emu-grammar only affects the rendered content of the emu-grammar, and there are lots of nonterminals in Annex B outside of emu-grammars. And you certainly don't want to be attaching an 'arena' attribute to each of them.
So now I'm thinking that what you want is an attribute on emu-clause/emu-annex, e.g.:
<emu-clause id="sec-notational-conventions" grammar-arena="example">
<emu-annex id="sec-...-for-web-browsers" grammar-arena="annexB">
This would then be inherited all the way down to emu-grammar, emu-alg, etc.
|
In issue #370, @bterlson said:
E.g., an attribute on But consider this generalization of the problem: when Annex B mentions a nonterminal (in a production or in prose), and there's a production for that nonterminal in Annex B, the mention should presumably link to the Annex B production. But currently, if there's a production for that nonterminal in the body of the spec, it'll link to that one instead. [edit: see issue #326] So however you solve the Annex B problem, you could probably use the same mechanism to solve the clause 5 problem. I had been thinking that, instead of the boolean attribute suggested above, you could have an attribute ('arena', say), that takes a name, e.g. So now I'm thinking that what you want is an attribute on emu-clause/emu-annex, e.g.:
This would then be inherited all the way down to emu-grammar, emu-alg, etc. |
simevidas commentedFeb 5, 2016
I'm looking at the web version of the spec here: http://tc39.github.io/ecma262/
In chapter 15, it says that ScriptBody translates to StatementList, but when I click on the StatementList link (specifically http://tc39.github.io/ecma262/#prod-StatementList ), I'm redirected to section 5.1.5 which states that StatementList can either be an expression or return statement. This seems to be just an example. The actual StatementList production is in 13.2 where it says that it translates to a list of statements and declarations.
I was confused by this. Could you make http://tc39.github.io/ecma262/#prod-StatementList link to the correct definition in 13.2?