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

StatementList incorrectly linked in chapter 15 #365

Closed
simevidas opened this Issue Feb 5, 2016 · 1 comment

Comments

Projects
None yet
3 participants
@simevidas

simevidas commented Feb 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?

@jmdyck

This comment has been minimized.

Show comment
Hide comment
@jmdyck

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.

Collaborator

jmdyck commented Feb 6, 2016

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.

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