Parsing
- Tags may no longer begin with a digit.
This commit is contained in:
20
src/A3.cpp
20
src/A3.cpp
@@ -1500,7 +1500,7 @@ bool A3::is_duration (Nibbler& n, std::string& result)
|
|||||||
std::string unit;
|
std::string unit;
|
||||||
std::vector <std::string> units = Duration::get_units ();
|
std::vector <std::string> units = Duration::get_units ();
|
||||||
|
|
||||||
if (n.getNumber (d) &&
|
if (n.getUnsignedNumber (d) &&
|
||||||
n.getOneOf (units, unit))
|
n.getOneOf (units, unit))
|
||||||
{
|
{
|
||||||
char next = n.next ();
|
char next = n.next ();
|
||||||
@@ -1657,19 +1657,21 @@ bool A3::is_uuid (Nibbler& n, std::string& result)
|
|||||||
bool A3::is_tag (Nibbler& n, std::string& result)
|
bool A3::is_tag (Nibbler& n, std::string& result)
|
||||||
{
|
{
|
||||||
n.save ();
|
n.save ();
|
||||||
|
|
||||||
std::string::size_type start = n.cursor ();
|
std::string::size_type start = n.cursor ();
|
||||||
|
|
||||||
if (n.skipAllOneOf ("+-"))
|
if (n.skipAllOneOf ("+-"))
|
||||||
{
|
{
|
||||||
std::string name;
|
if (!isdigit (n.next ()))
|
||||||
if (n.getUntilOneOf (" \t()+-*/", name) &&
|
|
||||||
name.length ())
|
|
||||||
{
|
{
|
||||||
std::string::size_type end = n.cursor ();
|
std::string name;
|
||||||
n.restore ();
|
if (n.getUntilOneOf (" \t()+-*/", name) &&
|
||||||
if (n.getN (end - start, result))
|
name.length ())
|
||||||
return true;
|
{
|
||||||
|
std::string::size_type end = n.cursor ();
|
||||||
|
n.restore ();
|
||||||
|
if (n.getN (end - start, result))
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user