mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Duration Bug
- Removed the unnecessary ::getInt parse before ::getNumber, which was causing "-1.2d" to not parse. - Removed verbose debug statement.
This commit is contained in:
parent
6ed2bcd605
commit
589627852f
2 changed files with 3 additions and 4 deletions
|
@ -718,6 +718,7 @@ const A3 A3::tokenize (const A3& input) const
|
||||||
|
|
||||||
// Must be higher than number.
|
// Must be higher than number.
|
||||||
// Must be higher than operator.
|
// Must be higher than operator.
|
||||||
|
// Note that Nibbler::getDate does not read durations.
|
||||||
else if (n.getDate (date_format, t))
|
else if (n.getDate (date_format, t))
|
||||||
{
|
{
|
||||||
output.push_back (Arg (Date (t).toString (date_format), Arg::type_date, Arg::cat_literal));
|
output.push_back (Arg (Date (t).toString (date_format), Arg::type_date, Arg::cat_literal));
|
||||||
|
@ -1500,13 +1501,11 @@ bool A3::is_duration (Nibbler& n, std::string& result)
|
||||||
{
|
{
|
||||||
std::string::size_type start = n.save ();
|
std::string::size_type start = n.save ();
|
||||||
|
|
||||||
int i;
|
|
||||||
double d;
|
double d;
|
||||||
std::string unit;
|
std::string unit;
|
||||||
std::vector <std::string> units = Duration::get_units ();
|
std::vector <std::string> units = Duration::get_units ();
|
||||||
|
|
||||||
if ((n.getInt (i) ||
|
if (n.getNumber (d) &&
|
||||||
n.getNumber (d)) &&
|
|
||||||
n.getOneOf (units, unit))
|
n.getOneOf (units, unit))
|
||||||
{
|
{
|
||||||
char next = n.next ();
|
char next = n.next ();
|
||||||
|
|
|
@ -418,7 +418,7 @@ void Command::modify_task (
|
||||||
A3::extract_attr (arg->_raw, name, value);
|
A3::extract_attr (arg->_raw, name, value);
|
||||||
if (A3::is_attribute (name, name)) // Canonicalize
|
if (A3::is_attribute (name, name)) // Canonicalize
|
||||||
{
|
{
|
||||||
std::cout << "# Command::modify_task name='" << name << "' value='" << value << "'\n";
|
// std::cout << "# Command::modify_task name='" << name << "' value='" << value << "'\n";
|
||||||
|
|
||||||
// Get the column info.
|
// Get the column info.
|
||||||
Column* column = context.columns[name];
|
Column* column = context.columns[name];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue