From 73e767ec3e10ad68f850e698a395ba9f389a568b Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Fri, 31 Oct 2014 19:58:24 -0400 Subject: [PATCH] CLI - Added debug.parser=3 support to ::desugarAttributes. --- src/CLI.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/CLI.cpp b/src/CLI.cpp index b848b96a6..3286b6953 100644 --- a/src/CLI.cpp +++ b/src/CLI.cpp @@ -797,6 +797,7 @@ void CLI::desugarTags () // :['"][]['"] --> name = value void CLI::desugarAttributes () { + bool changes = false; std::vector reconstructed; std::vector ::iterator a; for (a = _args.begin (); a != _args.end (); ++a) @@ -882,14 +883,22 @@ void CLI::desugarAttributes () } } - if (!found) + if (found) + changes = true; + else reconstructed.push_back (*a); } else reconstructed.push_back (*a); } - _args = reconstructed; + if (changes) + { + _args = reconstructed; + + if (context.config.getInteger ("debug.parser") >= 3) + context.debug (context.cli.dump ("CLI::analyze desugarAttributes")); + } } ////////////////////////////////////////////////////////////////////////////////