scripting language now has support for list and map literals: " [a,b,c] "

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@422 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2007-06-14 14:25:53 +00:00
parent 6e55175f51
commit 40e55e8151
7 changed files with 73 additions and 11 deletions
+9 -4
View File
@@ -257,11 +257,16 @@ class ScriptCustomCollectionIterator : public ScriptIterator {
};
ScriptValueP ScriptCustomCollection::getMember(const String& name) const {
long index;
if (name.ToLong(&index) && index >= 0 && (size_t)index < value.size()) {
return value.at(index);
map<String,ScriptValueP>::const_iterator it = key_value.find(name);
if (it != key_value.end()) {
return it->second;
} else {
return ScriptValue::getMember(name);
long index;
if (name.ToLong(&index) && index >= 0 && (size_t)index < value.size()) {
return value.at(index);
} else {
return ScriptValue::getMember(name);
}
}
}
ScriptValueP ScriptCustomCollection::makeIterator(const ScriptValueP& thisP) const {