diff --git a/spec.html b/spec.html index 29bd03d7de6..f65e8252896 100644 --- a/spec.html +++ b/spec.html @@ -36135,6 +36135,94 @@

Runtime Semantics: CompileToCharSet

A `-` character can be treated literally or it can denote a range. It is treated literally if it is the first or last character of |ClassRanges|, the beginning or end limit of a range specification, or immediately follows a range specification.

+ + ClassUnion :: ClassRange ClassUnion? + + 1. Let _A_ be CompileToCharSet of |ClassRange|. + 1. If |ClassUnion| is present, then + 1. Let _B_ be CompileToCharSet of |ClassUnion|. + 1. Return the union of CharSets _A_ and _B_. + 1. Return _A_. + + ClassUnion :: ClassOperand ClassUnion? + + 1. Let _A_ be CompileToCharSet of |ClassRange|. + 1. If |ClassUnion| is present, then + 1. Let _B_ be CompileToCharSet of |ClassUnion|. + 1. Return the union of CharSets _A_ and _B_. + 1. Return _A_. + + + + ClassIntersection :: ClassOperand `&&` ClassOperand + + 1. Let _A_ be CompileToCharSet of the first |ClassOperand|. + 1. Let _B_ be CompileToCharSet of the second |ClassOperand|. + 1. Return the intersection of CharSets _A_ and _B_. + + ClassIntersection :: ClassIntersection `&&` ClassOperand + + 1. Let _A_ be CompileToCharSet of the |ClassIntersection|. + 1. Let _B_ be CompileToCharSet of the |ClassOperand|. + 1. Return the intersection of CharSets _A_ and _B_. + + + + ClassSubtraction :: ClassOperand `--` ClassOperand + + 1. Let _A_ be CompileToCharSet of the first |ClassOperand|. + 1. Let _B_ be CompileToCharSet of the second |ClassOperand|. + 1. Return the subtraction of CharSets _A_ and _B_. + + ClassSubtraction :: ClassSubtraction `--` ClassOperand + + 1. Let _A_ be CompileToCharSet of the |ClassSubtraction|. + 1. Let _B_ be CompileToCharSet of the |ClassOperand|. + 1. Return the subtraction of CharSets _A_ and _B_. + + + + ClassOperand :: ClassCharacter + + 1. Let _A_ be CompileToCharSet of |ClassCharacter|. + 1. Return ! MaybeSimpleCaseFolding(_A_). + + ClassOperand :: ClassStrings + + 1. Let _A_ be CompileToCharSet of |ClassStrings|. + 1. Return ! MaybeSimpleCaseFolding(_A_). + + ClassOperand :: NestedClass + + 1. Return CompileToCharSet of |NestedClass|. + + + + NestedClass :: `[` ClassRanges `]` + + 1. Return CompileToCharSet of |ClassRanges|. + + NestedClass :: `[` `^` ClassRanges `]` + + 1. Let _A_ be CompileToCharSet of |ClassRanges|. + 1. Return the CharSet containing all characters not in _A_. + + NestedClass :: `\` CharacterClassEscape + + 1. Return CompileToCharSet of |CharacterClassEscape|. + + + + ClassRange :: ClassCharacter `-` ClassCharacter + + 1. Let _A_ be CompileToCharSet of the first |ClassCharacter|. + 1. Let _B_ be CompileToCharSet of the first |ClassCharacter|. + 1. Return ! MaybeSimpleCaseFolding(! CharacterRange(_A, B_)). + + +

The result will often consist of two or more ranges. When UnicodeSets is *true* and IgnoreCase is *true*, then MaybeSimpleCaseFolding([Ā-č]) will include only the odd-numbered code points of that range.

+
+ ClassAtom :: `-` @@ -36222,206 +36310,67 @@

Runtime Semantics: CompileToCharSet

1. Return ! MaybeSimpleCaseFolding(_A_).
- -

ClassContents

-

The production ClassContents :: ClassUnion evaluates as follows:

- - 1. Return the CharSet that is the result of evaluating |ClassUnion|. - -

The production ClassContents :: ClassIntersection evaluates as follows:

- - 1. Return the CharSet that is the result of evaluating |ClassIntersection|. - -

The production ClassContents :: ClassSubtraction evaluates as follows:

- - 1. Return the CharSet that is the result of evaluating |ClassSubtraction|. - -
- - -

ClassUnion

-

The production ClassUnion :: ClassRange ClassUnion? evaluates as follows:

- - 1. Evaluate |ClassRange| to obtain a CharSet _A_. - 1. If |ClassUnion| is present, then - 1. Evaluate |ClassUnion| to obtain a CharSet _B_. - 1. Return the union of CharSets _A_ and _B_. - 1. Return _A_. - -

The production ClassUnion :: ClassOperand ClassUnion? evaluates as follows:

- - 1. Evaluate |ClassOperand| to obtain a CharSet _A_. - 1. If |ClassUnion| is present, then - 1. Evaluate |ClassUnion| to obtain a CharSet _B_. - 1. Return the union of CharSets _A_ and _B_. - 1. Return _A_. - -
- - -

ClassIntersection

-

The production ClassIntersection :: ClassOperand `&&` [lookahead != `&] ClassOperand evaluates as follows:

- - 1. Evaluate the first |ClassOperand| to obtain a CharSet _A_. - 1. Evaluate the second |ClassOperand| to obtain a CharSet _B_. - 1. Return the intersection of CharSets _A_ and _B_. - -

The production ClassIntersection :: ClassIntersection `&&` [lookahead != `&] ClassOperand evaluates as follows:

- - 1. Evaluate the |ClassIntersection| to obtain a CharSet _A_. - 1. Evaluate the |ClassOperand| to obtain a CharSet _B_. - 1. Return the intersection of CharSets _A_ and _B_. - -
- - -

ClassSubtraction

-

The production ClassSubtraction :: ClassOperand `--` ClassOperand evaluates as follows:

- - 1. Evaluate the first |ClassOperand| to obtain a CharSet _A_. - 1. Evaluate the second |ClassOperand| to obtain a CharSet _B_. - 1. Return the subtraction of CharSet _A_ minus CharSet _B_. - -

The production ClassSubtraction :: ClassSubtraction `--` ClassOperand evaluates as follows:

- - 1. Evaluate the |ClassSubtraction| to obtain a CharSet _A_. - 1. Evaluate the |ClassOperand| to obtain a CharSet _B_. - 1. Return the subtraction of CharSet _A_ minus CharSet _B_. - -
- - -

ClassOperand

-

The production ClassOperand :: ClassCharacter evaluates as follows:

- - 1. Evaluate the |ClassCharacter| to obtain a CharSet _A_. - 1. Return ! MaybeSimpleCaseFolding(_A_). - -

The production ClassOperand :: ClassStrings evaluates as follows:

- - 1. Evaluate the |ClassStrings| to obtain a CharSet _A_. - 1. Return ! MaybeSimpleCaseFolding(_A_). - -

The production ClassOperand :: NestedClass evaluates as follows:

- - 1. Return the CharSet that is the result of evaluating |NestedClass|. - -
- - -

NestedClass

-

The production NestedClass :: `[` [lookahead != `^`] ClassRanges[+UnicodeMode, +UnicodeSetsMode] `]` evaluates as follows:

- - 1. Return the CharSet that is the result of evaluating |ClassRanges|. - -

The production NestedClass :: `[` `^` ClassRanges[+UnicodeMode, +UnicodeSetsMode] `]` evaluates as follows:

- - 1. Let _A_ be the CharSet that is the result of evaluating |ClassRanges|. - 1. Return the CharSet containing all characters not in _A_. - -

The production NestedClass :: `\` CharacterClassEscape evaluates as follows:

- - 1. Return the CharSet that is the result of evaluating |CharacterClassEscape|. - -
- - -

ClassRange

-

The production ClassRange :: ClassCharacter `-` ClassCharacter evaluates as follows:

- - 1. Evaluate the first |ClassCharacter| to obtain a CharSet _A_. - 1. Evaluate the second |ClassCharacter| to obtain a CharSet _B_. - 1. Return ! MaybeSimpleCaseFolding(! CharacterRange(_A, B_)). - - -

The result will often consist of two or more ranges. When UnicodeSets is *true* and IgnoreCase is *true*, then MaybeSimpleCaseFolding([Ā-č]) will include only the odd-numbered code points of that range.

-
-
- - -

ClassCharacter

-

The |ClassCharacter| productions evaluate as follows:

+ - ClassCharacter :: [lookahead ∉ ClassReservedDouble] SourceCharacter but not ClassSyntaxCharacter + ClassCharacter :: SourceCharacter but not ClassSyntaxCharacter ClassCharacter :: `\` CharacterEscape ClassCharacter :: `\` ClassAllowEscaped - 1. Let _cv_ be the CharacterValue of this |ClassCharacter|. 1. Let _c_ be the character whose character value is _cv_. 1. Return the CharSet containing the single character _c_. -

The production ClassCharacter :: `\` `b` evaluates as follows:

+ ClassCharacter :: `\` `b` 1. Return the CharSet containing the single character U+0008 (BACKSPACE). -
- -

ClassRanges

-

The production ClassRanges :: [empty] evaluates as follows:

+ + ClassStrings :: `(` ClassString MoreClassStrings? `)` - 1. Return the empty CharSet. - -

The production ClassRanges :: NonemptyClassRanges evaluates as follows:

- - 1. Return the CharSet that is the result of evaluating |NonemptyClassRanges|. - -

The production ClassRanges :: ClassContents evaluates as follows:

- - 1. Return the CharSet that is the result of evaluating |ClassContents|. - -
- - -

ClassStrings

-

The production ClassStrings :: `(` ClassString MoreClassStrings? `)` evaluates as follows:

- - 1. Evaluate |ClassString| to obtain a string _s_. + 1. Let _s_ be CompileString of |ClassString|. 1. Let A be the CharSet that contains the one string _s_. 1. If |MoreClassStrings| is present, then - 1. Evaluate |MoreClassStrings| to obtain a CharSet _B_. + 1. Let _B_ be CompileToCharSet of |MoreClassStrings|. 1. Return the union of CharSets _A_ and _B_. 1. Return _A_. -
- -

MoreClassStrings

-

The production MoreClassStrings :: `|` ClassString MoreClassStrings? evaluates as follows:

+ + MoreClassStrings :: `|` ClassString MoreClassStrings? - 1. Evaluate |ClassString| to obtain a string _s_. + 1. Let _s_ be CompileString of |ClassString|. 1. Let _A_ be the CharSet that contains the one string _s_. 1. If |MoreClassStrings| is present, then - 1. Evaluate |MoreClassStrings| to obtain a CharSet _B_. + 1. Let _B_ be CompileToCharSet of |MoreClassStrings|. 1. Return the union of CharSets _A_ and _B_. 1. Return _A_.
- -

ClassString

-

The production ClassString :: [empty] evaluates as follows:

+ +

Runtime Semantics: CompileString

+
+
description
+
It returns a string.
+
+ + ClassString :: [empty] 1. Return the empty String. -

The production ClassString :: NonEmptyClassString evaluates as follows:

+ ClassString :: NonEmptyClassString - 1. Evaluate |NonEmptyClassString| to obtain a string _s_. - 1. Return _s_. + 1. Return CompileString of |NonEmptyClassString|. -
- - -

NonEmptyClassString

-

The production NonEmptyClassString :: ClassCharacter NonEmptyClassString? evaluates as follows:

+ NonEmptyClassString :: ClassCharacter NonEmptyClassString? - 1. Evaluate |ClassCharacter| to obtain the single-character string _s1_. + 1. Let _s1_ be CompileToCharSet of |ClassCharacter|. 1. If |NonEmptyClassString| is present, then - 1. Evaluate |NonEmptyClassString| to obtain a string _s2_. + 1. Let _s2_ be CompileString of |NonEmptyClassString|. 1. Return the string that is the concatenation of _s1_ with _s2_. 1. Return _s1_.