TW-1608: The recur/recurring report shows tasks without a recur interval

- Lexer needed additional lookbehind criteria for ::isTag (thanks to Brad
  Collette).
This commit is contained in:
Paul Beckingham 2015-05-09 21:27:48 -04:00
parent f30f4d45c6
commit 7293de75b0
3 changed files with 13 additions and 5 deletions

View file

@ -11,6 +11,8 @@
again (thanks to Jens Erat). again (thanks to Jens Erat).
- TW-1605 Japanese translation for Taskwarrior (thanks to Oota Toshiya). - TW-1605 Japanese translation for Taskwarrior (thanks to Oota Toshiya).
- TW-1606 scheduled.any filter (thanks to Peter Rochen). - TW-1606 scheduled.any filter (thanks to Peter Rochen).
- TW-1608 The recur/recurring report shows tasks without a recur interval
(thanks to Brad Collette).
- TW-1610 Disabling GC can lead to editing the wrong task (thanks to Scott M). - TW-1610 Disabling GC can lead to editing the wrong task (thanks to Scott M).
- The 'obfuscate' setting, if set to '1' will replace all text with 'xxx'. - The 'obfuscate' setting, if set to '1' will replace all text with 'xxx'.
- POSIX file locking mechanism, eliminating platform-specific code. - POSIX file locking mechanism, eliminating platform-specific code.

View file

@ -778,14 +778,17 @@ bool Lexer::isPair (std::string& token, Lexer::Type& type)
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// Lexer::Type::tag // Lexer::Type::tag
// ^ | <isWhiteSpace> [ +|- ] <isIdentifierStart> [ <isIdentifierNext> ]* // ^ | '(' | ')' | <isWhiteSpace>
// [ +|- ] <isIdentifierStart> [ <isIdentifierNext> ]*
bool Lexer::isTag (std::string& token, Lexer::Type& type) bool Lexer::isTag (std::string& token, Lexer::Type& type)
{ {
std::size_t marker = _cursor; std::size_t marker = _cursor;
// Lookbehind: ^ | <isWhiteSpace> // Lookbehind: ^ | '(' | ')' | <isWhiteSpace>
if (marker > 0 && if (marker > 0 &&
! isWhitespace (_text[marker - 1])) ! isWhitespace (_text[marker - 1]) &&
_text[marker - 1] != '(' &&
_text[marker - 1] != ')')
return false; return false;
if (_text[marker] == '+' || if (_text[marker] == '+' ||

View file

@ -36,7 +36,7 @@ Context context;
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
int main (int argc, char** argv) int main (int argc, char** argv)
{ {
UnitTest t (771); UnitTest t (789);
std::vector <std::pair <std::string, Lexer::Type>> tokens; std::vector <std::pair <std::string, Lexer::Type>> tokens;
std::string token; std::string token;
@ -374,6 +374,9 @@ int main (int argc, char** argv)
{ "desc~pattern", { { "desc", Lexer::Type::dom }, { "desc~pattern", { { "desc", Lexer::Type::dom },
{ "~", Lexer::Type::op }, { "~", Lexer::Type::op },
{ "pattern", Lexer::Type::dom }, NO, NO }, }, { "pattern", Lexer::Type::dom }, NO, NO }, },
{ "(+tag)", { { "(", Lexer::Type::op },
{ "+tag", Lexer::Type::tag },
{ ")", Lexer::Type::op }, NO, NO }, },
}; };
#define NUM_TESTS (sizeof (lexerTests) / sizeof (lexerTests[0])) #define NUM_TESTS (sizeof (lexerTests) / sizeof (lexerTests[0]))