Optimize default arguments (@ operator) into script rules.

The plan is to deprecate rule form completely, so instead of replace_rule(match:..) write replace_text@(match: ...)

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@987 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2008-06-18 19:25:18 +00:00
parent 50b09c7673
commit 2662f9d4bf
9 changed files with 122 additions and 48 deletions
+6
View File
@@ -13,6 +13,7 @@
#include <gfx/color.hpp>
class Context;
class Dependency;
class ScriptClosure;
// ----------------------------------------------------------------------------- : ScriptValue
@@ -80,6 +81,11 @@ class ScriptValue : public IntrusivePtrBaseWithDelete {
/// Mark the scripts that this function depends on
/** Return value is an abstract version of the return value of eval */
virtual ScriptValueP dependencies(Context&, const Dependency&) const;
/// Simplify/optimize a default argument closure of this function.
/** Should return a simplification of the closure or null to keep the closure.
* Alternatively, the closure may be modified in place.
*/
virtual ScriptValueP simplifyClosure(ScriptClosure&) const;
/// Return an iterator for the current collection, an iterator is a value that has next()
/** thisP can be used to prevent destruction of the collection */