use of dyvilx.tools.compiler.ast.imports.IImportContext in project Dyvil by Dyvil.
the class HeaderContext method getImplicitMatches.
@Override
public void getImplicitMatches(MatchList<IMethod> list, IValue value, IType targetType) {
// See comment in getMethodMatches for rationale
this.header.getImplicitMatches(list, value, targetType);
if (list.hasCandidate()) {
return;
}
final ImportDeclaration[] imports = this.header.importDeclarations;
for (int i = 0; i < this.header.importCount; i++) {
final IImportContext importContext = imports[i].getContext();
final MatchList<IMethod> subList = list.emptyCopy();
importContext.getImplicitMatches(subList, value, targetType);
list.addAll(subList);
}
}
use of dyvilx.tools.compiler.ast.imports.IImportContext in project Dyvil by Dyvil.
the class HeaderContext method getMethodMatches.
@Override
public void getMethodMatches(MatchList<IMethod> list, IValue receiver, Name name, ArgumentList arguments) {
// For ordinary headers, this is a no-op, since they (currently) cannot host any free-standing functions
// The REPL however can, so we need this call
this.header.getMethodMatches(list, receiver, name, arguments);
if (list.hasCandidate()) {
return;
}
final ImportDeclaration[] imports = this.header.importDeclarations;
for (int i = 0; i < this.header.importCount; i++) {
final IImportContext importContext = imports[i].getContext();
final MatchList<IMethod> subList = list.emptyCopy();
importContext.getMethodMatches(subList, receiver, name, arguments);
list.addAll(subList);
}
}
use of dyvilx.tools.compiler.ast.imports.IImportContext in project Dyvil by Dyvil.
the class HeaderContext method resolveTypeAlias.
@Override
public void resolveTypeAlias(MatchList<ITypeAlias> matches, IType receiver, Name name, TypeList arguments) {
this.header.resolveTypeAlias(matches, receiver, name, arguments);
if (matches.hasCandidate()) {
return;
}
final ImportDeclaration[] importDeclarations = this.header.importDeclarations;
for (int i = 0; i < this.header.importCount; i++) {
final IImportContext importContext = importDeclarations[i].getContext();
final MatchList<ITypeAlias> subList = matches.emptyCopy();
importContext.resolveTypeAlias(subList, receiver, name, arguments);
matches.addAll(subList);
}
}
Aggregations