Make == script operator to work correctly on collections (lists)

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@992 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2008-06-18 23:11:26 +00:00
parent b7ffca6cfc
commit a9c5f72fdc
5 changed files with 46 additions and 30 deletions
+11 -2
View File
@@ -321,6 +321,17 @@ class ScriptClosure : public ScriptValue {
void applyBindings(Context& ctx) const;
};
/// Turn a script function into a rule, a.k.a. a delayed closure
class ScriptRule : public ScriptValue {
public:
inline ScriptRule(const ScriptValueP& fun) : fun(fun) {}
virtual ScriptType type() const;
virtual String typeName() const;
virtual ScriptValueP eval(Context& ctx) const;
private:
ScriptValueP fun;
};
// ----------------------------------------------------------------------------- : Creating
/// Convert a value to a script value
@@ -360,7 +371,5 @@ template <> inline bool from_script<bool> (const ScriptValueP& va
template <> inline Color from_script<Color> (const ScriptValueP& value) { return (AColor)*value; }
template <> inline AColor from_script<AColor> (const ScriptValueP& value) { return *value; }
void from_script(const ScriptValueP& value, wxRegEx& out);
// ----------------------------------------------------------------------------- : EOF
#endif