mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Eval
- Implemented ::getBinaryOperators.
This commit is contained in:
parent
84f9bc52ef
commit
d7378d830f
2 changed files with 11 additions and 0 deletions
10
src/Eval.cpp
10
src/Eval.cpp
|
@ -224,6 +224,16 @@ void Eval::getOperators (std::vector <std::string>& all)
|
||||||
all.push_back (operators[i].op);
|
all.push_back (operators[i].op);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Static.
|
||||||
|
void Eval::getBinaryOperators (std::vector <std::string>& all)
|
||||||
|
{
|
||||||
|
all.clear ();
|
||||||
|
for (unsigned int i = 0; i < NUM_OPERATORS; ++i)
|
||||||
|
if (operators[i].type == 'b')
|
||||||
|
all.push_back (operators[i].op);
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
void Eval::evaluatePostfixStack (
|
void Eval::evaluatePostfixStack (
|
||||||
const std::vector <std::pair <std::string, Lexer::Type> >& tokens,
|
const std::vector <std::pair <std::string, Lexer::Type> >& tokens,
|
||||||
|
|
|
@ -50,6 +50,7 @@ public:
|
||||||
void debug (bool);
|
void debug (bool);
|
||||||
|
|
||||||
static void getOperators (std::vector <std::string>&);
|
static void getOperators (std::vector <std::string>&);
|
||||||
|
static void getBinaryOperators (std::vector <std::string>&);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void evaluatePostfixStack (const std::vector <std::pair <std::string, Lexer::Type> >&, Variant&) const;
|
void evaluatePostfixStack (const std::vector <std::pair <std::string, Lexer::Type> >&, Variant&) const;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue