Skip to content

Commit fc22a17

Browse files
[re.iter] Clean up exposition-only member names for regex iterators
This PR renames exposition-only members for `regex_iterator` and `regex_token_iterator`, and properly uses italic format for them. In [re.regiter] `regex_iterator`: - `begin` -> _`begin_`_ - `end` -> _`end_`_ - `pregex` -> _`pregex_`_ - `flags` -> _`flags_`_ - `match` -> _`match_`_ In [re.tokiter] `regex_token_iterator`: - `position_iterator` -> _`position-iterator`_ - `position` -> _`position_`_ - `result` -> _`result_`_ - `suffix` -> _`suffix_`_ - `N` -> _`n_`_ - `subs` -> _`subs_`_
1 parent e908596 commit fc22a17

1 file changed

Lines changed: 69 additions & 69 deletions

File tree

‎source/text.tex‎

Lines changed: 69 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -12331,19 +12331,19 @@
1233112331
regex_iterator operator++(int) = default;
1233212332

1233312333
private:
12334-
BidirectionalIterator begin; // \expos
12335-
BidirectionalIterator end; // \expos
12336-
const regex_type* pregex; // \expos
12337-
regex_constants::match_flag_type flags; // \expos
12338-
match_results<BidirectionalIterator> match; // \expos
12334+
BidirectionalIterator @\exposid{begin_}@; // \expos
12335+
BidirectionalIterator @\exposid{end_}@; // \expos
12336+
const regex_type* @\exposid{pregex_}@; // \expos
12337+
regex_constants::match_flag_type @\exposid{flags_}@; // \expos
12338+
match_results<BidirectionalIterator> @\exposid{match_}@; // \expos
1233912339
};
1234012340
}
1234112341
\end{codeblock}
1234212342

1234312343
\pnum
1234412344
An object of type \tcode{regex_iterator} that is not an end-of-sequence iterator
12345-
holds a \textit{zero-length match} if \tcode{match[0].matched == true} and
12346-
\tcode{match[0].first == match[0].second}.
12345+
holds a \textit{zero-length match} if \tcode{\exposid{match_}[0].matched == true} and
12346+
\tcode{\exposid{match_}[0].first == \exposid{match_}[0].second}.
1234712347
\begin{note}
1234812348
For
1234912349
example, this can occur when the part of the regular expression that
@@ -12374,10 +12374,10 @@
1237412374
\begin{itemdescr}
1237512375
\pnum
1237612376
\effects
12377-
Initializes \tcode{begin} and \tcode{end} to
12377+
Initializes \exposid{begin_} and \exposid{end_} to
1237812378
\tcode{a} and \tcode{b}, respectively, sets
12379-
\tcode{pregex} to \tcode{addressof(re)}, sets \tcode{flags} to
12380-
\tcode{m}, then calls \tcode{regex_search(begin, end, match, *pregex, flags)}. If this
12379+
\exposid{pregex_} to \tcode{addressof(re)}, sets \exposid{flags_} to
12380+
\tcode{m}, then calls \tcode{regex_search(\exposid{begin_}, \exposid{end_}, \exposid{match_}, *\exposid{pregex_}, \exposid{flags_})}. If this
1238112381
call returns \tcode{false} the constructor sets \tcode{*this} to the end-of-sequence
1238212382
iterator.
1238312383
\end{itemdescr}
@@ -12395,11 +12395,11 @@
1239512395
\tcode{true} if \tcode{*this} and \tcode{right} are both end-of-sequence
1239612396
iterators or if the following conditions all hold:
1239712397
\begin{itemize}
12398-
\item \tcode{begin == right.begin},
12399-
\item \tcode{end == right.end},
12400-
\item \tcode{pregex == right.pregex},
12401-
\item \tcode{flags == right.flags}, and
12402-
\item \tcode{match[0] == right.match[0]};
12398+
\item \tcode{\exposid{begin_} == right.\exposid{begin_}},
12399+
\item \tcode{\exposid{end_} == right.\exposid{end_}},
12400+
\item \tcode{\exposid{pregex_} == right.\exposid{pregex_}},
12401+
\item \tcode{\exposid{flags_} == right.\exposid{flags_}}, and
12402+
\item \tcode{\exposid{match_}[0] == right.\exposid{match_}[0]};
1240312403
\end{itemize}
1240412404
otherwise \tcode{false}.
1240512405
\end{itemdescr}
@@ -12414,7 +12414,7 @@
1241412414
\begin{itemdescr}
1241512415
\pnum
1241612416
\returns
12417-
\tcode{match}.
12417+
\exposid{match_}.
1241812418
\end{itemdescr}
1241912419

