MCPcopy Create free account
hub / github.com/GothenburgBitFactory/taskwarrior / parseComparative

Method parseComparative

src/Eval.cpp:461–475  ·  view source on GitHub ↗

/////////////////////////////////////////////////////////////////////////// Comparative --> Arithmetic {( "<=" | "<" | ">=" | ">" ) Arithmetic}

Source from the content-addressed store, hash-verified

459////////////////////////////////////////////////////////////////////////////////
460// Comparative --> Arithmetic {( "<=" | "<" | ">=" | ">" ) Arithmetic}
461bool Eval::parseComparative(std::vector<std::pair<std::string, Lexer::Type>>& infix,
462 unsigned int& i) const {
463 if (i < infix.size() && parseArithmetic(infix, i)) {
464 while (i < infix.size() && infix[i].second == Lexer::Type::op &&
465 (infix[i].first == "<=" || infix[i].first == "<" || infix[i].first == ">=" ||
466 infix[i].first == ">")) {
467 ++i;
468 if (!parseArithmetic(infix, i)) return false;
469 }
470
471 return true;
472 }
473
474 return false;
475}
476
477////////////////////////////////////////////////////////////////////////////////
478// Arithmetic --> Geometric {( "+" | "-" ) Geometric}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected