A simple scripting language in C++
Ferenc Szontágh
2025-04-19 558e0191ba5a5b0ab99825de7d7d2219387e559e
src/Interpreter/AssignmentStatementNode.hpp
@@ -35,8 +35,14 @@
        using namespace Symbols;
        auto * symContainer = SymbolContainer::instance();
        // Variables are stored under <scope>.variables
        const std::string base_ns = symContainer->currentScopeName();
        const std::string var_ns = base_ns + ".variables";
        const std::string base_ns   = symContainer->currentScopeName();
        const std::string var_ns    = base_ns + ".variables";
        const std::string const_ns  = base_ns + ".constants";
        // Prevent assignment to constants
        if (symContainer->exists(targetName_, const_ns)) {
            throw Exception(
                "Cannot assign to constant '" + targetName_ + "'", filename_, line_, column_);
        }
        if (!symContainer->exists(targetName_, var_ns)) {
            throw Exception(
                "Variable '" + targetName_ + "' does not exist in namespace: " + var_ns,