1242012420
\indexlibrarymember{operator->}{regex_iterator}%
@@ -12425,7 +12425,7 @@
1242512425
\begin{itemdescr}
1242612426
\pnum
1242712427
\returns
12428-
\tcode{addressof(match)}.
12428+
\tcode{addressof(\exposid{match_})}.
1242912429
\end{itemdescr}
1243012430

1243112431
\rSec4[re.regiter.incr]{Increment}
@@ -12440,19 +12440,19 @@
1244012440
\pnum
1244112441
\effects
1244212442
Constructs a local variable \tcode{start} of type \tcode{BidirectionalIterator} and
12443-
initializes it with the value of \tcode{match[0].second}.
12443+
initializes it with the value of \tcode{\exposid{match_}[0].second}.
1244412444

1244512445
\pnum
12446-
If the iterator holds a zero-length match and \tcode{start == end} the operator
12446+
If the iterator holds a zero-length match and \tcode{start == \exposid{end_}} the operator
1244712447
sets \tcode{*this} to the end-of-sequence iterator and returns \tcode{*this}.
1244812448

1244912449
\pnum
1245012450
\indexlibraryglobal{match_not_null}%
1245112451
\indexlibraryglobal{match_continuous}%
1245212452
Otherwise, if the iterator holds a zero-length match, the operator calls:
1245312453
\begin{codeblock}
12454-
regex_search(start, end, match, *pregex,
12455-
flags | regex_constants::match_not_null | regex_constants::match_continuous)
12454+
regex_search(start, \exposid{end_}, \exposid{match_}, *\exposid{pregex_},
12455+
\exposid{flags_} | regex_constants::match_not_null | regex_constants::match_continuous)
1245612456
\end{codeblock}
1245712457
If the call returns \tcode{true} the operator
1245812458
returns \tcode{*this}. Otherwise the operator increments \tcode{start} and continues as if
@@ -12461,22 +12461,22 @@
1246112461
\pnum
1246212462
\indexlibraryglobal{match_prev_avail}%
1246312463
If the most recent match was not a zero-length match, the operator sets
12464-
\tcode{flags} to \tcode{flags | regex_constants::match_prev_avail} and
12465-
calls \tcode{regex_search(start, end, match, *pregex, flags)}. If the call returns
12464+
\exposid{flags_} to \tcode{\exposid{flags_} | regex_constants::match_prev_avail} and
12465+
calls \tcode{regex_search(start, \exposid{end_}, \exposid{match_}, *\exposid{pregex_}, \exposid{flags_})}. If the call returns
1246612466
\tcode{false} the iterator sets \tcode{*this} to the end-of-sequence iterator. The
1246712467
iterator then returns \tcode{*this}.
1246812468

1246912469
\pnum
1247012470
In all cases in which the call to \tcode{regex_search} returns \tcode{true},
12471-
\tcode{match.prefix().first} shall be equal to the previous value of
12472-
\tcode{match[0].second}, and for each index \tcode{i} in the half-open range
12473-
\range{0}{match.size()} for which \tcode{match[i].matched} is \tcode{true},
12474-
\tcode{match.position(i)}
12475-
shall return \tcode{distance(begin, match[i].\brk{}first)}.
12471+
\tcode{\exposid{match_}.prefix().first} shall be equal to the previous value of
12472+
\tcode{\exposid{match_}[0].second}, and for each index \tcode{i} in the half-open range
12473+
\range{0}{\exposid{match_}.size()} for which \tcode{\exposid{match_}[i].matched} is \tcode{true},
12474+
\tcode{\exposid{match_}.position(i)}
12475+
shall return \tcode{distance(\exopsid{begin_},\brk{} \exposid{match_}[i].first)}.
1247612476

1247712477
\pnum
1247812478
\begin{note}
12479-
This means that \tcode{match.position(i)} gives the
12479+
This means that \tcode{\exposid{match_}.position(i)} gives the
1248012480
offset from the beginning of the target sequence, which is often not
1248112481
the same as the offset from the sequence passed in the call
1248212482
to \tcode{regex_search}.
@@ -12518,16 +12518,16 @@
1251812518
\pnum
1251912519
\indexlibraryglobal{match_results}%
1252012520
After it is constructed, the iterator finds and stores a value
12521-
\tcode{regex_iterator<BidirectionalIterator> position}
12522-
and sets the internal count \tcode{N} to zero. It also maintains a sequence
12523-
\tcode{subs} which contains a list of the sub-expressions which will be
12521+
\tcode{regex_iterator<BidirectionalIterator> \exposid{position_}}
12522+
and sets the internal count \exposid{n_} to zero. It also maintains a sequence
12523+
\exposid{subs_} which contains a list of the sub-expressions which will be
1252412524
enumerated. Every time \tcode{operator++} is used
12525-
the count \tcode{N} is incremented; if \tcode{N} exceeds or equals \tcode{subs.size()},
12526-
then the iterator increments member \tcode{position}
12527-
and sets count \tcode{N} to zero.
12525+
the count \exposid{n_} is incremented; if \exposid{n_} exceeds or equals \tcode{\exposid{subs_}.size()},
12526+
then the iterator increments member \exposid{position_}
12527+
and sets count \exposid{n_} to zero.
1252812528

