diff options
author | Matthias Benkard <mulk@minimulk.mst-plus> | 2008-08-24 14:34:19 +0200 |
---|---|---|
committer | Matthias Benkard <mulk@minimulk.mst-plus> | 2008-08-24 14:34:19 +0200 |
commit | 0be08d02045b70bdb3eb8ab7f01051f4372a2d04 (patch) | |
tree | 263ecad8ec9286868acd2df45eb8263210d7c131 | |
parent | 7f528dd0da2a99a9043bc63c4f7ff42ded72b976 (diff) |
MLKLexicalContext: Support NIL as a variable and function name.
-rw-r--r-- | MLKLexicalContext.m | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/MLKLexicalContext.m b/MLKLexicalContext.m index a1bb8e8..d5c6add 100644 --- a/MLKLexicalContext.m +++ b/MLKLexicalContext.m @@ -326,12 +326,12 @@ static MLKLexicalContext *global_context; -(id) deepPropertyForVariable:(id)name key:(id)key { - NSDictionary *props = [_variableInfo objectForKey:name]; + NSDictionary *props = [_variableInfo objectForKey:nullify(name)]; id property; if (props && (property = [props objectForKey:key])) return property; - else if (!_parent || [_variables containsObject:name]) + else if (!_parent || [_variables containsObject:nullify(name)]) return nil; else return [_parent deepPropertyForVariable:name key:key]; @@ -345,13 +345,13 @@ static MLKLexicalContext *global_context; // lexically apparent binding, the property is set in the global // context. This does not make it pervasive, however. - if (!_parent || [_variables containsObject:name]) + if (!_parent || [_variables containsObject:nullify(name)]) { - NSMutableDictionary *props = [_variableInfo objectForKey:name]; + NSMutableDictionary *props = [_variableInfo objectForKey:nullify(name)]; if (!props) { props = [NSMutableDictionary dictionary]; - [_variableInfo setObject:props forKey:name]; + [_variableInfo setObject:props forKey:nullify(name)]; } [props setObject:object forKey:key]; } @@ -363,12 +363,12 @@ static MLKLexicalContext *global_context; -(id) deepPropertyForFunction:(id)name key:(id)key { - NSDictionary *props = [_functionInfo objectForKey:name]; + NSDictionary *props = [_functionInfo objectForKey:nullify(name)]; id property; if (props && (property = [props objectForKey:key])) return property; - else if (!_parent || [_functions containsObject:name]) + else if (!_parent || [_functions containsObject:nullify(name)]) return nil; else return [_parent deepPropertyForFunction:name key:key]; @@ -378,13 +378,13 @@ static MLKLexicalContext *global_context; forFunction:(id)name key:(id)key { - if (!_parent || [_functions containsObject:name]) + if (!_parent || [_functions containsObject:nullify(name)]) { - NSMutableDictionary *props = [_functionInfo objectForKey:name]; + NSMutableDictionary *props = [_functionInfo objectForKey:nullify(name)]; if (!props) { props = [NSMutableDictionary dictionary]; - [_functionInfo setObject:props forKey:name]; + [_functionInfo setObject:props forKey:nullify(name)]; } [props setObject:object forKey:key]; } |