Skip to content
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

Misc Editorial #971

Merged
merged 21 commits into from
Aug 21, 2017
Merged

Misc Editorial #971

merged 21 commits into from
Aug 21, 2017

Conversation

jmdyck
Copy link
Collaborator

@jmdyck jmdyck commented Aug 7, 2017

Reduce variations with respect to Strings and code units.
Introduce the term "reparsing".

@jmdyck jmdyck force-pushed the editorial branch 2 times, most recently from 90b0bf1 to dc60631 Compare August 11, 2017 00:25
@@ -11824,7 +11824,7 @@
TemplateMiddleList[?Yield, ?Await, ?Tagged] TemplateMiddle Expression[+In, ?Yield, ?Await]
</emu-grammar>

<emu-clause id="sec-static-semantics-template-early-errors">
<emu-clause id="sec-static-semantics-template-early-errors" oldids="sec-primary-expression-template-literals-static-semantics-early-errors">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is old-ids a thing I forgot? I think the convention here is in the proper place.

@@ -2910,56 +2910,56 @@
<p>A <dfn id="super-reference">Super Reference</dfn> is a Reference that is used to represents a name binding that was expressed using the super keyword. A Super Reference has an additional thisValue component, and its base value component will never be an Environment Record.</p>
<p>The following abstract operations are used in this specification to operate on references:</p>

<emu-clause id="sec-getbase" aoid="GetBase">
<h1 id="ao-getbase">GetBase ( _V_ )</h1>
<emu-clause id="sec-getbase" aoid="GetBase" oldids="ao-getbase">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, this is what I get for going backward through the commits.

I can add oldids to ecmarkup, but I wonder if it's worth it over just adding an empty anchor. @domenic may have thoughts here too.

jmdyck added 21 commits August 18, 2017 22:40
Specifically, change phrases of the form:
    a String containing N code units <code>"foo<var>XY</var>"</code> where _XY_ are ...
to
    the string-concatenation of `"foo"` and ...
... specifically, where what follows uniquely determines
the String value in question.
... as the latter seems more popular.
... replacing occurrences of:
    the code unit value 0xhhhh
    code unit value 0xhhh
    code unit 0xhhhh
    0xhhhh
... in the definitions of TV and TRV.
... when X is a List.

Ditto one occurrence of "X's length".
The three choices are used almost equally, but "within" wins,
because it's the word used in the definition of the String type.
(Get rid of the phrase "code unit value" in algorithms.)

the code unit value of the string element at index _p_ within _str_
the code unit value of the element at index _p_ within _str_
the code unit value at index _p_ within _str_
->
the numeric value of the code unit at index _p_ within _str_

the numeric code unit value of _code_unit_
the code unit value of _code_unit_
_code_unit_'s code unit value
->
the numeric value of _code_unit_

the code unit value that is _i_
the code unit with code unit value _i_
->
the code unit whose value is _i_

_code_unit_ has a code unit value less than _i_
->
_code_unit_ has a numeric value less than _i_
Change it to "the lexical token sequence matched by |X|".

See tc39#962
Specifically,
    _ParseNode_ cannot be parsed as a _Nonterminal_
and
    the result of reparsing _ParseNode_ as a _Nonterminal_
... where they're no longer referenced by
the associated algorithm or early error rule.
... for preserving old ids that no longer make sense as 'real' ids.
ecmarkup can then take care of generating the anchors so that
external inbound links continue to work.

See https://tabatkins.github.io/bikeshed/#id-gen
…c-semantics-early-errors"

... because commit 138c9ef replaced that id with
id="sec-static-semantics-template-early-errors"
... in header-row of 'Record Fields' tables,
to make them a bit more consistent.
All other <table> elements in the spec have a <tbody>.
@bterlson
Copy link
Member

Ok, I added support for oldids in ecmarkup 3.12 (can be a list, separated by comma).

@@ -483,7 +483,7 @@
<p>When a parse is successful, it constructs a <em>parse tree</em>, a rooted tree structure in which each node is a <dfn>Parse Node</dfn>. Each Parse Node is an <em>instance</em> of a symbol in the grammar; it represents a span of the source text that can be derived from that symbol. The root node of the parse tree, representing the whole of the source text, is an instance of the parse's goal symbol. When a Parse Node is an instance of a nonterminal, it is also an instance of some production that has that nonterminal as its left-hand side. Moreover, it has zero or more <em>children</em>, one for each symbol on the production's right-hand side: each child is a Parse Node that is an instance of the corresponding symbol.</p>
<p>Productions of the syntactic grammar are distinguished by having just one colon &ldquo;<b>:</b>&rdquo; 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 &ldquo;awkward&rdquo; places.</p>
<p>In certain cases, in order to avoid ambiguities, the syntactic grammar uses generalized productions that permit token sequences that do not form a valid ECMAScript |Script| or |Module|. For example, this technique is used for object literals and object destructuring patterns. In such cases a more restrictive <em>supplemental grammar</em> is provided that further restricts the acceptable token sequences. In certain contexts, when explicitly specified, the input elements corresponding to such a production are parsed again using a goal symbol of a supplemental grammar. The input stream is syntactically in error if the tokens in the stream of input elements parsed by a cover grammar cannot be parsed as a single instance of the corresponding supplemental goal symbol, with no tokens left over.</p>
<p>In certain cases, in order to avoid ambiguities, the syntactic grammar uses generalized productions that permit token sequences that do not form a valid ECMAScript |Script| or |Module|. For example, this technique is used for object literals and object destructuring patterns. In such cases a more restrictive <em>supplemental grammar</em> is provided that further restricts the acceptable token sequences. Typically, an early error rule will then define an error condition if "_P_ cannot be <dfn>reparsed</dfn> as an _N_", where _P_ is a Parse Node (an instance of the generalized production) and _N_ is a nonterminal from the supplemental grammar. Here, the sequence of tokens originally matched by _P_ is parsed again using _N_ as the goal symbol. (If _N_ takes grammatical parameters, then they are set to the same values used when _P_ was originally parsed.) An error occurs if the sequence of tokens cannot be parsed as a single instance of _N_, with no tokens left over. Subsequently, algorithms access the result of the parse using a phrase of the form "the result of <dfn>reparsing</dfn> _P_ as an _N_". This will always be a Parse Node (an instance of _N_), since any parsing failure would have been detected by an early error rule.</p>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is so good.

@bterlson bterlson merged commit 958c7b1 into tc39:master Aug 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants