@@ -54,7 +54,7 @@ namespace rift {
5454
5555 VisitorResult Visitor::visit (IdentifierNode const & node) noexcept {
5656 // check local variables
57- if (auto it = m_localVariables.find (node.name ()); it != m_localVariables.end ()) {
57+ if (auto it = m_localVariables.get (). find (node.name ()); it != m_localVariables. get () .end ()) {
5858 return geode::Ok (it->second );
5959 }
6060
@@ -239,7 +239,7 @@ namespace rift {
239239 switch (iterValue.type ()) {
240240 case Value::Type::String: {
241241 for (auto const & c : iterValue.toString ()) {
242- m_localVariables[var] = Value (std::string (1 , c));
242+ m_localVariables. get () [var] = Value (std::string (1 , c));
243243 auto res = visit (node.getBody ());
244244 if (res.isErr ()) {
245245 return res;
@@ -253,7 +253,7 @@ namespace rift {
253253 return node.error (fmt::format (" For loop: {} -> {} : {} exceeds max iterations" , var, iter.unwrap ().toString (), maxIters));
254254 }
255255 for (auto const & val : arr) {
256- m_localVariables[var] = val;
256+ m_localVariables. get () [var] = val;
257257 auto res = visit (node.getBody ());
258258 if (res.isErr ()) {
259259 return res;
@@ -267,7 +267,7 @@ namespace rift {
267267 return node.error (fmt::format (" For loop: {} -> {} : {} exceeds max iterations" , var, iter.unwrap ().toString (), maxIters));
268268 }
269269 for (auto const & [key, val] : obj) {
270- m_localVariables[var] = key;
270+ m_localVariables. get () [var] = key;
271271 auto res = visit (node.getBody ());
272272 if (res.isErr ()) {
273273 return res;
@@ -284,7 +284,7 @@ namespace rift {
284284 return node.error (fmt::format (" For loop: {} -> {} : {} exceeds max iterations" , var, iter.unwrap ().toString (), maxIters));
285285 }
286286 for (int64_t i = 0 ; i < max; ++i) {
287- m_localVariables[var] = Value (i);
287+ m_localVariables. get () [var] = Value (i);
288288 auto res = visit (node.getBody ());
289289 if (res.isErr ()) {
290290 return res;
@@ -319,7 +319,7 @@ namespace rift {
319319 return value;
320320 }
321321
322- m_localVariables[node.getName ()] = value.unwrap ();
322+ m_localVariables. get () [node.getName ()] = value.unwrap ();
323323 return geode::Ok (std::move (value.unwrap ()));
324324 }
325325}
0 commit comments