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) {
196196}
197197
198198static  std::vector<int > parse_int_range (const  std::string & s) {
199-     //  start[-end [+step]][,start[-end [+step]]...]
199+     //  first[-last [+step]][,first[-last [+step]]...]
200200    std::regex range_regex (R"( ^(\d+)(?:-(\d+)(?:\+(\d+))?)?(,|$))"  );
201201    std::smatch match;
202202    std::string::const_iterator search_start (s.cbegin ());
203203    std::vector<int > result;
204204    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 ;
207207        int  step  = match[3 ].matched  ? std::stoi (match[3 ]) : 1 ;
208208
209-         for  (int  i = start ; i <= end ; i += step) {
209+         for  (int  i = first ; i <= last ; i += step) {
210210            result.push_back (i);
211211        }
212212        search_start = match.suffix ().first ;
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments