File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -196,17 +196,17 @@ static std::string pair_str(const std::pair<int, int> & p) {
196
196
}
197
197
198
198
static std::vector<int > parse_int_range (const std::string & s) {
199
- // start[-end [+step]][,start[-end [+step]]...]
199
+ // first[-last [+step]][,first[-last [+step]]...]
200
200
std::regex range_regex (R"( ^(\d+)(?:-(\d+)(?:\+(\d+))?)?(,|$))" );
201
201
std::smatch match;
202
202
std::string::const_iterator search_start (s.cbegin ());
203
203
std::vector<int > result;
204
204
while (std::regex_search (search_start, s.cend (), match, range_regex)) {
205
- int start = std::stoi (match[1 ]);
206
- int end = match[2 ].matched ? std::stoi (match[2 ]) : start ;
205
+ int first = std::stoi (match[1 ]);
206
+ int last = match[2 ].matched ? std::stoi (match[2 ]) : first ;
207
207
int step = match[3 ].matched ? std::stoi (match[3 ]) : 1 ;
208
208
209
- for (int i = start ; i <= end ; i += step) {
209
+ for (int i = first ; i <= last ; i += step) {
210
210
result.push_back (i);
211
211
}
212
212
search_start = match.suffix ().first ;
You can’t perform that action at this time.
0 commit comments