-
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
Editorial: Update clause range references #2133
Conversation
Nice catch.
Yeah, if you replace I think that's probably better than updating the numbers manually. Do you want to do update all the explicit references to clause numbers yourself? I can take care of it otherwise. |
References wouldn't get stale, but it'd still be baking in an assumption that the relevant clauses appear in order and fully encompass the standard library (which would be violated if a standard library section is added before The Global Object or after Reflection, or if either of those move). It would be best if there were a single link target, but I understand not wanting to incur the additional depth hit for what is probably the most popular 40% of the spec (or wait for TOC construction changes supporting subsection promotion). Given the above, do you still want the explicit references? |
I'm not sure what you're suggesting here; can you sketch an example?
Yeah, I think |
E.g., if you took clauses "The Global Object" through "Reflection" and made them children of a new emu-clause (called, say, "The ECMAScript Standard Library"), then you could xref to that one clause rather than to "clauses 17 through 27". |
There are also clause-range references in 4.5 Organization of This Specification. |
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.
Thanks much! I'll add a lint rule against for [Cc]lauses? \d
at some point so we don't risk having this problem again.
@@ -541,7 +541,7 @@ <h1>The Syntactic Grammar</h1> | |||
</emu-note> | |||
<emu-note>Parse Nodes are specification artefacts, and implementations are not required to use an analogous data structure.</emu-note> | |||
<p>Productions of the syntactic grammar are distinguished by having just one colon “<b>:</b>” as punctuation.</p> | |||
<p>The syntactic grammar as presented in clauses 12, 13, 14 and 15 is not a complete account of which token sequences are accepted as a correct ECMAScript |Script| or |Module|. Certain additional token sequences are also accepted, namely, those that would be described by the grammar if only semicolons were added to the sequence in certain places (such as before line terminator characters). Furthermore, certain token sequences that are described by the grammar are not considered acceptable if a line terminator character appears in certain “awkward” places.</p> | |||
<p>The syntactic grammar as presented in clauses <emu-xref href="#sec-ecmascript-language-expressions"></emu-xref> through <emu-xref href="#sec-ecmascript-language-scripts-and-modules"></emu-xref> is not a complete account of which token sequences are accepted as a correct ECMAScript |Script| or |Module|. Certain additional token sequences are also accepted, namely, those that would be described by the grammar if only semicolons were added to the sequence in certain places (such as before line terminator characters). Furthermore, certain token sequences that are described by the grammar are not considered acceptable if a line terminator character appears in certain “awkward” places.</p> |
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.
I'd rather list them out instead of using a range. Now we're dependent on the clause ordering. If we list them out, we can re-order clauses all we want without breaking these references.
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.
@michaelficarra We'd still need to update this sentence because such a reordering would result in these being listed out of order.
More generally, I think readability ought to take precedence over maintainability (especially for things which rarely require maintenance, as here), and I think "as presented in clauses 12 through 15" is more readable than "as presented in clauses 12, 13, 14, and 15", so I would prefer to keep the current PR's wording.
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.
I will reluctantly accept this change since it is easy and doesn't make things worse. For posterity, my preference would be to list out an <emu-xref>
for each clause, and when ecmarkup sees that they represent a range, it could render it as we see here. This would address the issues of finding occurrences of the clause ID within the source and including the reference in a clause's reference list. But the other editors don't agree it's worthwhile.
c8387b8
to
93ac768
Compare
The "Managing Memory" clause inserted by 71c0897 broke some clause range references. We might want a more automated way to catch this, but such restructuring is rare and in the meantime it's just a handful of changes to merge.