"div" operator for integer division,

Added parser support for closure operator fun@(args)
Use equal() function for all script comparisons, better support for deciding when to use strings and when to use pointers equality.

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@964 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2008-06-03 16:38:33 +00:00
parent 6912dfda09
commit c5159ebcf7
12 changed files with 197 additions and 66 deletions
-18
View File
@@ -173,24 +173,6 @@ SCRIPT_FUNCTION(remove_tags) {
// ----------------------------------------------------------------------------- : Collection stuff
/// compare script values for equallity
bool equal(const ScriptValue& a, const ScriptValue& b) {
if (&a == &b) return true;
ScriptType at = a.type(), bt = b.type();
if (at != bt) {
return false;
} else if (at == SCRIPT_INT) {
return (int)a == (int)b;
} else if (at == SCRIPT_DOUBLE) {
return (double)a == (double)b;
} else if (at == SCRIPT_STRING) {
return a.toString() == b.toString();
} else {
// compare pointers, must be equal and not null
const void *ap = a.comparePointer(), *bp = b.comparePointer();
return (ap && ap == bp);
}
}
/// position of some element in a vector
/** 0 based index, -1 if not found */