11#ifndef ARK_COMPILER_NAMERESOLUTIONPASS_HPP
12#define ARK_COMPILER_NAMERESOLUTIONPASS_HPP
16#include <unordered_set>
38 void process(
const Node& ast);
44 [[nodiscard]]
const Node& ast()
const noexcept;
52 std::string addDefinedSymbol(
const std::string& sym,
bool is_mutable);
67 void visit(
Node& node,
bool register_declarations);
75 void visitKeyword(
Node& node,
Keyword keyword,
bool register_declarations);
83 void addSymbolNode(
const Node& symbol,
const std::string& old_name =
"");
92 [[nodiscard]]
bool mayBeFromPlugin(
const std::string& name)
const noexcept;
94 std::string updateSymbolWithFullyQualifiedName(
Node& symbol);
100 void checkForUndefinedSymbol()
const;
108 [[nodiscard]] std::string offerSuggestion(
const std::string& str)
const;
AST node used by the parser, optimizer and compiler.
Interface for a compiler pass.
Handle scope resolution at compile time.
std::vector< std::string > m_plugin_names
std::unordered_set< std::string > m_language_symbols
Precomputed set of language symbols that can't be used to define variables.
std::unordered_set< std::string > m_defined_symbols
ScopeResolver m_scope_resolver
std::vector< Node > m_symbol_nodes
A node of an Abstract Syntax Tree for ArkScript.
An interface to describe compiler passes.
Keyword
The different keywords available.