mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-09-07 21:07:20 +02:00
Expressions - Refactor
- The A3::Arg object is very similar to the E9::Term object, so the two are being merged. First step is to separate A3::Arg into it's own space, then add a _type member. - Added more valid stop characters as terminators for various arg types. - Removed redundant E9 special handling for dates, which is already built in to the Date object.
This commit is contained in:
parent
7dd3e081c7
commit
816b07e868
6 changed files with 190 additions and 112 deletions
46
src/A3.h
46
src/A3.h
|
@ -30,56 +30,12 @@
|
|||
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <Arg.h>
|
||||
#include <Nibbler.h>
|
||||
#include <File.h>
|
||||
|
||||
#define ARGUMENTS_SEQUENCE_MAX_RANGE 1000
|
||||
|
||||
class Arg
|
||||
{
|
||||
public:
|
||||
Arg ()
|
||||
: _raw ("")
|
||||
, _category ("")
|
||||
{
|
||||
}
|
||||
|
||||
Arg (
|
||||
const std::string& raw,
|
||||
const std::string& category)
|
||||
: _raw (raw)
|
||||
, _category (category)
|
||||
{
|
||||
}
|
||||
|
||||
Arg (const Arg& other)
|
||||
{
|
||||
_raw = other._raw;
|
||||
_category = other._category;
|
||||
}
|
||||
|
||||
Arg& operator= (const Arg& other)
|
||||
{
|
||||
if (this != &other)
|
||||
{
|
||||
_raw = other._raw;
|
||||
_category = other._category;
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool operator== (const Arg& other) const
|
||||
{
|
||||
return _raw == other._raw &&
|
||||
_category == other._category;
|
||||
}
|
||||
|
||||
public:
|
||||
std::string _raw; // Raw input token, never modified
|
||||
std::string _category; // Categorized argument
|
||||
};
|
||||
|
||||
class A3 : public std::vector <Arg>
|
||||
{
|
||||
public:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue