MCPcopy Create free account
hub / github.com/devosoft/avida / PopScope

Method PopScope

avida-core/source/script/cSymbolTable.cc:69–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67}
68
69void cSymbolTable::PopScope()
70{
71 m_deactivate_cycle++;
72
73 for (int i = 0; i < m_sym_tbl.GetSize(); i++) {
74 sSymbolEntry* se = m_sym_tbl[i];
75 if (se->scope == m_scope && !se->deactivate) {
76 if (se->shadow == -1) m_sym_dict.Remove(se->name);
77 else m_sym_dict.SetValue(se->name, se->shadow);
78 se->deactivate = m_deactivate_cycle;
79 }
80 }
81
82 for (int i = 0; i < m_fun_tbl.GetSize(); i++) {
83 sFunctionEntry* fe = m_fun_tbl[i];
84 if (fe->scope == m_scope && !fe->deactivate) {
85 if (fe->shadow == -1) m_fun_dict.Remove(fe->name);
86 else m_fun_dict.SetValue(fe->name, fe->shadow);
87 fe->deactivate = m_deactivate_cycle;
88 }
89 }
90
91 m_return = false;
92 m_scope--;
93}
94

Callers 2

VisitStatementListMethod · 0.80
VisitForeachBlockMethod · 0.80

Calls 3

GetSizeMethod · 0.45
RemoveMethod · 0.45
SetValueMethod · 0.45

Tested by

no test coverage detected