TW-1806: project:ide is not allowed

- Thanks to Slaven ʙanovic.
This commit is contained in:
Paul Beckingham 2016-05-20 11:13:46 -05:00
parent 0683e14777
commit bac71c7670
13 changed files with 36 additions and 9 deletions

View file

@ -291,3 +291,4 @@ suggestions:
Reg Reg
Yaroslav Molochko Yaroslav Molochko
Michael Meier Michael Meier
Slaven ʙanovic

View file

@ -14,6 +14,8 @@
pending tasks. pending tasks.
- TW-1795 Calendar underline on Day padding - TW-1795 Calendar underline on Day padding
(thanks to Renato Alves). (thanks to Renato Alves).
- TW-1806 project:ide is not allowed
(thanks to Slaven ʙanovic).
- Added 'juhannus' as a synonym for 'midsommarafton' - Added 'juhannus' as a synonym for 'midsommarafton'
(thanks to Lynoure Braakman). (thanks to Lynoure Braakman).
- Deprecated the 'DUETODAY' virtual tag, which is a synonym for the 'TODAY' - Deprecated the 'DUETODAY' virtual tag, which is a synonym for the 'TODAY'

View file

@ -387,7 +387,7 @@ void Eval::evaluatePostfixStack (
// If there is more than one variant left on the stack, then the original // If there is more than one variant left on the stack, then the original
// expression was not valid. // expression was not valid.
if (values.size () != 1) if (values.size () != 1)
throw std::string (STRING_EVAL_NO_EVAL); throw std::string (STRING_EVAL_NOT_EXPRESSION);
result = values[0]; result = values[0];
} }

View file

