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:
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)
|
bool A3::is_attmod (Nibbler& n, std::string& result)
|
||||||
{
|
{
|
||||||
n.save ();
|
n.save ();
|
||||||
@@ -1304,7 +1304,8 @@ bool A3::is_attmod (Nibbler& n, std::string& result)
|
|||||||
modifier.length () &&
|
modifier.length () &&
|
||||||
is_modifier (modifier, modifier))
|
is_modifier (modifier, modifier))
|
||||||
{
|
{
|
||||||
if (n.skip (':'))
|
if (n.skip (':') ||
|
||||||
|
n.skip ('='))
|
||||||
{
|
{
|
||||||
// Both quoted and unquoted Att's are accepted.
|
// Both quoted and unquoted Att's are accepted.
|
||||||
// Consider removing this for a stricter parse.
|
// 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 (
|
bool A3::extract_attmod (
|
||||||
const std::string& input,
|
const std::string& input,
|
||||||
std::string& name,
|
std::string& name,
|
||||||
@@ -1787,7 +1788,8 @@ bool A3::extract_attmod (
|
|||||||
n.getUntil (':', modifier);
|
n.getUntil (':', modifier);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (n.skip (':'))
|
if (n.skip (':') ||
|
||||||
|
n.skip ('='))
|
||||||
{
|
{
|
||||||
// Both quoted and unquoted Att's are accepted.
|
// Both quoted and unquoted Att's are accepted.
|
||||||
// Consider removing this for a stricter parse.
|
// Consider removing this for a stricter parse.
|
||||||
|
|||||||
Reference in New Issue
Block a user