Skip to content

Commit

Permalink
In CompileAtom, copy wording-changes
Browse files Browse the repository at this point in the history
... prompted by tc39#2418 (comment)
from `Atom :: CharacterClass` semantics
to `AtomEscape :: CharacterClassEscape` semantics.
  • Loading branch information
jmdyck committed Jun 16, 2023
1 parent 35c43a8 commit 7cc4acf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -36445,17 +36445,17 @@ <h1>
<emu-grammar>AtomEscape :: CharacterClassEscape</emu-grammar>
<emu-alg>
1. Let _cs_ be CompileToCharSet of |CharacterClassEscape| with argument _rer_.
1. If _rer_.[[UnicodeSets]] is *false*, or if every element of _cs_ consists of a single character (including if _cs_ is empty), return CharacterSetMatcher(_rer_, _cs_, *false*, _direction_).
1. If _rer_.[[UnicodeSets]] is *false*, or if every CharSetElement of _cs_ consists of a single character (including if _cs_ is empty), return CharacterSetMatcher(_rer_, _cs_, *false*, _direction_).
1. Let _lm_ be an empty List of Matchers.
1. For each string _s_ in _cs_ whose length is greater than 1, iterating in descending order of string length, do
1. For each CharSetElement _s_ in _cs_ containing more than 1 character, iterating in descending order of length, do
1. Let _cs2_ be a one-element CharSet containing the last code point of _s_.
1. Let _m2_ be CharacterSetMatcher(_rer_, _cs2_, *false*, _direction_).
1. For each code point _c1_ in _s_, iterating backwards from its second-to-last code point, do
1. Let _cs1_ be a one-element CharSet containing _c1_.
1. Let _m1_ be CharacterSetMatcher(_rer_, _cs1_, *false*, _direction_).
1. Set _m2_ to MatchSequence(_m1_, _m2_, _direction_).
1. Append _m2_ to _lm_.
1. Let _singles_ be the CharSet containing every element of _cs_ which consists of a single character.
1. Let _singles_ be the CharSet containing every CharSetElement of _cs_ which consists of a single character.
1. Append CharacterSetMatcher(_rer_, _singles_, *false*, _direction_) to _lm_.
1. If _cs_ contains the empty sequence of characters, append EmptyMatcher() to _lm_.
1. Let _m2_ be the last Matcher in _lm_.
Expand Down

0 comments on commit 7cc4acf

Please sign in to comment.