Skip to content

Commit

Permalink
Editorial: remove some unnecessary complexity due to the SourceText AO (
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelficarra authored and ljharb committed Sep 1, 2022
1 parent 2fbac0e commit aacf6d3
Showing 1 changed file with 11 additions and 25 deletions.
36 changes: 11 additions & 25 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,7 @@ <h1>Abstract Operations</h1>

<emu-clause id="sec-algorithm-conventions-syntax-directed-operations">
<h1>Syntax-Directed Operations</h1>
<p>A <dfn variants="syntax-directed operations">syntax-directed operation</dfn> is a named operation whose definition consists of algorithms, each of which is associated with one or more productions from one of the ECMAScript grammars. A production that has multiple alternative definitions will typically have a distinct algorithm for each alternative. When an algorithm is associated with a grammar production, it may reference the terminal and nonterminal symbols of the production alternative as if they were parameters of the algorithm. When used in this manner, nonterminal symbols refer to the actual alternative definition that is matched when parsing the source text. The <dfn>source text matched by</dfn> a grammar production or Parse Node derived from it is the portion of the source text that starts at the beginning of the first terminal that participated in the match and ends at the end of the last terminal that participated in the match.</p>
<p>A <dfn variants="syntax-directed operations">syntax-directed operation</dfn> is a named operation whose definition consists of algorithms, each of which is associated with one or more productions from one of the ECMAScript grammars. A production that has multiple alternative definitions will typically have a distinct algorithm for each alternative. When an algorithm is associated with a grammar production, it may reference the terminal and nonterminal symbols of the production alternative as if they were parameters of the algorithm. When used in this manner, nonterminal symbols refer to the actual alternative definition that is matched when parsing the source text. The <dfn oldids="sec-static-semantics-sourcetext">source text matched by</dfn> a grammar production or Parse Node derived from it is the portion of the source text that starts at the beginning of the first terminal that participated in the match and ends at the end of the last terminal that participated in the match.</p>
<p>When an algorithm is associated with a production alternative, the alternative is typically shown without any &ldquo;[ ]&rdquo; grammar annotations. Such annotations should only affect the syntactic recognition of the alternative and have no effect on the associated semantics for the alternative.</p>
<p>Syntax-directed operations are invoked with a parse node and, optionally, other parameters by using the conventions on steps <emu-xref href="#step-sdo-invocation-example-1"></emu-xref>, <emu-xref href="#step-sdo-invocation-example-2"></emu-xref>, and <emu-xref href="#step-sdo-invocation-example-3"></emu-xref> in the following algorithm:</p>
<emu-alg example>
Expand Down Expand Up @@ -34719,16 +34719,16 @@ <h1>Static Semantics: Early Errors</h1>
<emu-grammar>UnicodePropertyValueExpression :: UnicodePropertyName `=` UnicodePropertyValue</emu-grammar>
<ul>
<li>
It is a Syntax Error if the List of Unicode code points that is SourceText of |UnicodePropertyName| is not identical to a List of Unicode code points that is a Unicode property name or property alias listed in the &ldquo;Property name and aliases&rdquo; column of <emu-xref href="#table-nonbinary-unicode-properties"></emu-xref>.
It is a Syntax Error if the source text matched by |UnicodePropertyName| is not a Unicode property name or property alias listed in the &ldquo;Property name and aliases&rdquo; column of <emu-xref href="#table-nonbinary-unicode-properties"></emu-xref>.
</li>
<li>
It is a Syntax Error if the List of Unicode code points that is SourceText of |UnicodePropertyValue| is not identical to a property value or property value alias for the Unicode property or property alias given by SourceText of |UnicodePropertyName| listed in <a href="https://unicode.org/Public/UCD/latest/ucd/PropertyValueAliases.txt"><code>PropertyValueAliases.txt</code></a>.
It is a Syntax Error if the source text matched by |UnicodePropertyValue| is not a property value or property value alias for the Unicode property or property alias given by the source text matched by |UnicodePropertyName| listed in <a href="https://unicode.org/Public/UCD/latest/ucd/PropertyValueAliases.txt"><code>PropertyValueAliases.txt</code></a>.
</li>
</ul>
<emu-grammar>UnicodePropertyValueExpression :: LoneUnicodePropertyNameOrValue</emu-grammar>
<ul>
<li>
It is a Syntax Error if the List of Unicode code points that is SourceText of |LoneUnicodePropertyNameOrValue| is not identical to a Unicode property value or property value alias for the General_Category (gc) property listed in <a href="https://unicode.org/Public/UCD/latest/ucd/PropertyValueAliases.txt"><code>PropertyValueAliases.txt</code></a>, nor a binary property or binary property alias listed in the &ldquo;Property name and aliases&rdquo; column of <emu-xref href="#table-binary-unicode-properties"></emu-xref>.
It is a Syntax Error if the source text matched by |LoneUnicodePropertyNameOrValue| is not a Unicode property value or property value alias for the General_Category (gc) property listed in <a href="https://unicode.org/Public/UCD/latest/ucd/PropertyValueAliases.txt"><code>PropertyValueAliases.txt</code></a>, nor a binary property or binary property alias listed in the &ldquo;Property name and aliases&rdquo; column of <emu-xref href="#table-binary-unicode-properties"></emu-xref>.
</li>
</ul>
</emu-clause>
Expand Down Expand Up @@ -35010,20 +35010,6 @@ <h1>Static Semantics: CharacterValue ( ): a non-negative integer</h1>
</emu-alg>
</emu-clause>

<emu-clause id="sec-static-semantics-sourcetext" type="sdo">
<h1>Static Semantics: SourceText ( ): a List of code points</h1>
<dl class="header">
</dl>
<emu-grammar>
UnicodePropertyNameCharacters :: UnicodePropertyNameCharacter UnicodePropertyNameCharacters?

UnicodePropertyValueCharacters :: UnicodePropertyValueCharacter UnicodePropertyValueCharacters?
</emu-grammar>
<emu-alg>
1. Return the List, in source text order, of Unicode code points in the source text matched by this production.
</emu-alg>
</emu-clause>

<emu-clause id="sec-groupspecifiersthatmatch" type="abstract operation">
<h1>
Static Semantics: GroupSpecifiersThatMatch (
Expand Down Expand Up @@ -35931,17 +35917,17 @@ <h1>
</emu-alg>
<emu-grammar>UnicodePropertyValueExpression :: UnicodePropertyName `=` UnicodePropertyValue</emu-grammar>
<emu-alg>
1. Let _ps_ be SourceText of |UnicodePropertyName|.
1. Let _ps_ be the source text matched by |UnicodePropertyName|.
1. Let _p_ be UnicodeMatchProperty(_ps_).
1. Assert: _p_ is a Unicode property name or property alias listed in the &ldquo;Property name and aliases&rdquo; column of <emu-xref href="#table-nonbinary-unicode-properties"></emu-xref>.
1. Let _vs_ be SourceText of |UnicodePropertyValue|.
1. Let _vs_ be the source text matched by |UnicodePropertyValue|.
1. Let _v_ be UnicodeMatchPropertyValue(_p_, _vs_).
1. Return the CharSet containing all Unicode code points whose character database definition includes the property _p_ with value _v_.
</emu-alg>
<emu-grammar>UnicodePropertyValueExpression :: LoneUnicodePropertyNameOrValue</emu-grammar>
<emu-alg>
1. Let _s_ be SourceText of |LoneUnicodePropertyNameOrValue|.
1. If UnicodeMatchPropertyValue(`General_Category`, _s_) is identical to a Unicode property value or property value alias for the General_Category (gc) property listed in <a href="https://unicode.org/Public/UCD/latest/ucd/PropertyValueAliases.txt"><code>PropertyValueAliases.txt</code></a>, then
1. Let _s_ be the source text matched by |LoneUnicodePropertyNameOrValue|.
1. If UnicodeMatchPropertyValue(`General_Category`, _s_) is a Unicode property value or property value alias for the General_Category (gc) property listed in <a href="https://unicode.org/Public/UCD/latest/ucd/PropertyValueAliases.txt"><code>PropertyValueAliases.txt</code></a>, then
1. Return the CharSet containing all Unicode code points whose character database definition includes the property &ldquo;General_Category&rdquo; with value _s_.
1. Let _p_ be UnicodeMatchProperty(_s_).
1. Assert: _p_ is a binary Unicode property or binary property alias listed in the &ldquo;Property name and aliases&rdquo; column of <emu-xref href="#table-binary-unicode-properties"></emu-xref>.
Expand Down Expand Up @@ -35971,7 +35957,7 @@ <h1>
<emu-clause id="sec-runtime-semantics-unicodematchproperty-p" type="abstract operation">
<h1>
UnicodeMatchProperty (
_p_: a List of Unicode code points,
_p_: ECMAScript source text,
): a Unicode property name
</h1>
<dl class="header">
Expand All @@ -35998,8 +35984,8 @@ <h1>
<emu-clause id="sec-runtime-semantics-unicodematchpropertyvalue-p-v" type="abstract operation">
<h1>
UnicodeMatchPropertyValue (
_p_: a List of Unicode code points,
_v_: a List of Unicode code points,
_p_: ECMAScript source text,
_v_: ECMAScript source text,
): a Unicode property value
</h1>
<dl class="header">
Expand Down

0 comments on commit aacf6d3

Please sign in to comment.