mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-21 16:53:08 +02:00
A3t
- Added ::getLimit to find the 'limit:n' pseudo attribute.
This commit is contained in:
parent
051a92bf91
commit
3799b5dc9c
2 changed files with 22 additions and 0 deletions
20
src/A3t.cpp
20
src/A3t.cpp
|
@ -588,6 +588,26 @@ const std::vector <std::string> A3t::getWords () const
|
|||
return words;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
std::string A3t::getLimit () const
|
||||
{
|
||||
std::vector <Tree*>::const_iterator i;
|
||||
for (i = _tree->_branches.begin (); i != _tree->_branches.end (); ++i)
|
||||
{
|
||||
// Parser override operator.
|
||||
if ((*i)->attribute ("raw") == "TERMINATED")
|
||||
break;
|
||||
|
||||
if ((*i)->hasTag ("PSEUDO") &&
|
||||
(*i)->attribute ("name") == "limit")
|
||||
{
|
||||
return (*i)->attribute ("raw");
|
||||
}
|
||||
}
|
||||
|
||||
return "0";
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// /pattern/ --> description ~ pattern
|
||||
void A3t::findPattern ()
|
||||
|
|
|
@ -61,6 +61,8 @@ public:
|
|||
const std::vector <std::string> getWords () const;
|
||||
// TODO Extract modifications
|
||||
|
||||
std::string getLimit () const;
|
||||
|
||||
private:
|
||||
void findTerminator ();
|
||||
void findPattern ();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue