From 82c5d019a3d8398d6493cba29b114c7791c8f4d2 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Mon, 22 Jun 2015 10:30:29 -0400 Subject: [PATCH] CLI2: Added ::addFilter method --- src/CLI2.cpp | 12 +++++++++--- src/CLI2.h | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/CLI2.cpp b/src/CLI2.cpp index 646b1a73d..572177801 100644 --- a/src/CLI2.cpp +++ b/src/CLI2.cpp @@ -455,11 +455,15 @@ void CLI2::addContextFilter () context.footnote (format ("Context '{1}' set. Use 'task context none' to remove.", contextName)); } } +*/ //////////////////////////////////////////////////////////////////////////////// -// Process raw string into parsed filter. -void CLI2::addRawFilter (const std::string& arg) +// Process raw string. +void CLI2::addFilter (const std::string& arg) { + if (arg.length ()) + add ("("); + std::string lexeme; Lexer::Type type; Lexer lex (arg); @@ -467,8 +471,10 @@ void CLI2::addRawFilter (const std::string& arg) while (lex.token (lexeme, type)) add (lexeme); + + if (arg.length ()) + add (")"); } -*/ //////////////////////////////////////////////////////////////////////////////// // Parset the commnad line, identifiying filter components, expanding syntactic diff --git a/src/CLI2.h b/src/CLI2.h index 901ae0cd0..3948ec5ea 100644 --- a/src/CLI2.h +++ b/src/CLI2.h @@ -75,8 +75,8 @@ public: void analyze (); /* void addContextFilter (); - void addRawFilter (const std::string& arg); */ + void addFilter (const std::string& arg); void prepareFilter (bool applyContext = true); const std::vector getWords (bool filtered = true); bool canonicalize (std::string&, const std::string&, const std::string&) const;