mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
CLI2: Added ::prepareFilter for the deferred parsing of filters
This commit is contained in:
parent
dc5f9e38a6
commit
6c0ba77204
3 changed files with 19 additions and 1 deletions
|
@ -668,11 +668,18 @@ const std::string CLI2::getFilter (bool applyContext)
|
|||
filter = "( " + filter + " )";
|
||||
}
|
||||
|
||||
context.debug("Derived filter: '" + filter + "'");
|
||||
context.debug("CLI2: Derived filter: '" + filter + "'");
|
||||
return filter;
|
||||
}
|
||||
*/
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Parset the commnad line, identifiying filter components, expanding syntactic
|
||||
// sugar as necessary.
|
||||
void CLI2::prepareFilter (bool applyContext)
|
||||
{
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Get the original command line arguments, in pristine condition, but skipping:
|
||||
// - BINARY
|
||||
|
|
|
@ -94,6 +94,7 @@ public:
|
|||
void applyOverrides ();
|
||||
const std::string getFilter (bool applyContext = true);
|
||||
*/
|
||||
void prepareFilter (bool applyContext = true);
|
||||
const std::vector <std::string> getWords (bool filtered = true);
|
||||
bool canonicalize (std::string&, const std::string&, const std::string&) const;
|
||||
std::string getBinary () const;
|
||||
|
|
|
@ -72,6 +72,11 @@ void Filter::subset (const std::vector <Task>& input, std::vector <Task>& output
|
|||
context.timer_filter.start ();
|
||||
_startCount = (int) input.size ();
|
||||
|
||||
context.cli2.prepareFilter (applyContext);
|
||||
// TODO Need to replace CLI2::getFilter with something that just walks the
|
||||
// the parse tree. No point in combining the parse tree into a string,
|
||||
// only to lex it back into tokens for Eval.
|
||||
|
||||
if (context.config.getInteger ("debug.parser") >= 1)
|
||||
context.debug (context.cli.dump ("Filter::subset"));
|
||||
|
||||
|
@ -114,6 +119,11 @@ void Filter::subset (std::vector <Task>& output, bool applyContext /* = true */)
|
|||
{
|
||||
context.timer_filter.start ();
|
||||
|
||||
context.cli2.prepareFilter (applyContext);
|
||||
// TODO Need to replace CLI2::getFilter with something that just walks the
|
||||
// the parse tree. No point in combining the parse tree into a string,
|
||||
// only to lex it back into tokens for Eval.
|
||||
|
||||
if (context.config.getInteger ("debug.parser") >= 1)
|
||||
context.debug (context.cli.dump ("Filter::subset"));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue