Skip to content

Commit

Permalink
Editorial: Merge 'ExtendedAtom' and 'Atom'
Browse files Browse the repository at this point in the history
Note that:

ExtendedAtom was only ever 'invoked' under [~U],
and when the merged production is invoked with [~U],
it exactly reproduces the RHSs of ExtendedAtom.

Atom was only ever invoked under [+U],
and when the merged production is invoked with [+U],
it reproduces the RHSs of former Atom
except for the placement of the PatternCharacter RHS,
but that's okay, because former Atom wasn't an order-disambiguated production.
  • Loading branch information
jmdyck committed Jan 25, 2020
1 parent 14b39ec commit 10f2d15
Showing 1 changed file with 19 additions and 30 deletions.
49 changes: 19 additions & 30 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -30943,8 +30943,8 @@ <h2>Patterns</h2>
[+U] Atom[+U, ?N] Quantifier
[~U] QuantifiableAssertion[~U, ?N] Quantifier
[~U] Assertion[~U, ?N]
[~U] ExtendedAtom[?N] Quantifier
[~U] ExtendedAtom[?N]
[~U] Atom[~U, ?N] Quantifier
[~U] Atom[~U, ?N]

Assertion[U, N] ::
`^`
Expand All @@ -30971,23 +30971,17 @@ <h2>Patterns</h2>
`{` DecimalDigits `,` `}`
`{` DecimalDigits `,` DecimalDigits `}`

ExtendedAtom[N] ::!
`.`
`\` AtomEscape[~U, ?N]
`\` [lookahead == `c`]
CharacterClass[~U]
`(` Disjunction[~U, ?N] `)`
`(` `?` `:` Disjunction[~U, ?N] `)`
InvalidBracedQuantifier
ExtendedPatternCharacter

Atom[U, N] ::
PatternCharacter
Atom[U, N] ::!
`.`
`\` AtomEscape[?U, ?N]
[~U] `\` [lookahead == `c`]
CharacterClass[?U]
`(` GroupSpecifier[?U] Disjunction[?U, ?N] `)`
[+U] `(` GroupSpecifier[?U] Disjunction[?U, ?N] `)`
[~U] `(` Disjunction[?U, ?N] `)`
`(` `?` `:` Disjunction[?U, ?N] `)`
[~U] InvalidBracedQuantifier
[+U] PatternCharacter
[~U] ExtendedPatternCharacter

InvalidBracedQuantifier ::
`{` DecimalDigits `}`
Expand Down Expand Up @@ -31202,7 +31196,7 @@ <h1>Static Semantics: Early Errors</h1>
It is a Syntax Error if the MV of the first |DecimalDigits| is larger than the MV of the second |DecimalDigits|.
</li>
</ul>
<emu-grammar>ExtendedAtom :: InvalidBracedQuantifier</emu-grammar>
<emu-grammar>Atom :: InvalidBracedQuantifier</emu-grammar>
<ul>
<li>
It is a Syntax Error if any source text matches this rule.
Expand Down Expand Up @@ -31713,10 +31707,8 @@ <h1>Term</h1>
1. Call RepeatMatcher(_m_, _min_, _max_, _greedy_, _x_, _c_, _parenIndex_, _parenCount_) and return its result.
</emu-alg>
<p>----</p>
<p>In the above algorithm, references to <emu-grammar>Atom :: `(` GroupSpecifier Disjunction `)`</emu-grammar> are to be interpreted as meaning <emu-grammar>Atom :: `(` GroupSpecifier Disjunction `)`</emu-grammar> or <emu-grammar>ExtendedAtom :: `(` Disjunction `)`</emu-grammar> .</p>
<p>In the above algorithm, references to <emu-grammar>Atom :: `(` GroupSpecifier Disjunction `)`</emu-grammar> are to be interpreted as meaning <emu-grammar>Atom :: `(` GroupSpecifier Disjunction `)`</emu-grammar> or <emu-grammar>Atom :: `(` Disjunction `)`</emu-grammar> .</p>
<p>The production <emu-grammar>Term :: QuantifiableAssertion Quantifier</emu-grammar> evaluates the same as the production <emu-grammar>Term :: Atom Quantifier</emu-grammar> but with |QuantifiableAssertion| substituted for |Atom|.</p>
<p>The production <emu-grammar>Term :: ExtendedAtom Quantifier</emu-grammar> evaluates the same as the production <emu-grammar>Term :: Atom Quantifier</emu-grammar> but with |ExtendedAtom| substituted for |Atom|.</p>
<p>The production <emu-grammar>Term :: ExtendedAtom</emu-grammar> evaluates the same as the production <emu-grammar>Term :: Atom</emu-grammar> but with |ExtendedAtom| substituted for |Atom|.</p>

<emu-clause id="sec-runtime-semantics-repeatmatcher-abstract-operation" aoid="RepeatMatcher">
<h1>Runtime Semantics: RepeatMatcher ( _m_, _min_, _max_, _greedy_, _x_, _c_, _parenIndex_, _parenCount_ )</h1>
Expand Down Expand Up @@ -32177,12 +32169,6 @@ <h1>Quantifier</h1>
<emu-clause id="sec-atom">
<h1>Atom</h1>
<p>With parameter _direction_.</p>
<p>The production <emu-grammar>Atom :: PatternCharacter</emu-grammar> evaluates as follows:</p>
<emu-alg>
1. Let _ch_ be the character matched by |PatternCharacter|.
1. Let _A_ be a one-element CharSet containing the character _ch_.
1. Call CharacterSetMatcher(_A_, *false*, _direction_) and return its Matcher result.
</emu-alg>
<p>The production <emu-grammar>Atom :: `.`</emu-grammar> evaluates as follows:</p>
<emu-alg>
1. If _DotAll_ is *true*, then
Expand All @@ -32194,7 +32180,7 @@ <h1>Atom</h1>
<emu-alg>
1. Return the Matcher that is the result of evaluating |AtomEscape| with argument _direction_.
</emu-alg>
<p>The production <emu-grammar>ExtendedAtom :: `\` [lookahead == `c`]</emu-grammar> evaluates as follows:</p>
<p>The production <emu-grammar>Atom :: `\` [lookahead == `c`]</emu-grammar> evaluates as follows:</p>
<emu-alg>
1. Let _A_ be the CharSet containing the single character `\\` U+005C (REVERSE SOLIDUS).
1. Call CharacterSetMatcher(_A_, *false*, _direction_) and return its Matcher result.
Expand Down Expand Up @@ -32229,14 +32215,18 @@ <h1>Atom</h1>
<emu-alg>
1. Return the Matcher that is the result of evaluating |Disjunction| with argument _direction_.
</emu-alg>
<p>The production <emu-grammar>ExtendedAtom :: ExtendedPatternCharacter</emu-grammar> evaluates as follows:</p>
<p>The production <emu-grammar>Atom :: ExtendedPatternCharacter</emu-grammar> evaluates as follows:</p>
<emu-alg>
1. Let _ch_ be the character represented by |ExtendedPatternCharacter|.
1. Let _A_ be a one-element CharSet containing the character _ch_.
1. Call CharacterSetMatcher(_A_, *false*, _direction_) and return its Matcher result.
</emu-alg>
<p>----</p>
<p>The evaluation rules for the |Atom| productions except for <emu-grammar>Atom :: PatternCharacter</emu-grammar> are also used for the |ExtendedAtom| productions, but with |ExtendedAtom| substituted for |Atom|.</p>
<p>The production <emu-grammar>Atom :: PatternCharacter</emu-grammar> evaluates as follows:</p>
<emu-alg>
1. Let _ch_ be the character matched by |PatternCharacter|.
1. Let _A_ be a one-element CharSet containing the character _ch_.
1. Call CharacterSetMatcher(_A_, *false*, _direction_) and return its Matcher result.
</emu-alg>

<emu-clause id="sec-runtime-semantics-charactersetmatcher-abstract-operation" aoid="CharacterSetMatcher">
<h1>Runtime Semantics: CharacterSetMatcher ( _A_, _invert_, _direction_ )</h1>
Expand Down Expand Up @@ -42096,7 +42086,6 @@ <h1>Regular Expressions</h1>
<emu-prodref name=QuantifiableAssertion></emu-prodref>
<emu-prodref name=Quantifier></emu-prodref>
<emu-prodref name=QuantifierPrefix></emu-prodref>
<emu-prodref name=ExtendedAtom></emu-prodref>
<emu-prodref name=Atom></emu-prodref>
<emu-prodref name=InvalidBracedQuantifier></emu-prodref>
<emu-prodref name=ExtendedPatternCharacter></emu-prodref>
Expand Down

0 comments on commit 10f2d15

Please sign in to comment.