Add direct operator lookup requests

Introduce DirectOperatorLookupRequest &
DirectPrecedenceGroupLookupRequest that lookup
operator and precedence groups within a given
file or module without looking through imports.

These will eventually be used as the basis for the
new operator lookup implementation, but for now
just use them when querying lookup results from
serialized module files.
This commit is contained in:
Hamish Knight
2020-03-22 14:20:57 -07:00
parent 9656a0491e
commit cc9c851856
7 changed files with 211 additions and 55 deletions

View File

@@ -328,12 +328,16 @@ public:
lookupNestedType(Identifier name,
const NominalTypeDecl *parent) const override;
virtual OperatorDecl *lookupOperator(Identifier name,
OperatorFixity fixity) const override;
protected:
virtual void
lookupOperatorDirect(Identifier name, OperatorFixity fixity,
TinyPtrVector<OperatorDecl *> &results) const override;
virtual PrecedenceGroupDecl *
lookupPrecedenceGroup(Identifier name) const override;
virtual void lookupPrecedenceGroupDirect(
Identifier name,
TinyPtrVector<PrecedenceGroupDecl *> &results) const override;
public:
virtual void lookupVisibleDecls(ModuleDecl::AccessPathTy accessPath,
VisibleDeclConsumer &consumer,
NLKind lookupKind) const override;