Skip to content

Commit

Permalink
Editorial: tweak UnicodePropertyValueExpression eval algs
Browse files Browse the repository at this point in the history
_UnicodePropertyName_, _UnicodePropertyValue_, and _LoneUnicodePropertyNameOrValue_
are invalid because UnicodePropertyName etc are nonterminals,
not metavariables.

And simply changing them to |UnicodePropertyName| etc
wouldn't be valid, because that would be passing a Parse Node
to UnicodeMatchProperty/UnicodeMatchPropertyValue,
which isn't what they're expecting.

So instead, use the SourceText operation to 'extract'
the List of code points for each.
  • Loading branch information
jmdyck committed Jan 26, 2018
1 parent 23f0e39 commit 25ccd81
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -30532,16 +30532,19 @@ <h1>CharacterClassEscape</h1>
<p>The production <emu-grammar>CharacterClassEscape :: `P{` UnicodePropertyValueExpression `}`</emu-grammar> evaluates by returning the CharSet containing all Unicode code points not included in the CharSet returned by |UnicodePropertyValueExpression|.</p>
<p>The production <emu-grammar>UnicodePropertyValueExpression :: UnicodePropertyName `=` UnicodePropertyValue</emu-grammar> evaluates as follows:</p>
<emu-alg>
1. Let _p_ be ! UnicodeMatchProperty(_UnicodePropertyName_).
1. Let _ps_ be SourceText of |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 _v_ be ! UnicodeMatchPropertyValue(_p_, _UnicodePropertyValue_).
1. Let _vs_ be SourceText of |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>
<p>The production <emu-grammar>UnicodePropertyValueExpression :: LoneUnicodePropertyNameOrValue</emu-grammar> evaluates as follows:</p>
<emu-alg>
1. If ! UnicodeMatchPropertyValue(`"General_Category"`, _LoneUnicodePropertyNameOrValue_) is identical to a List of Unicode code points that is the name of a Unicode general category or general category alias listed in the &ldquo;Property value and aliases&rdquo; column of <emu-xref href="#table-unicode-general-category-values"></emu-xref>, then
1. Return the CharSet containing all Unicode code points whose character database definition includes the property &ldquo;General_Category&rdquo; with value _LoneUnicodePropertyNameOrValue_.
1. Let _p_ be ! UnicodeMatchProperty(_LoneUnicodePropertyNameOrValue_).
1. Let _s_ be SourceText of |LoneUnicodePropertyNameOrValue|.
1. If ! UnicodeMatchPropertyValue(`"General_Category"`, _s_) is identical to a List of Unicode code points that is the name of a Unicode general category or general category alias listed in the &ldquo;Property value and aliases&rdquo; column of <emu-xref href="#table-unicode-general-category-values"></emu-xref>, 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>.
1. Return the CharSet containing all Unicode code points whose character database definition includes the property _p_ with value &ldquo;True&rdquo;.
</emu-alg>
Expand Down

0 comments on commit 25ccd81

Please sign in to comment.