diff options
Diffstat (limited to 'DTScopedVars.c')
| -rw-r--r-- | DTScopedVars.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/DTScopedVars.c b/DTScopedVars.c index 0cde670..3165553 100644 --- a/DTScopedVars.c +++ b/DTScopedVars.c @@ -4,10 +4,12 @@ static const ScopedVar_Global = 1; static const ScopedVar_Local = 2; static const ScopedVar_ArrayIndex = 3; +static const ScopedVar_MapIndex = 4; global func GlobalVar(name) { return [ScopedVar_Global, name]; } global func LocalVar(name, object target) { return [ScopedVar_Local, name, target || this]; } global func ArrayVar(index, array scopedVar) { return [ScopedVar_ArrayIndex, scopedVar, index]; } +global func MapVar(index, array scopedVar) { return [ScopedVar_MapIndex, scopedVar, index]; } global func &ScopedVar(array variable) { @@ -46,6 +48,11 @@ global func &ScopedVar(array variable) } return ScopedVar(variable[1])[index]; } + else if(variable[0] == ScopedVar_MapIndex) + { + var index = variable[2]; + return ScopedVar(variable[1])[index]; + } else { if(this) |
