diff options
| author | Yong He <yonghe@outlook.com> | 2023-12-06 12:05:07 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-06 12:05:07 -0800 |
| commit | 11111e5733b189127dc2c4934d67693b9bc6e764 (patch) | |
| tree | 0ba84df3e856eb104abec2ecac47242bc70a7b7d /source/slang/slang-lookup.cpp | |
| parent | fa6d8717d02912697c09f2d7de802723ac6d6e47 (diff) | |
Support visibility control and default to `internal`. (#3380)
* Support visibility control and default to `internal`.
* Fix wip.
* Fixes.
* Fix.
* Fix test.
* Add legacy language detection and compatibility for existing code.
* Add doc.
---------
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-lookup.cpp')
| -rw-r--r-- | source/slang/slang-lookup.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/source/slang/slang-lookup.cpp b/source/slang/slang-lookup.cpp index ee4518c20..04a855c3c 100644 --- a/source/slang/slang-lookup.cpp +++ b/source/slang/slang-lookup.cpp @@ -98,6 +98,19 @@ void AddToLookupResult( } } +void AddToLookupResult(LookupResult& result, const LookupResult& items) +{ + if (items.isOverloaded()) + { + for (auto item : items.items) + AddToLookupResult(result, item); + } + else if (items.isValid()) + { + AddToLookupResult(result, items.item); + } +} + LookupResult refineLookup(LookupResult const& inResult, LookupMask mask) { if (!inResult.isValid()) return inResult; @@ -894,11 +907,12 @@ LookupResult lookUpMember( SemanticsVisitor* semantics, Name* name, Type* type, + Scope* sourceScope, LookupMask mask, LookupOptions options) { LookupResult result; - LookupRequest request = initLookupRequest(semantics, name, mask, options, nullptr); + LookupRequest request = initLookupRequest(semantics, name, mask, options, sourceScope); _lookUpMembersInType(astBuilder, name, type, request, result, nullptr); return result; } |
