public Maybe<ISymbol> Resolve(QualifiedIdentifier identifier, SymbolTable table) { return table.Resolve(identifier) .Or(() => Usings .Select(x => table.Resolve(x + identifier)) .Squash() .FirstOrDefault()); }
public Maybe<ISymbol> Resolve(QualifiedIdentifier identifier, SymbolTable table) { var parentFullName = Parent.OfType<ISymbol>().Select(x => x.FullName); return table.Resolve(FullName + identifier) .Or(() => Usings .Select(x => table.Resolve(x + identifier)) .Squash() .TryFirst()) .Or(() => Name.Parent .Recurse(x => x.Parent) .Select(x => parentFullName .Select(y => y + x + identifier) .Or(() => x + identifier) .SelectMaybe(table.Resolve)) .Squash() .TryFirst()) .Or(() => Parent.OfType<IResolutionRoot>().SelectMaybe(x => x.Resolve(identifier, table))); }
public Maybe<ISymbol> Resolve(QualifiedIdentifier identifier, SymbolTable table) { return table.Resolve(FullName + identifier) .Or(() => Parent.OfType<IResolutionRoot>().SelectMaybe(x => x.Resolve(identifier, table))); }