Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Showing
30 changed files
with
610 additions
and
327 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.