From 30b5c6c0483f67006ae14f253b318637f620394d Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 17 Jul 2011 12:45:59 -0400 Subject: [PATCH] Expression - Implemented automatic downgrade of arguments to 'word' in the context of modifications. --- src/Arguments.cpp | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/src/Arguments.cpp b/src/Arguments.cpp index d53225675..311add269 100644 --- a/src/Arguments.cpp +++ b/src/Arguments.cpp @@ -1595,21 +1595,17 @@ Arguments Arguments::extract_modifications () // Error. else { - if (arg->_third == "pattern") - throw std::string ("A pattern '") - + arg->_first - + "' is not allowed when modifiying a task."; - - else if (arg->_third == "attmod") - throw std::string ("An attribute modifier '") - + arg->_first - + "' is not allowed when modifiying a task."; - - else if (arg->_third == "id") - throw std::string ("A task id cannot be modified."); - - else if (arg->_third == "uuid") - throw std::string ("A task uuid cannot be modified."); + // Instead of errors, simply downgrade these to 'word'. + if (arg->_third == "pattern" || + arg->_third == "attmod" || + arg->_third == "id" || + arg->_third == "uuid") + { + arg->_third = "word"; + modifications.push_back (*arg); + } + else + throw std::string ("Error: unrecognized argument in modifications."); } } }