mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
A3 - attribute modifier syntax
- Restored the <name>.<modifier>[:=]<value> syntax that was reduced to just <name>.<modifier>:<value> to make parsing easier. Now that A3 is more sophisticated, we can have our sugar back.
This commit is contained in:
parent
d59cddcc6c
commit
b0c8cff6a2
1 changed files with 6 additions and 4 deletions
10
src/A3.cpp
10
src/A3.cpp
|
@ -1280,7 +1280,7 @@ bool A3::is_attr (Nibbler& n, std::string& result)
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// <name>.<mod>:['"]<value>['"]
|
||||
// <name>.<mod>[:=]['"]<value>['"]
|
||||
bool A3::is_attmod (Nibbler& n, std::string& result)
|
||||
{
|
||||
n.save ();
|
||||
|
@ -1304,7 +1304,8 @@ bool A3::is_attmod (Nibbler& n, std::string& result)
|
|||
modifier.length () &&
|
||||
is_modifier (modifier, modifier))
|
||||
{
|
||||
if (n.skip (':'))
|
||||
if (n.skip (':') ||
|
||||
n.skip ('='))
|
||||
{
|
||||
// Both quoted and unquoted Att's are accepted.
|
||||
// Consider removing this for a stricter parse.
|
||||
|
@ -1761,7 +1762,7 @@ bool A3::extract_attr (
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// <name>.<mod>:['"]<value>['"]
|
||||
// <name>.<mod>[:=]['"]<value>['"]
|
||||
bool A3::extract_attmod (
|
||||
const std::string& input,
|
||||
std::string& name,
|
||||
|
@ -1787,7 +1788,8 @@ bool A3::extract_attmod (
|
|||
n.getUntil (':', modifier);
|
||||
}
|
||||
|
||||
if (n.skip (':'))
|
||||
if (n.skip (':') ||
|
||||
n.skip ('='))
|
||||
{
|
||||
// Both quoted and unquoted Att's are accepted.
|
||||
// Consider removing this for a stricter parse.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue