Example #1
0
        private bool WalkIterators(Comprehension node) {
            if (node.Iterators != null) {
                foreach (ComprehensionIterator ci in node.Iterators) {
                    ci.Walk(this);
                }
            }

            return false;
        }
Example #2
0
 public ComprehensionScope(AnalysisValue comprehensionResult, Comprehension comprehension, InterpreterScope outerScope)
     : base(comprehensionResult, comprehension, outerScope) {
 }
Example #3
0
 private ComprehensionScope MakeDictComprehensionScope(Comprehension node) {
     var unit = new DictionaryComprehensionAnalysisUnit(node, _tree, _curUnit, _scope);
     unit.Enqueue();
     return (ComprehensionScope)unit.Scope;
 }
Example #4
0
 private ComprehensionScope MakeGeneratorComprehensionScope(Comprehension node) {
     var unit = new GeneratorComprehensionAnalysisUnit(node, _tree, _curUnit, _scope);
     unit.Enqueue();
     return (ComprehensionScope)unit.Scope;
 }
Example #5
0
 /// <summary>
 /// Makes sure we create a scope for a comprehension (generator, set, dict, or list comprehension in 3.x) where
 /// the variables which are assigned will be stored.  
 /// </summary>
 private void EnsureComprehensionScope(Comprehension node, Func<Comprehension, ComprehensionScope> makeScope) {
     InterpreterScope scope, declScope = _scope;
     if (!declScope.TryGetNodeScope(node, out scope)) {
         scope = makeScope(node);
         
         declScope.AddNodeScope(node, scope);
         declScope.Children.Add(scope);
     }
     _scope = scope;
 }