- Updated ideas with recurrence design

This commit is contained in:
Paul Beckingham 2008-06-22 01:33:17 -04:00
parent cc9235033f
commit 3f21a0fe4d
2 changed files with 67 additions and 3 deletions

View file

@ -1,6 +1,9 @@
Real Parsing
define grammar for command line
implement flex/bison parser
new grammar includes:
- task delete <ID> [<ID> ...]
- task done <ID> [<ID> ...]
User-Defined Reports
report.xxx=id,project(2+),priority(1-),description
@ -14,4 +17,51 @@ Test Suite
debug=on to cause all cout to be csv
regression tests for every bug, command, feature
Recurrence
- new T::status recurring (stored as R)
- new user-specifiable attributes - recur:<duration> [until:<date>]
- duration:
daily, day, 1d
Nd
weekly, 1w
Nw
biweekly
monthly, 1m
bimonthly
Nm
quarterly, 1q
Nq
biannual, biyearly
annual, yearly, 1y
Na, Ny
- recur: without due: => Error
- until: without recur: => Error
- New file format (version 3): supports status R, recur:, until:, base:, range:
- on TDB.gc, adjust base: and compress range: for T::status == recurring
- all recurring tasks are removed from lists by T::*pendingT, and a synthetic
addendum is generated
- when a recurring task is completed, range: is updated, and a synthetic
task is added to completed.data that retains the attributes of the root
- Scenario:
# Today = 6/22/2008
% task add Friday due:6/15/2008 recur:weekly until 8/1/2008
# task must generate a base and range
# base:6/15/2008
# range:-------
# ^6/15
# ^6/22
# ^6/29
# ^7/6
# ^7/13
# ^7/20
# ^7/27
% task ls
1 Friday 6/15/2008 .lte. today (overdue)
2 Friday 6/22/2008 .lte. today (due)
3 Friday 6/29/2008 one recurrence
4 Friday 7/6/2008 (not shown)
5 Friday 7/13/2008 (not shown)
6 Friday 7/20/2008 (not shown)
7 Friday 7/27/2008 (not shown)

View file

@ -107,6 +107,10 @@ static const char* attributes[] =
"entry",
"start",
"end",
"recur",
"until",
"base",
"range",
"",
};
@ -201,7 +205,7 @@ bool validDate (std::string& date, Config& conf)
}
////////////////////////////////////////////////////////////////////////////////
static bool validPriority (std::string& input)
static bool validPriority (const std::string& input)
{
if (input != "H" &&
input != "M" &&
@ -215,7 +219,10 @@ static bool validPriority (std::string& input)
}
////////////////////////////////////////////////////////////////////////////////
static bool validAttribute (std::string& name, std::string& value, Config& conf)
static bool validAttribute (
std::string& name,
std::string& value,
Config& conf)
{
guess ("attribute", attributes, name);
@ -254,7 +261,7 @@ static bool validId (const std::string& input)
}
////////////////////////////////////////////////////////////////////////////////
static bool validTag (std::string& input)
static bool validTag (const std::string& input)
{
if ((input[0] == '-' || input[0] == '+') &&
input.length () > 1)
@ -310,6 +317,13 @@ static bool validSubstitution (
return false;
}
////////////////////////////////////////////////////////////////////////////////
bool validDuration (const std::string& input)
{
// TODO
return false;
}
////////////////////////////////////////////////////////////////////////////////
// Token Distinguishing characteristic
// ------- -----------------------------