diff --git a/src/CLI.cpp b/src/CLI.cpp index 506850f60..451aa7467 100644 --- a/src/CLI.cpp +++ b/src/CLI.cpp @@ -726,7 +726,7 @@ void CLI::addArg (const std::string& arg, Lexer::Type type /* = Lexer::Type::wor Lexer lex (raw); lex.ambiguity (false); - std::vector > lexemes; + std::vector > lexemes; while (lex.token (lexeme, type)) lexemes.push_back (std::pair (lexeme, type)); @@ -742,7 +742,7 @@ void CLI::addArg (const std::string& arg, Lexer::Type type /* = Lexer::Type::wor { // How often have I said to you that when you have eliminated the // impossible, whatever remains, however improbable, must be the truth? - std::vector >::iterator l; + std::vector >::iterator l; for (l = lexemes.begin (); l != lexemes.end (); ++l) _original_args.push_back (l->first); } @@ -1388,7 +1388,7 @@ void CLI::findIDs () if (raw.find_first_not_of ("0123456789,-") == std::string::npos) { // Container for min/max ID ranges. - std::vector > ranges; + std::vector > ranges; // Split the ID list into elements. std::vector elements; @@ -1467,7 +1467,7 @@ void CLI::findIDs () a->tag ("ID"); // Save the ranges. - std::vector >::iterator r; + std::vector >::iterator r; for (r = ranges.begin (); r != ranges.end (); ++r) _id_ranges.push_back (*r); } @@ -1576,7 +1576,7 @@ void CLI::insertIDExpr () reconstructed.push_back (openParen); // Add all ID ranges. - std::vector >::iterator r; + std::vector >::iterator r; for (r = _id_ranges.begin (); r != _id_ranges.end (); ++r) { if (r != _id_ranges.begin ()) @@ -2375,17 +2375,17 @@ bool CLI::isName (const std::string& raw) const //////////////////////////////////////////////////////////////////////////////// bool CLI::disqualifyInsufficientTerms ( - const std::vector >& lexemes) const + const std::vector >& lexemes) const { return lexemes.size () < 3 ? true : false; } //////////////////////////////////////////////////////////////////////////////// bool CLI::disqualifyNoOps ( - const std::vector >& lexemes) const + const std::vector >& lexemes) const { bool foundOP = false; - std::vector >::const_iterator l; + std::vector >::const_iterator l; for (l = lexemes.begin (); l != lexemes.end (); ++l) if (l->second == Lexer::Type::op) foundOP = true; @@ -2395,13 +2395,13 @@ bool CLI::disqualifyNoOps ( //////////////////////////////////////////////////////////////////////////////// bool CLI::disqualifyOnlyParenOps ( - const std::vector >& lexemes) const + const std::vector >& lexemes) const { int opCount = 0; int opSugarCount = 0; int opParenCount = 0; - std::vector >::const_iterator l; + std::vector >::const_iterator l; for (l = lexemes.begin (); l != lexemes.end (); ++l) { if (l->second == Lexer::Type::op) @@ -2431,7 +2431,7 @@ bool CLI::disqualifyOnlyParenOps ( // as there are no operators in between, which includes syntactic sugar that // hides operators. bool CLI::disqualifyFirstLastBinary ( - const std::vector >& lexemes) const + const std::vector >& lexemes) const { bool firstBinary = false; bool lastBinary = false; @@ -2450,7 +2450,7 @@ bool CLI::disqualifyFirstLastBinary ( //////////////////////////////////////////////////////////////////////////////// // Disqualify terms when there operators hidden by syntactic sugar. bool CLI::disqualifySugarFree ( - const std::vector >& lexemes) const + const std::vector >& lexemes) const { bool sugared = true; for (unsigned int i = 1; i < lexemes.size () - 1; ++i) diff --git a/src/CLI.h b/src/CLI.h index 573809a39..5abf2da29 100644 --- a/src/CLI.h +++ b/src/CLI.h @@ -128,11 +128,11 @@ private: bool isOperator (const std::string&) const; bool isName (const std::string&) const; - bool disqualifyInsufficientTerms (const std::vector >&) const; - bool disqualifyNoOps (const std::vector >&) const; - bool disqualifyOnlyParenOps (const std::vector >&) const; - bool disqualifyFirstLastBinary (const std::vector >&) const; - bool disqualifySugarFree (const std::vector >&) const; + bool disqualifyInsufficientTerms (const std::vector >&) const; + bool disqualifyNoOps (const std::vector >&) const; + bool disqualifyOnlyParenOps (const std::vector >&) const; + bool disqualifyFirstLastBinary (const std::vector >&) const; + bool disqualifySugarFree (const std::vector >&) const; public: std::multimap _entities; @@ -140,7 +140,7 @@ public: std::vector _original_args; std::vector _args; - std::vector > _id_ranges; + std::vector > _id_ranges; std::vector _uuid_list; bool _strict; bool _terminated; diff --git a/src/Eval.cpp b/src/Eval.cpp index dbbd8d9fe..756a5c77c 100644 --- a/src/Eval.cpp +++ b/src/Eval.cpp @@ -127,7 +127,7 @@ void Eval::evaluateInfixExpression (const std::string& e, Variant& v) const // Reduce e to a vector of tokens. Lexer l (e); l.ambiguity (_ambiguity); - std::vector > tokens; + std::vector > tokens; std::string token; Lexer::Type type; while (l.token (token, type)) @@ -155,7 +155,7 @@ void Eval::evaluatePostfixExpression (const std::string& e, Variant& v) const // Reduce e to a vector of tokens. Lexer l (e); l.ambiguity (_ambiguity); - std::vector > tokens; + std::vector > tokens; std::string token; Lexer::Type type; while (l.token (token, type)) @@ -236,7 +236,7 @@ void Eval::getBinaryOperators (std::vector & all) //////////////////////////////////////////////////////////////////////////////// void Eval::evaluatePostfixStack ( - const std::vector >& tokens, + const std::vector >& tokens, Variant& result) const { if (tokens.size () == 0) @@ -245,7 +245,7 @@ void Eval::evaluatePostfixStack ( // This is stack used by the postfix evaluator. std::vector values; - std::vector >::const_iterator token; + std::vector >::const_iterator token; for (token = tokens.begin (); token != tokens.end (); ++token) { // Unary operators. @@ -444,7 +444,7 @@ void Eval::evaluatePostfixStack ( // Primitive --> "(" Logical ")" | Variant // void Eval::infixParse ( - std::vector >& infix) const + std::vector >& infix) const { unsigned int i = 0; parseLogical (infix, i); @@ -453,7 +453,7 @@ void Eval::infixParse ( //////////////////////////////////////////////////////////////////////////////// // Logical --> Regex {( "and" | "or" | "xor" ) Regex} bool Eval::parseLogical ( - std::vector >& infix, + std::vector >& infix, unsigned int &i) const { if (i < infix.size () && @@ -479,7 +479,7 @@ bool Eval::parseLogical ( //////////////////////////////////////////////////////////////////////////////// // Regex --> Equality {( "~" | "!~" ) Equality} bool Eval::parseRegex ( - std::vector >& infix, + std::vector >& infix, unsigned int &i) const { if (i < infix.size () && @@ -504,7 +504,7 @@ bool Eval::parseRegex ( //////////////////////////////////////////////////////////////////////////////// // Equality --> Comparative {( "==" | "=" | "!==" | "!=" ) Comparative} bool Eval::parseEquality ( - std::vector >& infix, + std::vector >& infix, unsigned int &i) const { if (i < infix.size () && @@ -531,7 +531,7 @@ bool Eval::parseEquality ( //////////////////////////////////////////////////////////////////////////////// // Comparative --> Arithmetic {( "<=" | "<" | ">=" | ">" ) Arithmetic} bool Eval::parseComparative ( - std::vector >& infix, + std::vector >& infix, unsigned int &i) const { if (i < infix.size () && @@ -558,7 +558,7 @@ bool Eval::parseComparative ( //////////////////////////////////////////////////////////////////////////////// // Arithmetic --> Geometric {( "+" | "-" ) Geometric} bool Eval::parseArithmetic ( - std::vector >& infix, + std::vector >& infix, unsigned int &i) const { if (i < infix.size () && @@ -583,7 +583,7 @@ bool Eval::parseArithmetic ( //////////////////////////////////////////////////////////////////////////////// // Geometric --> Tag {( "*" | "/" | "%" ) Tag} bool Eval::parseGeometric ( - std::vector >& infix, + std::vector >& infix, unsigned int &i) const { if (i < infix.size () && @@ -609,7 +609,7 @@ bool Eval::parseGeometric ( //////////////////////////////////////////////////////////////////////////////// // Tag --> Unary {( "_hastag_" | "_notag_" ) Unary} bool Eval::parseTag ( - std::vector >& infix, + std::vector >& infix, unsigned int &i) const { if (i < infix.size () && @@ -634,7 +634,7 @@ bool Eval::parseTag ( //////////////////////////////////////////////////////////////////////////////// // Unary --> [( "-" | "+" | "!" )] Exponent bool Eval::parseUnary ( - std::vector >& infix, + std::vector >& infix, unsigned int &i) const { if (i < infix.size ()) @@ -661,7 +661,7 @@ bool Eval::parseUnary ( //////////////////////////////////////////////////////////////////////////////// // Exponent --> Primitive ["^" Primitive] bool Eval::parseExponent ( - std::vector >& infix, + std::vector >& infix, unsigned int& i) const { if (i < infix.size () && @@ -685,7 +685,7 @@ bool Eval::parseExponent ( //////////////////////////////////////////////////////////////////////////////// // Primitive --> "(" Logical ")" | Variant bool Eval::parsePrimitive ( - std::vector >& infix, + std::vector >& infix, unsigned int &i) const { if (i < infix.size ()) @@ -767,24 +767,24 @@ bool Eval::parsePrimitive ( // Exit. // void Eval::infixToPostfix ( - std::vector >& infix) const + std::vector >& infix) const { // Short circuit. if (infix.size () == 1) return; // Result. - std::vector > postfix; + std::vector > postfix; // Shunting yard. - std::vector > op_stack; + std::vector > op_stack; // Operator characteristics. char type; unsigned int precedence; char associativity; - std::vector >::iterator token; + std::vector >::iterator token; for (token = infix.begin (); token != infix.end (); ++token) { if (token->second == Lexer::Type::op && @@ -866,7 +866,7 @@ bool Eval::identifyOperator ( //////////////////////////////////////////////////////////////////////////////// std::string Eval::dump ( - std::vector >& tokens) const + std::vector >& tokens) const { // Set up a color mapping. std::map color_map; @@ -880,7 +880,7 @@ std::string Eval::dump ( color_map[Lexer::Type::duration] = Color ("rgb531 on gray6"); std::string output; - std::vector >::const_iterator i; + std::vector >::const_iterator i; for (i = tokens.begin (); i != tokens.end (); ++i) { if (i != tokens.begin ()) diff --git a/src/Eval.h b/src/Eval.h index 16765ff4d..5b56cc191 100644 --- a/src/Eval.h +++ b/src/Eval.h @@ -53,28 +53,28 @@ public: static void getBinaryOperators (std::vector &); private: - void evaluatePostfixStack (const std::vector >&, Variant&) const; - void infixToPostfix (std::vector >&) const; - void infixParse (std::vector >&) const; - bool parseLogical (std::vector >&, unsigned int &) const; - bool parseRegex (std::vector >&, unsigned int &) const; - bool parseEquality (std::vector >&, unsigned int &) const; - bool parseComparative (std::vector >&, unsigned int &) const; - bool parseArithmetic (std::vector >&, unsigned int &) const; - bool parseGeometric (std::vector >&, unsigned int &) const; - bool parseTag (std::vector >&, unsigned int &) const; - bool parseUnary (std::vector >&, unsigned int &) const; - bool parseExponent (std::vector >&, unsigned int &) const; - bool parsePrimitive (std::vector >&, unsigned int &) const; + void evaluatePostfixStack (const std::vector >&, Variant&) const; + void infixToPostfix (std::vector >&) const; + void infixParse (std::vector >&) const; + bool parseLogical (std::vector >&, unsigned int &) const; + bool parseRegex (std::vector >&, unsigned int &) const; + bool parseEquality (std::vector >&, unsigned int &) const; + bool parseComparative (std::vector >&, unsigned int &) const; + bool parseArithmetic (std::vector >&, unsigned int &) const; + bool parseGeometric (std::vector >&, unsigned int &) const; + bool parseTag (std::vector >&, unsigned int &) const; + bool parseUnary (std::vector >&, unsigned int &) const; + bool parseExponent (std::vector >&, unsigned int &) const; + bool parsePrimitive (std::vector >&, unsigned int &) const; bool identifyOperator (const std::string&, char&, unsigned int&, char&) const; - std::string dump (std::vector >&) const; + std::string dump (std::vector >&) const; private: std::vector _sources; bool _ambiguity; bool _debug; - std::vector > _compiled; + std::vector > _compiled; }; diff --git a/src/Task.cpp b/src/Task.cpp index cae52cb3a..760b94e56 100644 --- a/src/Task.cpp +++ b/src/Task.cpp @@ -85,7 +85,7 @@ float Task::urgencyBlockingCoefficient = 0.0; float Task::urgencyAgeCoefficient = 0.0; float Task::urgencyAgeMax = 0.0; -std::map > Task::customOrder; +std::map > Task::customOrder; static const std::string dummy (""); diff --git a/src/Task.h b/src/Task.h index dae2a73d0..5b76428b0 100644 --- a/src/Task.h +++ b/src/Task.h @@ -42,7 +42,7 @@ public: static bool regex; static std::map attributes; // name -> type static std::map coefficients; - static std::map > customOrder; + static std::map > customOrder; static float urgencyProjectCoefficient; static float urgencyActiveCoefficient; static float urgencyScheduledCoefficient; diff --git a/src/ViewTask.cpp b/src/ViewTask.cpp index 5168aae83..5414bec47 100644 --- a/src/ViewTask.cpp +++ b/src/ViewTask.cpp @@ -242,7 +242,7 @@ std::string ViewTask::render (std::vector & data, std::vector & seque // Compose column headers. unsigned int max_lines = 0; - std::vector > headers; + std::vector > headers; for (unsigned int c = 0; c < _columns.size (); ++c) { headers.push_back (std::vector ()); @@ -295,7 +295,7 @@ std::string ViewTask::render (std::vector & data, std::vector & seque // Compose, render columns, in sequence. _rows = 0; - std::vector > cells; + std::vector > cells; std::vector ::iterator s; for (unsigned int s = 0; s < sequence.size (); ++s) { diff --git a/src/ViewText.cpp b/src/ViewText.cpp index 4484995ed..82021030b 100644 --- a/src/ViewText.cpp +++ b/src/ViewText.cpp @@ -186,7 +186,7 @@ std::string ViewText::render () // Compose column headers. unsigned int max_lines = 0; - std::vector > headers; + std::vector > headers; for (unsigned int c = 0; c < _columns.size (); ++c) { headers.push_back (std::vector ()); @@ -238,7 +238,7 @@ std::string ViewText::render () // Compose, render columns, in sequence. _rows = 0; - std::vector > cells; + std::vector > cells; for (unsigned int row = 0; row < _data.size (); ++row) { max_lines = 0; diff --git a/src/ViewText.h b/src/ViewText.h index 00357ca57..9873f104e 100644 --- a/src/ViewText.h +++ b/src/ViewText.h @@ -68,24 +68,24 @@ public: std::string render (); private: - std::vector > _data; - std::vector > _color; - std::vector _columns; - int _width; - int _left_margin; - Color _header; - Color _odd; - Color _even; - int _intra_padding; - Color _intra_odd; - Color _intra_even; - int _extra_padding; - Color _extra_odd; - Color _extra_even; - int _truncate_lines; - int _truncate_rows; - int _lines; - int _rows; + std::vector > _data; + std::vector > _color; + std::vector _columns; + int _width; + int _left_margin; + Color _header; + Color _odd; + Color _even; + int _intra_padding; + Color _intra_odd; + Color _intra_even; + int _extra_padding; + Color _extra_odd; + Color _extra_even; + int _truncate_lines; + int _truncate_rows; + int _lines; + int _rows; }; #endif diff --git a/src/commands/CmdCalendar.cpp b/src/commands/CmdCalendar.cpp index 232f7b446..fc9952b6c 100644 --- a/src/commands/CmdCalendar.cpp +++ b/src/commands/CmdCalendar.cpp @@ -366,7 +366,7 @@ int CmdCalendar::execute (std::string& output) holTable.colorHeader (color_label); Config::const_iterator it; - std::map > hm; // we need to store multiple holidays per day + std::map > hm; // we need to store multiple holidays per day for (it = context.config.begin (); it != context.config.end (); ++it) if (it->first.substr (0, 8) == "holiday.") if (it->first.substr (it->first.size () - 4) == "name") @@ -389,7 +389,7 @@ int CmdCalendar::execute (std::string& output) if (format == "") format = context.config.get ("dateformat"); - std::map >::iterator hm_it; + std::map >::iterator hm_it; for (hm_it = hm.begin(); hm_it != hm.end(); ++hm_it) { std::vector v = hm_it->second; diff --git a/test/lexer.t.cpp b/test/lexer.t.cpp index eb50ac11c..9ea0531b3 100644 --- a/test/lexer.t.cpp +++ b/test/lexer.t.cpp @@ -38,7 +38,7 @@ int main (int argc, char** argv) { UnitTest t (765); - std::vector > tokens; + std::vector > tokens; std::string token; Lexer::Type type;