jorendorff / es-spec-html

An HTML version of the ECMAScript draft specification autogenerated from the source
http://ecma-international.org/ecma-262/5.1/
51 stars 17 forks source link

It would be great to hyperlink references to algorithms like IteratorBindingInitialization #90

Open caitp opened 9 years ago

caitp commented 9 years ago

Like, in https://people.mozilla.org/~jorendorff/es6-draft.html#sec-functiondeclarationinstantiation when referencing IteratorBindingInitialization (or other algorithms), it would be really great if they were hyperlinked so that there was less searching (especially on mobile) :>

I realize it would be easier to do this if the word document provided more specific info, but it would be nice =)

jmdyck commented 9 years ago

Where would the link go to? There are 2 sections that define IteratorBindingInitialization: 14.1.18 and 14.2.14. (In general, an operation that is 'sub-defined' based on grammar productions is defined over multiple non-contiguous sections.)

For a while, the draft spec had an annex that listed such operations, and the sections where they were defined. That would have provided a plausible endpoint for such a hyperlink.

caitp commented 9 years ago

I know :( --- Like I said, "it would be easier..." but I think it could be possible to special case some of them in the mean time

Maybe @allenwb would be willing to make some adjustments to the document to be specific about which version is being referred to

jmdyck commented 9 years ago

It sounds like you're assuming that an invocation of such an operation will only 'resolve' to one sub-definition in practice. (And so, if the spec could just hint which one that was, the hyperlink could go to it.)

But in general, that's not the case. For instance, in the example you cite, in FunctionDeclarationInstantiation, the calls to IteratorBindingInitialization will sometimes resolve to a sub-definition in 14.1.18, and sometimes to a sub-definition in 14.2.14. So it's not like the spec can provide more specific info that would allow you to link to just one or the other.

caitp commented 9 years ago

awbjs covered that point on the bug. I think it's bogus, since each listing for these algorithms contains numerous separate algorithms anyways, depending on the grammar it's operating on.

But regardless, it should be able to show a list of each version, with a short description (which would be easier if some metadata for each one were provided), and just generally save a lot of time when digging through the draft

jmdyck commented 9 years ago

awbjs covered that point on the bug.

Specifically, https://bugs.ecmascript.org/show_bug.cgi?id=4275 (for anyone else reading this issue).

I think it's bogus, since each listing for these algorithms contains numerous separate algorithms anyways, depending on the grammar it's operating on.

I don't follow why that makes you think it's bogus.

But regardless, it should be able to show a list of each version, with a short description

So something like the annex I mentioned? Maybe AWB could be persuaded to reinstate it in the draft spec for ES7. But, yes, the HTML version of ES6 could conceivably generate something like that "on its own".

caitp commented 9 years ago

I don't follow why that makes you think it's bogus.

Linking to 13.2.3.6 would still be linking to a polymorphic set of steps --- it's just that there are multiple sets of these polymorphic sets of steps (which is weird, but I guess that's useful for the paper edition)