File tree Expand file tree Collapse file tree 3 files changed +4
-2
lines changed
include/Ark/Compiler/NameResolution
src/arkreactor/Compiler/NameResolution Expand file tree Collapse file tree 3 files changed +4
-2
lines changed Original file line number Diff line number Diff line change 1616#include < optional>
1717#include < memory>
1818#include < vector>
19+ #include < ranges>
1920#include < unordered_set>
2021
2122namespace Ark ::internal
@@ -79,6 +80,7 @@ namespace Ark::internal
7980 [[nodiscard]] inline virtual bool withPrefix () const { return false ; }
8081 [[nodiscard]] inline virtual bool isGlob () const { return false ; }
8182 [[nodiscard]] inline virtual std::string prefix () const { return " " ; }
83+ [[nodiscard]] inline virtual bool hasSymbol (const std::string&) const { return false ; }
8284
8385 private:
8486 std::unordered_set<Declaration> m_vars {};
@@ -123,6 +125,7 @@ namespace Ark::internal
123125 [[nodiscard]] inline bool withPrefix () const override { return m_with_prefix; }
124126 [[nodiscard]] inline bool isGlob () const override { return m_is_glob; }
125127 [[nodiscard]] inline std::string prefix () const override { return m_namespace; }
128+ [[nodiscard]] inline bool hasSymbol (const std::string& symbol) const override { return std::ranges::find (m_symbols, symbol) != m_symbols.end (); }
126129
127130 private:
128131 std::string m_namespace;
Original file line number Diff line number Diff line change @@ -98,7 +98,7 @@ namespace Ark::internal
9898 {
9999 if (top && prefix == scope->prefix ())
100100 return std::make_pair (true , maybe_fqn);
101- if (!top && prefix == scope->prefix () && scope->isGlob ())
101+ if (!top && prefix == scope->prefix () && ( scope->isGlob () || scope-> hasSymbol (name) ))
102102 return std::make_pair (true , maybe_fqn);
103103
104104 top = false ;
Original file line number Diff line number Diff line change 11#include < Ark/Compiler/NameResolution/StaticScope.hpp>
22
3- #include < ranges>
43#include < utility>
54#include < fmt/format.h>
65
You can’t perform that action at this time.
0 commit comments