1252912529
\pnum
12530-
If the end of sequence is reached (\tcode{position} is equal to the end of
12530+
If the end of sequence is reached (\exposid{position_} is equal to the end of
1253112531
sequence iterator), the iterator becomes equal to the end-of-sequence
1253212532
iterator value, unless the sub-expression being enumerated has index $-1$,
1253312533
in which case the iterator enumerates one last sub-expression that contains
@@ -12622,13 +12622,13 @@
1262212622
regex_token_iterator operator++(int) = default;
1262312623

1262412624
private:
12625-
using position_iterator =
12625+
using @\exposid{position-iterator}@ =
1262612626
regex_iterator<BidirectionalIterator, charT, traits>; // \expos
12627-
position_iterator position; // \expos
12628-
const value_type* result; // \expos
12629-
value_type suffix; // \expos
12630-
size_t N; // \expos
12631-
vector<int> subs; // \expos
12627+
@\exposid{position-iterator}@ @\exposid{position_}@; // \expos
12628+
const value_type* @\exposid{result_}@; // \expos
12629+
value_type @\exposid{suffix_}@; // \expos
12630+
size_t @\exposid{n_}@; // \expos
12631+
vector<int> @\exposid{subs_}@; // \expos
1263212632
};
1263312633
}
1263412634
\end{codeblock}
@@ -12637,23 +12637,23 @@
1263712637
A \textit{suffix iterator} is a \tcode{regex_token_iterator} object
1263812638
that points to a final sequence of characters at
1263912639
the end of the target sequence. In a suffix iterator the
12640-
member \tcode{result} holds a pointer to the data
12641-
member \tcode{suffix}, the value of the member \tcode{suffix.matched}
12642-
is \tcode{true}, \tcode{suffix.first} points to the beginning of the
12643-
final sequence, and \tcode{suffix.second} points to the end of the
12640+
member \exposid{result_} holds a pointer to the data
12641+
member \exposid{suffix_}, the value of the member \tcode{\exposid{suffix_}.matched}
12642+
is \tcode{true}, \tcode{\exposid{suffix_}.first} points to the beginning of the
12643+
final sequence, and \tcode{\exposid{suffix_}.second} points to the end of the
1264412644
final sequence.
1264512645

1264612646
\pnum
1264712647
\begin{note}
1264812648
For a suffix iterator, data
12649-
member \tcode{suffix.first} is the same as the end of the last match
12650-
found, and \tcode{suffix\brk.second} is the same as the end of the target
12649+
member \tcode{\exposid{suffix_}.first} is the same as the end of the last match
12650+
found, and \tcode{\exposid{suffix_}\brk.second} is the same as the end of the target
1265112651
sequence.
1265212652
\end{note}
1265312653

1265412654
\pnum
12655-
The \textit{current match} is \tcode{(*position).prefix()} if \tcode{subs[N] == -1}, or
12656-
\tcode{(*position)[subs[N]]} for any other value of \tcode{subs[N]}.
12655+
The \textit{current match} is \tcode{(*\exposid{position_}).prefix()} if \tcode{\exposid{subs_}[\exposid{n_}] == -1}, or
12656+
\tcode{(*\exposid{position_})[\exposid{subs_}[\exposid{n_}]]} for any other value of \tcode{\exposid{subs_}[\exposid{n_}]}.
1265712657

1265812658
\rSec4[re.tokiter.cnstr]{Constructors}
1265912659

@@ -12699,19 +12699,19 @@
1269912699

1270012700
\pnum
1270112701
\effects
12702-
The first constructor initializes the member \tcode{subs} to hold the single
12702+
The first constructor initializes the member \exposid{subs_} to hold the single
1270312703
value \tcode{submatch}.
1270412704
The second, third, and fourth constructors
12705-
initialize the member \tcode{subs} to hold a copy of the sequence of integer values
12705+
initialize the member \exposid{subs_} to hold a copy of the sequence of integer values
1270612706
pointed to by the iterator range
1270712707
\range{begin(submatches)}{end(submatches)}.
1270812708

