mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-29 07:57:20 +02:00
Parser
- Renamed A3t to Parser.
This commit is contained in:
parent
ecd64456ae
commit
79abddd03d
25 changed files with 240 additions and 241 deletions
|
@ -208,7 +208,7 @@ Chart::Chart (char type)
|
|||
// Set the title.
|
||||
_title = "(";
|
||||
std::vector <Tree*>::iterator i;
|
||||
for (i = context.a3t.tree ()->_branches.begin (); i != context.a3t.tree ()->_branches.end (); ++i)
|
||||
for (i = context.parser.tree ()->_branches.begin (); i != context.parser.tree ()->_branches.end (); ++i)
|
||||
{
|
||||
if (! (*i)->hasTag ("BINARY") &&
|
||||
! (*i)->hasTag ("RC") &&
|
||||
|
|
|
@ -75,7 +75,7 @@ int CmdCalc::execute (std::string& output)
|
|||
|
||||
// Compile all the args into one expression.
|
||||
std::string expression;
|
||||
std::vector <std::string> words = context.a3t.getWords ();
|
||||
std::vector <std::string> words = context.parser.getWords ();
|
||||
std::vector <std::string>::iterator word;
|
||||
for (word = words.begin (); word != words.end (); ++word)
|
||||
expression += *word + " ";
|
||||
|
|
|
@ -103,7 +103,7 @@ int CmdCalendar::execute (std::string& output)
|
|||
int argYear = 0;
|
||||
bool argWholeYear = false;
|
||||
|
||||
std::vector <std::string> words = context.a3t.getWords ();
|
||||
std::vector <std::string> words = context.parser.getWords ();
|
||||
|
||||
std::vector <std::string>::iterator arg;
|
||||
for (arg = words.begin (); arg != words.end (); ++arg)
|
||||
|
@ -338,9 +338,9 @@ int CmdCalendar::execute (std::string& output)
|
|||
|
||||
std::string report_filter = context.config.get ("report." + report + ".filter");
|
||||
|
||||
context.a3t.clear ();
|
||||
context.a3t.captureFirst ("task");
|
||||
context.a3t.parse ();
|
||||
context.parser.clear ();
|
||||
context.parser.captureFirst ("task");
|
||||
context.parser.parse ();
|
||||
|
||||
report_filter += " due.after:" + after + " due.before:" + before + " -nocal";
|
||||
context.config.set ("report." + report + ".filter", report_filter);
|
||||
|
|
|
@ -54,7 +54,7 @@ int CmdColor::execute (std::string& output)
|
|||
#ifdef FEATURE_COLOR
|
||||
// Get the non-attribute, non-fancy command line arguments.
|
||||
bool legend = false;
|
||||
std::vector <std::string> words = context.a3t.getWords ();
|
||||
std::vector <std::string> words = context.parser.getWords ();
|
||||
std::vector <std::string>::iterator word;
|
||||
for (word = words.begin (); word != words.end (); ++word)
|
||||
if (closeEnough ("legend", *word))
|
||||
|
|
|
@ -51,7 +51,7 @@ int CmdColumns::execute (std::string& output)
|
|||
{
|
||||
// Obtain the arguments from the description. That way, things like '--'
|
||||
// have already been handled.
|
||||
std::vector <std::string> words = context.a3t.getWords ();
|
||||
std::vector <std::string> words = context.parser.getWords ();
|
||||
if (words.size () > 1)
|
||||
throw std::string (STRING_CMD_COLUMNS_ARGS);
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ int CmdConfig::execute (std::string& output)
|
|||
std::stringstream out;
|
||||
|
||||
// Get the non-attribute, non-fancy command line arguments.
|
||||
std::vector <std::string> words = context.a3t.getWords ();
|
||||
std::vector <std::string> words = context.parser.getWords ();
|
||||
|
||||
// Support:
|
||||
// task config name value # set name to value
|
||||
|
|
|
@ -92,13 +92,13 @@ int CmdCustom::execute (std::string& output)
|
|||
// TODO Obsolete, but for now prevents 'operator mismatch' errors.
|
||||
context.a3.capture_first (*arg);
|
||||
|
||||
Tree* t = context.a3t.captureFirst (*arg);
|
||||
Tree* t = context.parser.captureFirst (*arg);
|
||||
t->tag ("CUSTOM");
|
||||
t->tag ("FILTER");
|
||||
}
|
||||
|
||||
// TODO Obsolete, but for now prevents 'operator mismatch' errors..
|
||||
context.a3t.parse ();
|
||||
context.parser.parse ();
|
||||
context.a3.categorize ();
|
||||
|
||||
// Apply filter.
|
||||
|
@ -239,7 +239,7 @@ void CmdCustom::getLimits (const std::string& report, int& rows, int& lines)
|
|||
|
||||
// If the custom report has a defined limit, then allow a numeric override.
|
||||
// This is an integer specified as a filter (limit:10).
|
||||
std::string limit = context.a3t.getLimit ();
|
||||
std::string limit = context.parser.getLimit ();
|
||||
if (limit != "")
|
||||
{
|
||||
if (limit == "page")
|
||||
|
|
|
@ -48,7 +48,7 @@ CmdExec::CmdExec ()
|
|||
int CmdExec::execute (std::string& output)
|
||||
{
|
||||
std::string command_line;
|
||||
join (command_line, " ", context.a3t.getWords ());
|
||||
join (command_line, " ", context.parser.getWords ());
|
||||
return system (command_line.c_str ());
|
||||
}
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ int CmdGet::execute (std::string& output)
|
|||
{
|
||||
// Obtain the arguments from the description. That way, things like '--'
|
||||
// have already been handled.
|
||||
std::vector <std::string> words = context.a3t.getWords ();
|
||||
std::vector <std::string> words = context.parser.getWords ();
|
||||
if (words.size () == 0)
|
||||
throw std::string (STRING_CMD_GET_NO_DOM);
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ int CmdImport::execute (std::string& output)
|
|||
int count = 0;
|
||||
|
||||
// Use the description as a file name.
|
||||
std::vector <std::string> words = context.a3t.getWords ();
|
||||
std::vector <std::string> words = context.parser.getWords ();
|
||||
if (! words.size ())
|
||||
throw std::string (STRING_CMD_IMPORT_NOFILE);
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ int CmdShow::execute (std::string& output)
|
|||
|
||||
// Obtain the arguments from the description. That way, things like '--'
|
||||
// have already been handled.
|
||||
std::vector <std::string> words = context.a3t.getWords ();
|
||||
std::vector <std::string> words = context.parser.getWords ();
|
||||
if (words.size () > 1)
|
||||
throw std::string (STRING_CMD_SHOW_ARGS);
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ int CmdSync::execute (std::string& output)
|
|||
|
||||
// Loog for the 'init' keyword to indicate one-time pending.data upload.
|
||||
bool first_time_init = false;
|
||||
std::vector <std::string> words = context.a3t.getWords ();
|
||||
std::vector <std::string> words = context.parser.getWords ();
|
||||
std::vector <std::string>::iterator word;
|
||||
for (word = words.begin (); word != words.end (); ++word)
|
||||
{
|
||||
|
|
|
@ -73,7 +73,7 @@ int CmdTimesheet::execute (std::string& output)
|
|||
|
||||
// Determine how many reports to run.
|
||||
int quantity = 1;
|
||||
std::vector <std::string> words = context.a3t.getWords ();
|
||||
std::vector <std::string> words = context.parser.getWords ();
|
||||
if (words.size () == 1)
|
||||
quantity = strtol (words[0].c_str (), NULL, 10);;
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ int CmdUndo::execute (std::string& output)
|
|||
{
|
||||
// Detect attempts to modify the task.
|
||||
std::vector <Tree*>::iterator i;
|
||||
for (i = context.a3t.tree ()->_branches.begin (); i != context.a3t.tree ()->_branches.end (); ++i)
|
||||
for (i = context.parser.tree ()->_branches.begin (); i != context.parser.tree ()->_branches.end (); ++i)
|
||||
if ((*i)->hasTag ("MODIFICATION"))
|
||||
throw std::string (STRING_CMD_UNDO_MODS);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue