]> granicus.if.org Git - re2c/commitdiff
- If no specNone is present decrease all specs
authorhelly <helly@642ea486-5414-0410-9d7f-a0204ed87703>
Wed, 25 Apr 2007 21:59:14 +0000 (21:59 +0000)
committerhelly <helly@642ea486-5414-0410-9d7f-a0204ed87703>
Wed, 25 Apr 2007 21:59:14 +0000 (21:59 +0000)
re2c/bootstrap/parser.cc
re2c/parser.y

index 481fc410ff7e184bc47e62b3e705d68051d0b5ea..6238ab805479266b3921a086d3db56d1aadff7e4 100644 (file)
@@ -1867,6 +1867,15 @@ void parse(Scanner& i, std::ostream& o, std::ostream* h)
                                // Note that "0" inserts first, which is important.
                                specMap["0"] = std::make_pair(0, specNone);
                        }
+                       else
+                       {
+                               // We reserved 0 for specNone but is isn't present,
+                               // so we can decrease all specs.
+                               for(it = specMap.begin(); it != specMap.end(); ++it)
+                               {
+                                       it->second.first--;
+                               }
+                       }
 
                        size_t nCount = specMap.size();
                        for(it = specMap.begin(); it != specMap.end(); ++it)
index 73aa5db00fb513566a9f80bbcf8b916b9d9d671a..ec62df9f314afc45bd02c4a4b3e389b0652a3346 100644 (file)
@@ -396,6 +396,15 @@ void parse(Scanner& i, std::ostream& o, std::ostream* h)
                                // Note that "0" inserts first, which is important.
                                specMap["0"] = std::make_pair(0, specNone);
                        }
+                       else
+                       {
+                               // We reserved 0 for specNone but is isn't present,
+                               // so we can decrease all specs.
+                               for(it = specMap.begin(); it != specMap.end(); ++it)
+                               {
+                                       it->second.first--;
+                               }
+                       }
 
                        size_t nCount = specMap.size();
                        for(it = specMap.begin(); it != specMap.end(); ++it)