From Jason Turner

[re.grammar]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpt1ji4swp/{from.md → to.md} +19 -12
tmp/tmpt1ji4swp/{from.md → to.md} RENAMED
@@ -20,10 +20,13 @@ ClassAtom ::
20
  -
21
  ClassAtomNoDash
22
  ClassAtomExClass
23
  ClassAtomCollatingElement
24
  ClassAtomEquivalence
 
 
 
25
  ```
26
 
27
  The following new productions are then added:
28
 
29
  ``` cpp
@@ -92,40 +95,42 @@ When the sequence of characters being transformed to a finite state
92
  machine contains an invalid class name the translator shall throw an
93
  exception object of type `regex_error`.
94
 
95
  If the *CV* of a *UnicodeEscapeSequence* is greater than the largest
96
  value that can be held in an object of type `charT` the translator shall
97
- throw an exception object of type `regex_error`. This means that values
98
- of the form `"uxxxx"` that do not fit in a character are invalid.
 
 
99
 
100
  Where the regular expression grammar requires the conversion of a
101
  sequence of characters to an integral value, this is accomplished by
102
  calling `traits_inst.value`.
103
 
104
  The behavior of the internal finite state machine representation when
105
  used to match a sequence of characters is as described in ECMA-262. The
106
- behavior is modified according to any match_flag_type flags 
107
- [[re.matchflag]] specified when using the regular expression object in
108
- one of the regular expression algorithms  [[re.alg]]. The behavior is
109
  also localized by interaction with the traits class template parameter
110
  as follows:
111
 
112
  - During matching of a regular expression finite state machine against a
113
  sequence of characters, two characters `c` and `d` are compared using
114
  the following rules:
115
- 1. if `(flags() & regex_constants::icase)` the two characters are
116
- equal if
117
  `traits_inst.translate_nocase(c) == traits_inst.translate_nocase(d)`;
118
- 2. otherwise, if `flags() & regex_constants::collate` the two
119
  characters are equal if
120
  `traits_inst.translate(c) == traits_inst.translate(d)`;
121
- 3. otherwise, the two characters are equal if `c == d`.
122
  - During matching of a regular expression finite state machine against a
123
  sequence of characters, comparison of a collating element range
124
  `c1-c2` against a character `c` is conducted as follows: if
125
- `flags() & regex_constants \colcol
126
- collate` is false then the character `c` is matched if `c1
127
  <= c && c <= c2`, otherwise `c` is matched in accordance with the
128
  following algorithm:
129
  ``` cpp
130
  string_type str1 = string_type(1,
131
  flags() & icase ?
@@ -155,10 +160,11 @@ as follows:
155
 
156
  <!-- Link reference definitions -->
157
  [algorithms]: algorithms.md#algorithms
158
  [bidirectional.iterators]: iterators.md#bidirectional.iterators
159
  [bitmask.types]: library.md#bitmask.types
 
160
  [enumerated.types]: library.md#enumerated.types
161
  [forward.iterators]: iterators.md#forward.iterators
162
  [input.iterators]: iterators.md#input.iterators
163
  [output.iterators]: iterators.md#output.iterators
164
  [re]: #re
@@ -209,17 +215,18 @@ as follows:
209
  [re.tokiter.comp]: #re.tokiter.comp
210
  [re.tokiter.deref]: #re.tokiter.deref
211
  [re.tokiter.incr]: #re.tokiter.incr
212
  [re.traits]: #re.traits
213
  [sequence.reqmts]: containers.md#sequence.reqmts
 
214
  [tab:re.lib.summary]: #tab:re.lib.summary
215
  [tab:re.traits.classnames]: #tab:re.traits.classnames
216
  [tab:re:RegexpTraits]: #tab:re:RegexpTraits
217
  [tab:re:alg:match]: #tab:re:alg:match
218
  [tab:re:alg:search]: #tab:re:alg:search
219
  [tab:re:errortype]: #tab:re:errortype
220
  [tab:re:matchflag]: #tab:re:matchflag
221
  [tab:re:results:assign]: #tab:re:results:assign
222
  [tab:re:syntaxoption]: #tab:re:syntaxoption
223
 
224
- [^1]: For example, if the parameter `icase` is true then `[[:lower:]]`
225
  is the same as `[[:alpha:]]`.
 
20
  -
21
  ClassAtomNoDash
22
  ClassAtomExClass
23
  ClassAtomCollatingElement
24
  ClassAtomEquivalence
25
+
26
+ IdentityEscape ::
27
+ SourceCharacter but not c
28
  ```
