- Attempts named source resolution as part of primitive parsing.
This commit is contained in:
Paul Beckingham 2014-05-19 22:06:58 -04:00
parent 52edc9b7cf
commit d9e1607f05

View file

@ -693,7 +693,7 @@ bool Eval::parsePrimitive (
int &i) const int &i) const
{ {
if (_debug) if (_debug)
std::cout << "# parseVariant\n"; std::cout << "# parsePrimitive\n";
if (i < infix.size ()) if (i < infix.size ())
{ {
@ -718,7 +718,26 @@ bool Eval::parsePrimitive (
} }
else else
{ {
if (infix[i].second != Lexer::typeOperator) bool found = false;
std::vector <bool (*)(const std::string&, Variant&)>::const_iterator source;
for (source = _sources.begin (); source != _sources.end (); ++source)
{
Variant v;
if ((*source) (infix[i].first, v))
{
if (_debug)
std::cout << "# " << infix[i].first << "' --> '" << (std::string) v << "'\n";
found = true;
break;
}
}
if (found)
{
++i;
return true;
}
else if (infix[i].second != Lexer::typeOperator)
{ {
if (_debug) if (_debug)
std::cout << "# " << infix[i].first << "\n"; std::cout << "# " << infix[i].first << "\n";