Do not overwrite interval index when parsing DOM reference

- Closes #390

Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
This commit is contained in:
Thomas Lauf 2020-10-01 08:34:44 +02:00
parent d90eab17a0
commit 5b1deaab59
2 changed files with 6 additions and 4 deletions

View file

@ -196,18 +196,18 @@ bool domGet (
return true;
}
int n;
int m;
// dom.tracked.<N>.tag.<M>
if (pig.skipLiteral ("tag.") &&
pig.getDigits (n))
pig.getDigits (m))
{
std::vector <std::string> tags;
for (auto& tag : tracked[count - n].tags ())
tags.push_back (tag);
if (n <= static_cast <int> (tags.size ()))
if (m <= static_cast <int> (tags.size ()))
{
value = format ("{1}", tags[n - 1]);
value = format ("{1}", tags[m - 1]);
return true;
}
}