Skip to content

Commit bc68fa8

Browse files
committed
Updated per what was agreed at the May 2016 meeting.
Created a new abstract operation "WordCharacters()" that is used by both IsWordChar() for word assertions and \w/\W CharacterClassEscapes.
1 parent 101632e commit bc68fa8

File tree

1 file changed

+29
-254
lines changed

1 file changed

+29
-254
lines changed

spec.html

Lines changed: 29 additions & 254 deletions
Original file line numberDiff line numberDiff line change
@@ -27681,16 +27681,14 @@ <h1>Assertion</h1>
2768127681
</emu-alg>
2768227682

2768327683
<!-- es6num="21.2.2.6.1" -->
27684-
<emu-clause id="sec-runtime-semantics-iswordchar-abstract-operation" aoid="IsWordChar">
27685-
<h1>Runtime Semantics: IsWordChar Abstract Operation</h1>
27686-
<p>The abstract operation IsWordChar takes an integer parameter _e_ and performs the following steps:</p>
27684+
<emu-clause id="sec-runtime-semantics-wordcharacters-abstract-operation" aoid="WordCharacters">
27685+
<h1>Runtime Semantics: WordCharacters Abstract Operation</h1>
27686+
<p>The abstract operation WordCharacters performs the following steps:</p>
2768727687
<emu-alg>
27688-
1. If _e_ is -1 or _e_ is _InputLength_, return *false*.
27689-
1. Let _c_ be the character _Input_[_e_].
27690-
1. If _c_ is one of the sixty-three characters below, return *true*.
27691-
<figure>
27692-
<table class="lightweight-table">
27693-
<tbody>
27688+
1. Create a set _A_ of characters containing the sixty-three characters:
27689+
<figure>
27690+
<table class="lightweight-table">
27691+
<tbody>
2769427692
<tr>
2769527693
<td>
2769627694
`a`
@@ -27916,14 +27914,30 @@ <h1>Runtime Semantics: IsWordChar Abstract Operation</h1>
2791627914
<td>
2791727915
</td>
2791827916
</tr>
27919-
</tbody>
27920-
</table>
27921-
</figure>
27922-
1. Return *false*.
27917+
</tbody>
27918+
</table>
27919+
</figure>
27920+
1. Create an empty set _U_.
27921+
1. For every character _c_ not in set _A_ where Canonicalize(_c_) is in _A_, add _c_ to _U_.
27922+
1. Assert: Unless _Unicode_ and _IgnoreCase_ are both true, _U_ is empty.
27923+
1. Add the characters in set _U_ to set _A_.
27924+
1. Return _A_.
2792327925
</emu-alg>
2792427926
</emu-clause>
27927+
<!-- es6num="21.2.2.6.2" -->
27928+
<emu-clause id="sec-runtime-semantics-iswordchar-abstract-operation" aoid="IsWordChar">
27929+
<h1>Runtime Semantics: IsWordChar Abstract Operation</h1>
27930+
<p>The abstract operation IsWordChar takes an integer parameter _e_ and performs the following steps:</p>
27931+
<emu-alg>
27932+
1. If _e_ is -1 or _e_ is _InputLength_, return *false*.
27933+
1. Let _c_ be the character _Input_[_e_].
27934+
1. Let _WordChars_ be _WordCharacters_().
27935+
1. If _c_ is in _WordChars_, return *true*.
27936+
1. Return *false*.
27937+
</emu-alg>
27938+
</emu-clause>
27939+
</emu-clause>
2792527940
</emu-clause>
27926-
2792727941
<!-- es6num="21.2.2.7" -->
2792827942
<emu-clause id="sec-quantifier">
2792927943
<h1>Quantifier</h1>
@@ -28312,246 +28326,7 @@ <h1>CharacterClassEscape</h1>
2831228326
<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>
2831328327
<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>
2831428328
<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>
28315-
<p>The production <emu-grammar>CharacterClassEscape :: `w`</emu-grammar> evaluates as follows:</p>
28316-
<emu-alg>
28317-
1. Create a set _A_ of characters containing the sixty-three characters:
28318-
<figure>
28319-
<table class="lightweight-table">
28320-
<tbody>
28321-
<tr>
28322-
<td>
28323-
`a`
28324-
</td>
28325-
<td>
28326-
`b`
28327-
</td>
28328-
<td>
28329-
`c`
28330-
</td>
28331-
<td>
28332-
`d`
28333-
</td>
28334-
<td>
28335-
`e`
28336-
</td>
28337-
<td>
28338-
`f`
28339-
</td>
28340-
<td>
28341-
`g`
28342-
</td>
28343-
<td>
28344-
`h`
28345-
</td>
28346-
<td>
28347-
`i`
28348-
</td>
28349-
<td>
28350-
`j`
28351-
</td>
28352-
<td>
28353-
`k`
28354-
</td>
28355-
<td>
28356-
`l`
28357-
</td>
28358-
<td>
28359-
`m`
28360-
</td>
28361-
<td>
28362-
`n`
28363-
</td>
28364-
<td>
28365-
`o`
28366-
</td>
28367-
<td>
28368-
`p`
28369-
</td>
28370-
<td>
28371-
`q`
28372-
</td>
28373-
<td>
28374-
`r`
28375-
</td>
28376-
<td>
28377-
`s`
28378-
</td>
28379-
<td>
28380-
`t`
28381-
</td>
28382-
<td>
28383-
`u`
28384-
</td>
28385-
<td>
28386-
`v`
28387-
</td>
28388-
<td>
28389-
`w`
28390-
</td>
28391-
<td>
28392-
`x`
28393-
</td>
28394-
<td>
28395-
`y`
28396-
</td>
28397-
<td>
28398-
`z`
28399-
</td>
28400-
</tr>
28401-
<tr>
28402-
<td>
28403-
`A`
28404-
</td>
28405-
<td>
28406-
`B`
28407-
</td>
28408-
<td>
28409-
`C`
28410-
</td>
28411-
<td>
28412-
`D`
28413-
</td>
28414-
<td>
28415-
`E`
28416-
</td>
28417-
<td>
28418-
`F`
28419-
</td>
28420-
<td>
28421-
`G`
28422-
</td>
28423-
<td>
28424-
`H`
28425-
</td>
28426-
<td>
28427-
`I`
28428-
</td>
28429-
<td>
28430-
`J`
28431-
</td>
28432-
<td>
28433-
`K`
28434-
</td>
28435-
<td>
28436-
`L`
28437-
</td>
28438-
<td>
28439-
`M`
28440-
</td>
28441-
<td>
28442-
`N`
28443-
</td>
28444-
<td>
28445-
`O`
28446-
</td>
28447-
<td>
28448-
`P`
28449-
</td>
28450-
<td>
28451-
`Q`
28452-
</td>
28453-
<td>
28454-
`R`
28455-
</td>
28456-
<td>
28457-
`S`
28458-
</td>
28459-
<td>
28460-
`T`
28461-
</td>
28462-
<td>
28463-
`U`
28464-
</td>
28465-
<td>
28466-
`V`
28467-
</td>
28468-
<td>
28469-
`W`
28470-
</td>
28471-
<td>
28472-
`X`
28473-
</td>
28474-
<td>
28475-
`Y`
28476-
</td>
28477-
<td>
28478-
`Z`
28479-
</td>
28480-
</tr>
28481-
<tr>
28482-
<td>
28483-
`0`
28484-
</td>
28485-
<td>
28486-
`1`
28487-
</td>
28488-
<td>
28489-
`2`
28490-
</td>
28491-
<td>
28492-
`3`
28493-
</td>
28494-
<td>
28495-
`4`
28496-
</td>
28497-
<td>
28498-
`5`
28499-
</td>
28500-
<td>
28501-
`6`
28502-
</td>
28503-
<td>
28504-
`7`
28505-
</td>
28506-
<td>
28507-
`8`
28508-
</td>
28509-
<td>
28510-
`9`
28511-
</td>
28512-
<td>
28513-
`_`
28514-
</td>
28515-
<td>
28516-
</td>
28517-
<td>
28518-
</td>
28519-
<td>
28520-
</td>
28521-
<td>
28522-
</td>
28523-
<td>
28524-
</td>
28525-
<td>
28526-
</td>
28527-
<td>
28528-
</td>
28529-
<td>
28530-
</td>
28531-
<td>
28532-
</td>
28533-
<td>
28534-
</td>
28535-
<td>
28536-
</td>
28537-
<td>
28538-
</td>
28539-
<td>
28540-
</td>
28541-
<td>
28542-
</td>
28543-
<td>
28544-
</td>
28545-
</tr>
28546-
</tbody>
28547-
</table>
28548-
</figure>
28549-
1. If _Unicode_ is *true*, then
28550-
1. Create an empty set _U_.
28551-
1. For every character _c_ not in set _A_ where Canonicalize(_c_) is in _A_, add _c_ to _U_.
28552-
1. Add the characters in set _U_ to set _A_.
28553-
1. Return _A_.
28554-
</emu-alg>
28329+
<p>The production <emu-grammar>CharacterClassEscape :: `w`</emu-grammar> evaluates by returning the set of all characters returned by _WordCharacters_().</p>
2855528330
<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>
2855628331
</emu-clause>
2855728332

0 commit comments

Comments
 (0)