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

Unify handling of RegExp CharacterClassEscapes \w and \W and Word Asserts \b and \B #525

Merged
merged 2 commits into from
Jun 22, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
279 changes: 31 additions & 248 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -27756,16 +27756,14 @@ <h1>Assertion</h1>
</emu-alg>

<!-- es6num="21.2.2.6.1" -->
<emu-clause id="sec-runtime-semantics-iswordchar-abstract-operation" aoid="IsWordChar">
<h1>Runtime Semantics: IsWordChar Abstract Operation</h1>
<p>The abstract operation IsWordChar takes an integer parameter _e_ and performs the following steps:</p>
<emu-clause id="sec-runtime-semantics-wordcharacters-abstract-operation" aoid="WordCharacters">
<h1>Runtime Semantics: WordCharacters Abstract Operation</h1>
<p>The abstract operation WordCharacters performs the following steps:</p>
<emu-alg>
1. If _e_ is -1 or _e_ is _InputLength_, return *false*.
1. Let _c_ be the character _Input_[_e_].
1. If _c_ is one of the sixty-three characters below, return *true*.
<figure>
<table class="lightweight-table">
<tbody>
1. Create a set _A_ of characters containing the sixty-three characters:
<figure>
<table class="lightweight-table">
<tbody>
<tr>
<td>
`a`
Expand Down Expand Up @@ -27991,14 +27989,30 @@ <h1>Runtime Semantics: IsWordChar Abstract Operation</h1>
<td>
</td>
</tr>
</tbody>
</table>
</figure>
1. Return *false*.
</tbody>
</table>
</figure>
1. Create an empty set _U_.
1. For every character _c_ not in set _A_ where Canonicalize(_c_) is in _A_, add _c_ to _U_.
1. Assert: Unless _Unicode_ and _IgnoreCase_ are both true, _U_ is empty.
1. Add the characters in set _U_ to set _A_.
1. Return _A_.
</emu-alg>
</emu-clause>
<!-- es6num="21.2.2.6.2" -->
<emu-clause id="sec-runtime-semantics-iswordchar-abstract-operation" aoid="IsWordChar">
<h1>Runtime Semantics: IsWordChar Abstract Operation</h1>
<p>The abstract operation IsWordChar takes an integer parameter _e_ and performs the following steps:</p>
<emu-alg>
1. If _e_ is -1 or _e_ is _InputLength_, return *false*.
1. Let _c_ be the character _Input_[_e_].
1. Let _WordChars_ be _WordCharacters_().
1. If _c_ is in _WordChars_, return *true*.
1. Return *false*.
</emu-alg>
</emu-clause>
</emu-clause>
</emu-clause>

<!-- es6num="21.2.2.7" -->
<emu-clause id="sec-quantifier">
<h1>Quantifier</h1>
Expand Down Expand Up @@ -28390,240 +28404,9 @@ <h1>CharacterClassEscape</h1>
<p>The production <emu-grammar>CharacterClassEscape :: `d`</emu-grammar> evaluates by returning the ten-element set of characters containing the characters `0` through `9` inclusive.</p>
<p>The production <emu-grammar>CharacterClassEscape :: `D`</emu-grammar> evaluates by returning the set of all characters not included in the set returned by <emu-grammar>CharacterClassEscape :: `d`</emu-grammar>.</p>
<p>The production <emu-grammar>CharacterClassEscape :: `s`</emu-grammar> evaluates by returning the set of characters containing the characters that are on the right-hand side of the |WhiteSpace| or |LineTerminator| productions.</p>
<p>The production <emu-grammar>CharacterClassEscape :: `S`</emu-grammar> evaluates by returning the set of all characters not included in the set returned by <emu-grammar>CharacterClassEscape :: `s`</emu-grammar>.</p>
<p>The production <emu-grammar>CharacterClassEscape :: `w`</emu-grammar> evaluates by returning the set of characters containing the sixty-three characters:</p>
<figure>
<table class="lightweight-table">
<tbody>
<tr>
<td>
`a`
</td>
<td>
`b`
</td>
<td>
`c`
</td>
<td>
`d`
</td>
<td>
`e`
</td>
<td>
`f`
</td>
<td>
`g`
</td>
<td>
`h`
</td>
<td>
`i`
</td>
<td>
`j`
</td>
<td>
`k`
</td>
<td>
`l`
</td>
<td>
`m`
</td>
<td>
`n`
</td>
<td>
`o`
</td>
<td>
`p`
</td>
<td>
`q`
</td>
<td>
`r`
</td>
<td>
`s`
</td>
<td>
`t`
</td>
<td>
`u`
</td>
<td>
`v`
</td>
<td>
`w`
</td>
<td>
`x`
</td>
<td>
`y`
</td>
<td>
`z`
</td>
</tr>
<tr>
<td>
`A`
</td>
<td>
`B`
</td>
<td>
`C`
</td>
<td>
`D`
</td>
<td>
`E`
</td>
<td>
`F`
</td>
<td>
`G`
</td>
<td>
`H`
</td>
<td>
`I`
</td>
<td>
`J`
</td>
<td>
`K`
</td>
<td>
`L`
</td>
<td>
`M`
</td>
<td>
`N`
</td>
<td>
`O`
</td>
<td>
`P`
</td>
<td>
`Q`
</td>
<td>
`R`
</td>
<td>
`S`
</td>
<td>
`T`
</td>
<td>
`U`
</td>
<td>
`V`
</td>
<td>
`W`
</td>
<td>
`X`
</td>
<td>
`Y`
</td>
<td>
`Z`
</td>
</tr>
<tr>
<td>
`0`
</td>
<td>
`1`
</td>
<td>
`2`
</td>
<td>
`3`
</td>
<td>
`4`
</td>
<td>
`5`
</td>
<td>
`6`
</td>
<td>
`7`
</td>
<td>
`8`
</td>
<td>
`9`
</td>
<td>
`_`
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
</tbody>
</table>
</figure>
<p>The production <emu-grammar>CharacterClassEscape :: `W`</emu-grammar> evaluates by returning the set of all characters not included in the set returned by <emu-grammar>CharacterClassEscape :: `w`</emu-grammar>.</p>
<p>The production <emu-grammar>CharacterClassEscape :: `S`</emu-grammar> evaluates by returning the set of all characters not included in the set returned by <emu-grammar>CharacterClassEscape :: `s`</emu-grammar> .</p>
<p>The production <emu-grammar>CharacterClassEscape :: `w`</emu-grammar> evaluates by returning the set of all characters returned by _WordCharacters_().</p>
<p>The production <emu-grammar>CharacterClassEscape :: `W`</emu-grammar> evaluates by returning the set of all characters not included in the set returned by <emu-grammar>CharacterClassEscape :: `w`</emu-grammar> .</p>
</emu-clause>

<!-- es6num="21.2.2.13" -->
Expand Down