Add class keyword for easier user defined types.

Issue #118
This commit is contained in:
Jason Turner
2014-08-22 21:11:49 -06:00
parent cb1c7730cf
commit fa1f4b795b
6 changed files with 205 additions and 31 deletions

View File

@@ -736,6 +736,19 @@ namespace chaiscript
return functions.find(name) != functions.end();
}
/// \returns All values in the local thread state in the parent scope, or if it doesn't exist,
/// the current scope.
std::map<std::string, Boxed_Value> get_parent_locals() const
{
StackData &stack = get_stack_data();
if (stack.size() > 1)
{
return stack[1];
} else {
return stack[0];
}
}
/// \returns All values in the local thread state, added through the add() function
std::map<std::string, Boxed_Value> get_locals() const
{