Bug - A3::extract_modifications

- Broadened the list of argument categories that are downgraded to
  'word' for the purpose of task modification.
This commit is contained in:
Paul Beckingham 2011-08-13 16:24:07 -04:00
parent 7ba5e67050
commit 30034f057b
3 changed files with 64 additions and 47 deletions

View file

@ -418,8 +418,8 @@ void Command::modify_task (
std::string result = e.evalExpression (task);
context.debug (std::string ("Eval '") + value + "' --> '" + result + "'");
fragment.dump ("pre modify_task attr");
std::cout << "# modify_task result='" << result << "'\n";
//fragment.dump ("pre modify_task attr");
//std::cout << "# modify_task result='" << result << "'\n";
// Dependencies must be resolved to UUIDs.
if (name == "depends")
@ -463,6 +463,7 @@ std::cout << "# modify_task result='" << result << "'\n";
task.removeTag (value);
}
/*
// Words and operators are aggregated into a description.
else if (arg->_category == "word" ||
arg->_category == "op")
@ -472,6 +473,7 @@ std::cout << "# modify_task result='" << result << "'\n";
description += arg->_raw;
}
*/
// Substitutions.
else if (arg->_category == "subst")
@ -483,10 +485,22 @@ std::cout << "# modify_task result='" << result << "'\n";
task.substitute (from, to, global);
}
/*
// Any additional argument types are indicative of a failure in
// A3::extract_modifications.
else
throw format (STRING_CMD_MOD_UNEXPECTED, arg->_raw);
*/
// Anything else is essentially downgraded to 'word' and considered part of
// the description.
else
{
if (description.length ())
description += " ";
description += arg->_raw;
}
}
}