Пример #1
0
 internal bool BindInParent(SymbolId name, Binder binder)
 {
     Binding binding;
     ContainsNestedFreeVariables = true;
     if (TryGetBinding(name, out binding)) {
         if (binding.IsGlobal) {
             return false;
         } else {
             if (binding.IsDeleted) {
                 binder.ReportSyntaxError(string.Format("can not delete variable '{0}' referenced in nested scope", name.GetString()), this);
             }
             MakeEnvironment(name);
             HasEnvironment = true;
             return true;
         }
     }
     if (parent != null) {
         if (parent.BindInParent(name, binder)) {
             IsClosure = true;
             HasEnvironment = true;
             return true;
         }
     }
     return false;
 }