1270912709
\pnum
12710-
Each constructor then sets \tcode{N} to 0, and \tcode{position} to
12711-
\tcode{position_iterator(a, b, re, m)}. If \tcode{position} is not an
12712-
end-of-sequence iterator the constructor sets \tcode{result} to the
12710+
Each constructor then sets \exposid{n_} to 0, and \exposid{position_} to
12711+
\tcode{\exposid{position-iterator}(a, b, re, m)}. If \exposid{position_} is not an
12712+
end-of-sequence iterator the constructor sets \exposid{result_} to the
1271312713
address of the current match. Otherwise if any of the values stored
12714-
in \tcode{subs} is equal to $-1$ the constructor sets \tcode{*this} to a suffix
12714+
in \exposid{subs_} is equal to $-1$ the constructor sets \tcode{*this} to a suffix
1271512715
iterator that points to the range \range{a}{b}, otherwise the constructor
1271612716
sets \tcode{*this} to an end-of-sequence iterator.
1271712717
\end{itemdescr}
@@ -12727,10 +12727,10 @@
1272712727
\pnum
1272812728
\returns
1272912729
\tcode{true} if \tcode{*this} and \tcode{right} are both end-of-sequence iterators,
12730-
or if \tcode{*this} and \tcode{right} are both suffix iterators and \tcode{suffix == right.suffix};
12730+
or if \tcode{*this} and \tcode{right} are both suffix iterators and \tcode{\exposid{suffix_} == right.\exposid{suffix_}};
1273112731
otherwise returns \tcode{false} if \tcode{*this} or \tcode{right} is an end-of-sequence
12732-
iterator or a suffix iterator. Otherwise returns \tcode{true} if \tcode{position == right.position},
12733-
\tcode{N == right.N}, and \tcode{subs == right.subs}. Otherwise returns \tcode{false}.
12732+
iterator or a suffix iterator. Otherwise returns \tcode{true} if \tcode{\exposid{position_} == right.\exposid{position_}},
12733+
\tcode{\exposid{n_} == right.\exposid{n_}}, and \tcode{\exposid{subs_} == right.\exposid{subs_}}. Otherwise returns \tcode{false}.
1273412734
\end{itemdescr}
1273512735

1273612736
\rSec4[re.tokiter.deref]{Indirection}
@@ -12743,7 +12743,7 @@
1274312743
\begin{itemdescr}
1274412744
\pnum
1274512745
\returns
12746-
\tcode{*result}.
12746+
\tcode{*\exposid{result_}}.
1274712747
\end{itemdescr}
1274812748

1274912749
\indexlibrarymember{operator->}{regex_token_iterator}%
@@ -12754,7 +12754,7 @@
1275412754
\begin{itemdescr}
1275512755
\pnum
1275612756
\returns
12757-
\tcode{result}.
12757+
\exposid{result_}.
1275812758
\end{itemdescr}
1275912759

1276012760

@@ -12769,25 +12769,25 @@
1276912769
\pnum
1277012770
\effects
1277112771
Constructs a local variable \tcode{prev} of
12772-
type \tcode{position_iterator}, initialized with the value
12773-
of \tcode{position}.
12772+
type \exposid{position-iterator}, initialized with the value
12773+
of \exposid{position_}.
1277412774

1277512775
\pnum
1277612776
If \tcode{*this} is a suffix iterator, sets \tcode{*this} to an
1277712777
end-of-sequence iterator.
1277812778

1277912779
\pnum
12780-
Otherwise, if \tcode{N + 1 < subs.size()}, increments \tcode{N} and
12781-
sets \tcode{result} to the address of the current match.
12780+
Otherwise, if \tcode{\exposid{n_} + 1 < \exposid{subs_}.size()}, increments \exposid{n_} and
12781+
sets \exposid{result_} to the address of the current match.
1278212782

1278312783
\pnum
12784-
Otherwise, sets \tcode{N} to 0 and
12785-
increments \tcode{position}. If \tcode{position} is not an
12786-
end-of-sequence iterator the operator sets \tcode{result} to the
12784+
Otherwise, sets \exposid{n_} to 0 and
12785+
increments \exposid{position_}. If \exposid{position_} is not an
12786+
end-of-sequence iterator the operator sets \exposid{result_} to the
1278712787
address of the current match.
1278812788

1278912789
\pnum
12790-
Otherwise, if any of the values stored in \tcode{subs} is equal to $-1$ and
12790+
Otherwise, if any of the values stored in \exposid{subs_} is equal to $-1$ and
1279112791
\tcode{prev->suffix().length()} is not 0 the operator sets \tcode{*this} to a
1279212792
suffix iterator that points to the range \range{prev->suffix().first}{prev->suffix().second}.
1279312793

0 commit comments

Comments
 (0)