TW-1606: scheduled.any filter

- The Lexer::dom type worked embedded, but not isolated (thanks to Peter Rochen).
This commit is contained in:
Paul Beckingham 2015-04-29 18:53:13 -04:00
parent 71753ef666
commit 36e31811b0
3 changed files with 7 additions and 3 deletions

View file

@ -5,6 +5,7 @@
- TW-1603 Priority color precedence changed since it is a UDA, should be lowered
again (thanks to Jens Erat).
- TW-1605 Japanese translation for Taskwarrior (thanks to Oota Toshiya).
- TW-1606 scheduled.any filter (thanks to Peter Rochen).
- The 'obfuscate' setting, if set to '1' will replace all text with 'xxx'.
------ current release ---------------------------

View file

@ -754,14 +754,16 @@ bool Lexer::isPair (std::string& token, Lexer::Type& type)
}
}
if (_eos - _cursor > 1 &&
if (_eos - _cursor >= 1 &&
_text[_cursor] == ':')
{
_cursor++;
if (isString (ignoredToken, ignoredType, '\'') ||
isString (ignoredToken, ignoredType, '"') ||
isWord (ignoredToken, ignoredType))
isWord (ignoredToken, ignoredType) ||
_eos == _cursor ||
_text[_cursor] == ' ')
{
token = _text.substr (marker, _cursor - marker);
type = Lexer::Type::pair;

View file

@ -36,7 +36,7 @@ Context context;
////////////////////////////////////////////////////////////////////////////////
int main (int argc, char** argv)
{
UnitTest t (765);
UnitTest t (771);
std::vector <std::pair <std::string, Lexer::Type>> tokens;
std::string token;
@ -278,6 +278,7 @@ int main (int argc, char** argv)
// Pair
{ "name:value", { { "name:value", Lexer::Type::pair }, NO, NO, NO, NO }, },
{ "desc.cont:pattern", { { "desc.cont:pattern", Lexer::Type::pair }, NO, NO, NO, NO }, },
{ "desc.any:", { { "desc.any:", Lexer::Type::pair }, NO, NO, NO, NO }, },
{ "pro:'P 1'", { { "pro:'P 1'", Lexer::Type::pair }, NO, NO, NO, NO }, },
{ "pro:PROJECT", { { "pro:PROJECT", Lexer::Type::pair }, NO, NO, NO, NO }, },
{ "due:'eow - 2d'", { { "due:'eow - 2d'", Lexer::Type::pair }, NO, NO, NO, NO }, },