Example #1
0
void
Symbol::findSymbols(QualifiedName name, SymbolVector& symbols)
{
    NameVector names;
    context()->separateName(name, names);

    //
    //  NOTE: this is all very fishy. If a tuple symbol is used here
    //  that looks like this: (int,foo.bar), it will separate into:
    //  "(int,foo" and "bar)" which is clearly wrong. The parens
    //  should prevent the dot separation. Similarly, these names will
    //  separate incorrectly:
    //
    //      int[foo.bar]
    //      [foo.bar]
    //      vector foo.bar[3]
    //
    //  This function assumes that these symbols will live in the
    //  global namespace and therefore will be found if no tokenizing
    //  of the name occurs.
    //
    
    qualifiedNameLookup(names, this, symbols);

    if (symbols.empty())
    {
        names.clear();
        names.push_back(name);
        qualifiedNameLookup(names, this, symbols);
    }
}
Example #2
0
void
Symbol::findSymbols(QualifiedName name, ConstSymbolVector& symbols) const
{
    NameVector names;
    context()->separateName(name, names);
    qualifiedNameLookup(names, this, symbols);

    //
    //  See comments in above function
    //

    if (symbols.empty())
    {
        names.clear();
        names.push_back(name);
        qualifiedNameLookup(names, this, symbols);
    }
}