From 29668f497b7e05dfaaf44abfb7980497aefab8b9 Mon Sep 17 00:00:00 2001 From: helly Date: Wed, 25 Apr 2007 21:59:14 +0000 Subject: [PATCH] - If no specNone is present decrease all specs --- re2c/bootstrap/parser.cc | 9 +++++++++ re2c/parser.y | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/re2c/bootstrap/parser.cc b/re2c/bootstrap/parser.cc index 481fc410..6238ab80 100644 --- a/re2c/bootstrap/parser.cc +++ b/re2c/bootstrap/parser.cc @@ -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) diff --git a/re2c/parser.y b/re2c/parser.y index 73aa5db0..ec62df9f 100644 --- a/re2c/parser.y +++ b/re2c/parser.y @@ -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) -- 2.50.1