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

Method parseArithmetic

src/Eval.cpp:479–492  ·  view source on GitHub ↗

/////////////////////////////////////////////////////////////////////////// Arithmetic --> Geometric {( "+" | "-" ) Geometric}

Source from the content-addressed store, hash-verified

477////////////////////////////////////////////////////////////////////////////////
478// Arithmetic --> Geometric {( "+" | "-" ) Geometric}
479bool Eval::parseArithmetic(std::vector<std::pair<std::string, Lexer::Type>>& infix,
480 unsigned int& i) const {
481 if (i < infix.size() && parseGeometric(infix, i)) {
482 while (i < infix.size() && infix[i].second == Lexer::Type::op &&
483 (infix[i].first == "+" || infix[i].first == "-")) {
484 ++i;
485 if (!parseGeometric(infix, i)) return false;
486 }
487
488 return true;
489 }
490
491 return false;
492}
493
494////////////////////////////////////////////////////////////////////////////////
495// Geometric --> Tag {( "*" | "/" | "%" ) Tag}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected