- Renamed the ::desugar* methods to be more specific.
This commit is contained in:
Paul Beckingham
2014-11-09 11:14:34 -05:00
parent 3b1f244f42
commit 9d0ae4f09d
2 changed files with 20 additions and 21 deletions

View File

@@ -27,7 +27,6 @@
#include <cmake.h> #include <cmake.h>
#include <sstream> #include <sstream>
#include <algorithm> #include <algorithm>
#include <iostream> // TODO Remove.
#include <Context.h> #include <Context.h>
#include <Nibbler.h> #include <Nibbler.h>
#include <Lexer.h> #include <Lexer.h>
@@ -429,15 +428,15 @@ void CLI::analyze (bool parse /* = true */, bool strict /* = false */)
findIDs (); findIDs ();
findUUIDs (); findUUIDs ();
insertIDExpr (); insertIDExpr ();
desugarTags (); desugarFilterTags ();
findStrayModifications (); findStrayModifications ();
desugarAttributes (); desugarFilterAttributes ();
desugarAttributeModifiers (); desugarFilterAttributeModifiers ();
desugarPatterns (); desugarFilterPatterns ();
findOperators (); findOperators ();
findAttributes (); findAttributes ();
insertJunctions (); insertJunctions ();
desugarPlainArgs (); desugarFilterPlainArgs ();
// Decompose the elements for MODIFICATIONs. // Decompose the elements for MODIFICATIONs.
decomposeModAttributes (); decomposeModAttributes ();
@@ -887,7 +886,7 @@ bool CLI::exactMatch (
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// +tag --> tags _hastag_ tag // +tag --> tags _hastag_ tag
// -tag --> tags _notag_ tag // -tag --> tags _notag_ tag
void CLI::desugarTags () void CLI::desugarFilterTags ()
{ {
bool changes = false; bool changes = false;
std::vector <A> reconstructed; std::vector <A> reconstructed;
@@ -934,7 +933,7 @@ void CLI::desugarTags ()
_args = reconstructed; _args = reconstructed;
if (context.config.getInteger ("debug.parser") >= 3) if (context.config.getInteger ("debug.parser") >= 3)
context.debug (context.cli.dump ("CLI::analyze desugarTags")); context.debug (context.cli.dump ("CLI::analyze desugarFilterTags"));
} }
} }
@@ -966,7 +965,7 @@ void CLI::findStrayModifications ()
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// <name>:['"][<value>]['"] --> name = value // <name>:['"][<value>]['"] --> name = value
void CLI::desugarAttributes () void CLI::desugarFilterAttributes ()
{ {
bool changes = false; bool changes = false;
std::vector <A> reconstructed; std::vector <A> reconstructed;
@@ -1069,13 +1068,13 @@ void CLI::desugarAttributes ()
_args = reconstructed; _args = reconstructed;
if (context.config.getInteger ("debug.parser") >= 3) if (context.config.getInteger ("debug.parser") >= 3)
context.debug (context.cli.dump ("CLI::analyze desugarAttributes")); context.debug (context.cli.dump ("CLI::analyze desugarFilterAttributes"));
} }
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// <name>.[~]<mod>[:=]['"]<value>['"] --> name <op> value // <name>.[~]<mod>[:=]['"]<value>['"] --> name <op> value
void CLI::desugarAttributeModifiers () void CLI::desugarFilterAttributeModifiers ()
{ {
bool changes = false; bool changes = false;
std::vector <A> reconstructed; std::vector <A> reconstructed;
@@ -1253,13 +1252,13 @@ void CLI::desugarAttributeModifiers ()
_args = reconstructed; _args = reconstructed;
if (context.config.getInteger ("debug.parser") >= 3) if (context.config.getInteger ("debug.parser") >= 3)
context.debug (context.cli.dump ("CLI::analyze desugarAttributeModifiers")); context.debug (context.cli.dump ("CLI::analyze desugarFilterAttributeModifiers"));
} }
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// /pattern/ --> description ~ 'pattern' // /pattern/ --> description ~ 'pattern'
void CLI::desugarPatterns () void CLI::desugarFilterPatterns ()
{ {
bool changes = false; bool changes = false;
std::vector <A> reconstructed; std::vector <A> reconstructed;
@@ -1303,7 +1302,7 @@ void CLI::desugarPatterns ()
_args = reconstructed; _args = reconstructed;
if (context.config.getInteger ("debug.parser") >= 3) if (context.config.getInteger ("debug.parser") >= 3)
context.debug (context.cli.dump ("CLI::analyze desugarPatterns")); context.debug (context.cli.dump ("CLI::analyze desugarFilterPatterns"));
} }
} }
@@ -1606,7 +1605,7 @@ void CLI::insertIDExpr ()
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
void CLI::desugarPlainArgs () void CLI::desugarFilterPlainArgs ()
{ {
bool changes = false; bool changes = false;
std::vector <A> reconstructed; std::vector <A> reconstructed;
@@ -1650,7 +1649,7 @@ void CLI::desugarPlainArgs ()
_args = reconstructed; _args = reconstructed;
if (context.config.getInteger ("debug.parser") >= 3) if (context.config.getInteger ("debug.parser") >= 3)
context.debug (context.cli.dump ("CLI::analyze desugarPlainArgs")); context.debug (context.cli.dump ("CLI::analyze desugarFilterPlainArgs"));
} }
} }

View File

@@ -92,15 +92,15 @@ private:
void findOverrides (); void findOverrides ();
void categorize (); void categorize ();
bool exactMatch (const std::string&, const std::string&) const; bool exactMatch (const std::string&, const std::string&) const;
void desugarTags (); void desugarFilterTags ();
void findStrayModifications (); void findStrayModifications ();
void desugarAttributes (); void desugarFilterAttributes ();
void desugarAttributeModifiers (); void desugarFilterAttributeModifiers ();
void desugarPatterns (); void desugarFilterPatterns ();
void findIDs (); void findIDs ();
void findUUIDs (); void findUUIDs ();
void insertIDExpr (); void insertIDExpr ();
void desugarPlainArgs (); void desugarFilterPlainArgs ();
void findOperators (); void findOperators ();
void findAttributes (); void findAttributes ();
void insertJunctions (); void insertJunctions ();