libcore|Scripting: Core functionality for object-oriented classes
This commit implements the core plumbing of an object-oriented class system for Doomsday Script.
Added Value::memberScope(): when the value is used with the member operator (left value), returns the Record where the members should be looked up from.
NameExpression now checks for the existence of the isa member that specifies all the superclasses of an instance. Identifiers can be located from superclasses if they are not actual instance members.
Built-in types like DictionaryValue can return their built-in class directly via memberScope(), so that any operations done on them are looked up from the class.
Evaluator now keeps track of the scope in which evaluation occurs in terms of a Value, so that the appropriate instance can be determined when doing a member function call. It can then call memberScope() as appropriate to determine the namespace of the members. It can also then give out the scope when a result is popped, so that a function call can take this value and give it to "self" or specify it via Context::instanceScope() for native calls.
ScriptSystem defines built-in classes in the native "Script" module, e.g., Script.Dictionary with keys() and values() member functions.
Refactored dictkeys() and dictvalues() to ask DictionaryValue to compose the returned arrays. Applied pimpl in Evaluator and Context.
libcore|Scripting: Core functionality for object-oriented classes
This commit implements the core plumbing of an object-oriented class
system for Doomsday Script.
Added Value::memberScope(): when the value is used with the member
operator (left value), returns the Record where the members should be
looked up from.
NameExpression now checks for the existence of the isa member
that specifies all the superclasses of an instance. Identifiers can
be located from superclasses if they are not actual instance members.
Built-in types like DictionaryValue can return their built-in class
directly via memberScope(), so that any operations done on them
are looked up from the class.
Evaluator now keeps track of the scope in which evaluation occurs
in terms of a Value, so that the appropriate instance can be determined
when doing a member function call. It can then call memberScope()
as appropriate to determine the namespace of the members. It can
also then give out the scope when a result is popped, so that a
function call can take this value and give it to "self" or specify
it via Context::instanceScope() for native calls.
ScriptSystem defines built-in classes in the native "Script" module,
e.g., Script.Dictionary with keys() and values() member functions.
Refactored dictkeys() and dictvalues() to ask DictionaryValue to
compose the returned arrays. Applied pimpl in Evaluator and Context.