diff options
author | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2014-10-26 01:17:02 +0000 |
---|---|---|
committer | andreas <andreas@daaaf23c-2e50-4459-9457-1e69db5a47bf> | 2014-10-26 01:17:02 +0000 |
commit | eb7211bb8d199b60d1e15cc84e16e08f1e8c0f23 (patch) | |
tree | 41b0483045ad266ba41ad54f64b0c36f8b10522d /src/core | |
parent | 250d6a4dbe61b6798cd090abeabdc0ece8237dd3 (diff) |
Fully implemented reading values from MozJs (except for all bugs that are still in it); added generic unit test for java script engine implementations; added suppressions for valgrind (as the mozjs library produced some leaks that can safely be ignored); added a bunch of TODOs
git-svn-id: file:///var/local/svn/basicwriter@79 daaaf23c-2e50-4459-9457-1e69db5a47bf
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/script/ScriptEngine.hpp | 8 | ||||
-rw-r--r-- | src/core/script/Variant.hpp | 21 |
2 files changed, 22 insertions, 7 deletions
diff --git a/src/core/script/ScriptEngine.hpp b/src/core/script/ScriptEngine.hpp index 2341beb..6c048aa 100644 --- a/src/core/script/ScriptEngine.hpp +++ b/src/core/script/ScriptEngine.hpp @@ -27,6 +27,14 @@ #include "Variant.hpp" +// TODO: Provide more Exception classes than ScriptEngineException -- one for +// internal errors, one for script errors + +// TODO: Allow reporting multiple exceptions (e.g. to report all syntax errors +// at once) + +// TODO: Add API that allow pre-compilation of scripts + namespace ousia { namespace script { diff --git a/src/core/script/Variant.hpp b/src/core/script/Variant.hpp index 465793f..8cb0e8f 100644 --- a/src/core/script/Variant.hpp +++ b/src/core/script/Variant.hpp @@ -26,6 +26,12 @@ #include <string> #include <vector> +// TODO: Replace VariantType::number with VariantType::double +// TODO: Convert VariantType::integer to int32_t +// TODO: Use std::unique_ptr for *Function +// TODO: Move semantic in complex constructors +// TODO: Delete default constructors/assignment operators in pretty much everything + namespace ousia { namespace script { @@ -124,6 +130,9 @@ private: }; public: + + using Int = int32_t; + /** * Copy constructor of the Variant class. * @@ -182,7 +191,8 @@ public: Variant(const std::vector<Variant> &a); /** - * Constructor for map values. The given map is copied and managed by the new + * Constructor for map values. The given map is copied and managed by the + *new * Variant instance. * * @param m is a reference to the map. @@ -190,7 +200,8 @@ public: Variant(const std::map<std::string, Variant> &m); /** - * Constructor for function values. The given pointer to the function object is cloned and managed by the new Variant instance. + * Constructor for function values. The given pointer to the function object + *is cloned and managed by the new Variant instance. * * @param f is a reference to the function. */ @@ -224,10 +235,7 @@ public: * * @return the current type of the Variant. */ - VariantType getType() const - { - return type; - } + VariantType getType() const { return type; } bool getBooleanValue() const; int64_t getIntegerValue() const; @@ -253,7 +261,6 @@ public: */ friend std::ostream &operator<<(std::ostream &os, const Variant &v); }; - } } |