@ -124,15 +124,30 @@ void ColumnProject::modify (Task& task, const std::string& value)
if (lexer.token (domRef, type) && if (lexer.token (domRef, type) &&
type == Lexer::Type::dom) type == Lexer::Type::dom)
{ {
Eval e; try
e.addSource (domSource); {
e.addSource (namedDates); Eval e;
contextTask = task; e.addSource (domSource);
e.addSource (namedDates);
contextTask = task;
Variant v; Variant v;
e.evaluateInfixExpression (value, v); e.evaluateInfixExpression (value, v);
task.set (_name, (std::string) v); task.set (_name, (std::string) v);
context.debug (label + _name + " <-- '" + (std::string) v + "' <-- '" + value + "'"); context.debug (label + _name + " <-- '" + (std::string) v + "' <-- '" + value + "'");
}
catch (const std::string& e)
{
// If the expression failed because it didn't look like an expression,
// simply store it as-is.
if (e == STRING_EVAL_NOT_EXPRESSION)
{
task.set (_name, value);
context.debug (label + _name + " <-- '" + value + "'");
}
else
throw;
}
} }
else else
{ {

View file

@ -681,6 +681,7 @@
#define STRING_EVAL_UNSUPPORTED "Nicht unterstützter Operator: '{1}'." #define STRING_EVAL_UNSUPPORTED "Nicht unterstützter Operator: '{1}'."
#define STRING_EVAL_OP_EXPECTED "Operator erwartet." #define STRING_EVAL_OP_EXPECTED "Operator erwartet."
#define STRING_EVAL_NO_EVAL "Der Ausdruck konnte nicht ausgewertet werden." #define STRING_EVAL_NO_EVAL "Der Ausdruck konnte nicht ausgewertet werden."
#define STRING_EVAL_NOT_EXPRESSION "The value is not an expression."
#define STRING_PAREN_MISMATCH "Ungültige Klammerung in Ausdruck." #define STRING_PAREN_MISMATCH "Ungültige Klammerung in Ausdruck."
// edit // edit

View file

@ -679,6 +679,7 @@
#define STRING_EVAL_UNSUPPORTED "Unsupported operator '{1}'." #define STRING_EVAL_UNSUPPORTED "Unsupported operator '{1}'."
#define STRING_EVAL_OP_EXPECTED "Operator expected." #define STRING_EVAL_OP_EXPECTED "Operator expected."
#define STRING_EVAL_NO_EVAL "The expression could not be evaluated." #define STRING_EVAL_NO_EVAL "The expression could not be evaluated."
#define STRING_EVAL_NOT_EXPRESSION "The value is not an expression."
#define STRING_PAREN_MISMATCH "Mismatched parentheses in expression" #define STRING_PAREN_MISMATCH "Mismatched parentheses in expression"
// edit // edit

View file

@ -681,6 +681,7 @@
#define STRING_EVAL_UNSUPPORTED "Ne subtenas infikson '{1}'." #define STRING_EVAL_UNSUPPORTED "Ne subtenas infikson '{1}'."
#define STRING_EVAL_OP_EXPECTED "Anticipis infikson." #define STRING_EVAL_OP_EXPECTED "Anticipis infikson."
#define STRING_EVAL_NO_EVAL "Ne povis kalkuli la esprimon." #define STRING_EVAL_NO_EVAL "Ne povis kalkuli la esprimon."
#define STRING_EVAL_NOT_EXPRESSION "The value is not an expression."
#define STRING_PAREN_MISMATCH "Malbalancataj parentezoj en esprimo" #define STRING_PAREN_MISMATCH "Malbalancataj parentezoj en esprimo"
// edit // edit

View file

@ -690,6 +690,7 @@
#define STRING_EVAL_UNSUPPORTED "Operador no soportado '{1}'." #define STRING_EVAL_UNSUPPORTED "Operador no soportado '{1}'."
#define STRING_EVAL_OP_EXPECTED "Se esperaba operador." #define STRING_EVAL_OP_EXPECTED "Se esperaba operador."
#define STRING_EVAL_NO_EVAL "La expresión podría no ser evaluada." #define STRING_EVAL_NO_EVAL "La expresión podría no ser evaluada."
#define STRING_EVAL_NOT_EXPRESSION "The value is not an expression."
#define STRING_PAREN_MISMATCH "Paréntesis desemparejados en expresión" #define STRING_PAREN_MISMATCH "Paréntesis desemparejados en expresión"
// edit // edit

View file

@ -681,6 +681,7 @@
#define STRING_EVAL_UNSUPPORTED "Unsupported operator '{1}'." #define STRING_EVAL_UNSUPPORTED "Unsupported operator '{1}'."
#define STRING_EVAL_OP_EXPECTED "Operator expected." #define STRING_EVAL_OP_EXPECTED "Operator expected."
#define STRING_EVAL_NO_EVAL "The expression could not be evaluated." #define STRING_EVAL_NO_EVAL "The expression could not be evaluated."
#define STRING_EVAL_NOT_EXPRESSION "The value is not an expression."
#define STRING_PAREN_MISMATCH "Mismatched parentheses in expression" #define STRING_PAREN_MISMATCH "Mismatched parentheses in expression"
// edit // edit

View file

@ -680,6 +680,7 @@
#define STRING_EVAL_UNSUPPORTED "Operatore non supportato '{1}'." #define STRING_EVAL_UNSUPPORTED "Operatore non supportato '{1}'."
#define STRING_EVAL_OP_EXPECTED "Operator expected." #define STRING_EVAL_OP_EXPECTED "Operator expected."
#define STRING_EVAL_NO_EVAL "The expression could not be evaluated." #define STRING_EVAL_NO_EVAL "The expression could not be evaluated."
#define STRING_EVAL_NOT_EXPRESSION "The value is not an expression."
#define STRING_PAREN_MISMATCH "Mismatched parentheses in expression" #define STRING_PAREN_MISMATCH "Mismatched parentheses in expression"
// edit // edit

View file

@ -681,6 +681,7 @@
#define STRING_EVAL_UNSUPPORTED "Unsupported operator '{1}'." #define STRING_EVAL_UNSUPPORTED "Unsupported operator '{1}'."
#define STRING_EVAL_OP_EXPECTED "Operator expected." #define STRING_EVAL_OP_EXPECTED "Operator expected."
#define STRING_EVAL_NO_EVAL "式を評価出来ません。" #define STRING_EVAL_NO_EVAL "式を評価出来ません。"
#define STRING_EVAL_NOT_EXPRESSION "The value is not an expression."
#define STRING_PAREN_MISMATCH "Mismatched parentheses in expression" #define STRING_PAREN_MISMATCH "Mismatched parentheses in expression"
// edit // edit

View file

@ -681,6 +681,7 @@
#define STRING_EVAL_UNSUPPORTED "Niewspierany operator '{1}'." #define STRING_EVAL_UNSUPPORTED "Niewspierany operator '{1}'."
#define STRING_EVAL_OP_EXPECTED "Oczekiwany operator." #define STRING_EVAL_OP_EXPECTED "Oczekiwany operator."
#define STRING_EVAL_NO_EVAL "Wyrażenie nie może być przetworzone." #define STRING_EVAL_NO_EVAL "Wyrażenie nie może być przetworzone."
#define STRING_EVAL_NOT_EXPRESSION "The value is not an expression."
#define STRING_PAREN_MISMATCH "Niedopasowane nawiasy w wyrażeniu" #define STRING_PAREN_MISMATCH "Niedopasowane nawiasy w wyrażeniu"
// edit // edit

View file

@ -681,6 +681,7 @@
#define STRING_EVAL_UNSUPPORTED "Operador não suportado '{1}'." #define STRING_EVAL_UNSUPPORTED "Operador não suportado '{1}'."
#define STRING_EVAL_OP_EXPECTED "Operador em falta." #define STRING_EVAL_OP_EXPECTED "Operador em falta."
#define STRING_EVAL_NO_EVAL "Não foi possível calcular a expressão." #define STRING_EVAL_NO_EVAL "Não foi possível calcular a expressão."
#define STRING_EVAL_NOT_EXPRESSION "The value is not an expression."
#define STRING_PAREN_MISMATCH "Parentesis incompatíveis na expressão." #define STRING_PAREN_MISMATCH "Parentesis incompatíveis na expressão."
// edit // edit