29
 
30
  The following new productions are then added:
31
 
32
  ``` cpp
 
95
  machine contains an invalid class name the translator shall throw an
96
  exception object of type `regex_error`.
97
 
98
  If the *CV* of a *UnicodeEscapeSequence* is greater than the largest
99
  value that can be held in an object of type `charT` the translator shall
100
+ throw an exception object of type `regex_error`.
101
+
102
+ [*Note 1*: This means that values of the form `"uxxxx"` that do not fit
103
+ in a character are invalid. — *end note*]
104
 
105
  Where the regular expression grammar requires the conversion of a
106
  sequence of characters to an integral value, this is accomplished by
107
  calling `traits_inst.value`.
108
 
109
  The behavior of the internal finite state machine representation when
110
  used to match a sequence of characters is as described in ECMA-262. The
111
+ behavior is modified according to any match_flag_type flags (
112
+ [[re.matchflag]]) specified when using the regular expression object in
113
+ one of the regular expression algorithms ([[re.alg]]). The behavior is
114
  also localized by interaction with the traits class template parameter
115
  as follows:
116
 
117
  - During matching of a regular expression finite state machine against a
118
  sequence of characters, two characters `c` and `d` are compared using
119
  the following rules:
120
+ - if `(flags() & regex_constants::icase)` the two characters are equal
121
+ if
122
  `traits_inst.translate_nocase(c) == traits_inst.translate_nocase(d)`;
123
+ - otherwise, if `flags() & regex_constants::collate` the two
124
  characters are equal if
125
  `traits_inst.translate(c) == traits_inst.translate(d)`;
126
+ - otherwise, the two characters are equal if `c == d`.
127
  - During matching of a regular expression finite state machine against a
128
  sequence of characters, comparison of a collating element range
129
  `c1-c2` against a character `c` is conducted as follows: if
130
+ `flags() & regex_constants::collate` is false then the character `c`
131
+ is matched if `c1
132
  <= c && c <= c2`, otherwise `c` is matched in accordance with the
133
  following algorithm:
134
  ``` cpp
135
  string_type str1 = string_type(1,
136
  flags() & icase ?
 
160
 
161
  <!-- Link reference definitions -->
162
  [algorithms]: algorithms.md#algorithms
163
  [bidirectional.iterators]: iterators.md#bidirectional.iterators
164
  [bitmask.types]: library.md#bitmask.types
165
+ [container.requirements.general]: containers.md#container.requirements.general
166
  [enumerated.types]: library.md#enumerated.types
167
  [forward.iterators]: iterators.md#forward.iterators
168
  [input.iterators]: iterators.md#input.iterators
169
  [output.iterators]: iterators.md#output.iterators
170
  [re]: #re
 
215
  [re.tokiter.comp]: #re.tokiter.comp
216
  [re.tokiter.deref]: #re.tokiter.deref
217
  [re.tokiter.incr]: #re.tokiter.incr
218
  [re.traits]: #re.traits
219
  [sequence.reqmts]: containers.md#sequence.reqmts
220
+ [strings.general]: strings.md#strings.general
221
  [tab:re.lib.summary]: #tab:re.lib.summary
222
  [tab:re.traits.classnames]: #tab:re.traits.classnames
223
  [tab:re:RegexpTraits]: #tab:re:RegexpTraits
224
  [tab:re:alg:match]: #tab:re:alg:match
225
  [tab:re:alg:search]: #tab:re:alg:search
226
  [tab:re:errortype]: #tab:re:errortype
227
  [tab:re:matchflag]: #tab:re:matchflag
228
  [tab:re:results:assign]: #tab:re:results:assign
229
  [tab:re:syntaxoption]: #tab:re:syntaxoption
230
 
231
+ [^1]: For example, if the parameter `icase` is `true` then `[[:lower:]]`
232
  is the same as `[[:alpha:]]`.