mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-20 22:33:08 +02:00
Eval: Eliminated string def
This commit is contained in:
parent
c7f2739dda
commit
ae27a1b343
1 changed files with 3 additions and 5 deletions
|
@ -34,8 +34,6 @@
|
||||||
#include <shared.h>
|
#include <shared.h>
|
||||||
#include <format.h>
|
#include <format.h>
|
||||||
|
|
||||||
#define STRING_EVAL_NO_EVAL "The expression could not be evaluated."
|
|
||||||
|
|
||||||
extern Task& contextTask;
|
extern Task& contextTask;
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -232,7 +230,7 @@ void Eval::evaluatePostfixStack (
|
||||||
token.first == "!")
|
token.first == "!")
|
||||||
{
|
{
|
||||||
if (values.size () < 1)
|
if (values.size () < 1)
|
||||||
throw std::string (STRING_EVAL_NO_EVAL);
|
throw std::string ("The expression could not be evaluated.");
|
||||||
|
|
||||||
Variant right = values.back ();
|
Variant right = values.back ();
|
||||||
values.pop_back ();
|
values.pop_back ();
|
||||||
|
@ -245,7 +243,7 @@ void Eval::evaluatePostfixStack (
|
||||||
token.first == "_neg_")
|
token.first == "_neg_")
|
||||||
{
|
{
|
||||||
if (values.size () < 1)
|
if (values.size () < 1)
|
||||||
throw std::string (STRING_EVAL_NO_EVAL);
|
throw std::string ("The expression could not be evaluated.");
|
||||||
|
|
||||||
Variant right = values.back ();
|
Variant right = values.back ();
|
||||||
values.pop_back ();
|
values.pop_back ();
|
||||||
|
@ -269,7 +267,7 @@ void Eval::evaluatePostfixStack (
|
||||||
else if (token.second == Lexer::Type::op)
|
else if (token.second == Lexer::Type::op)
|
||||||
{
|
{
|
||||||
if (values.size () < 2)
|
if (values.size () < 2)
|
||||||
throw std::string (STRING_EVAL_NO_EVAL);
|
throw std::string ("The expression could not be evaluated.");
|
||||||
|
|
||||||
Variant right = values.back ();
|
Variant right = values.back ();
|
||||||
values.pop_back ();
|
values.pop_back ();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue