mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
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:
+11
-2
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user