Пример #1
0
 public override bool Walk(DictionaryComprehension node)
 {
     WalkComprehensionIterators(node);
     node.Key.Walk(this);
     node.Value.Walk(this);
     return(false);
 }
Пример #2
0
        public override void PostWalk(DictionaryComprehension node)
        {
            base.PostWalk(node);
            PopScope();

            if (node.Scope.NeedsLocalsDictionary)
            {
                _currentScope.NeedsLocalsDictionary = true;
            }
        }
Пример #3
0
        // DictComp
        public override bool Walk(DictionaryComprehension node)
        {
            BitArray save = _bits;

            _bits = new BitArray(_bits);

            foreach (ComprehensionIterator iter in node.Iterators)
            {
                iter.Walk(this);
            }
            node.Key.Walk(this);
            node.Value.Walk(this);

            _bits = save;
            return(false);
        }
Пример #4
0
        // comp_iter '}'
        private DictionaryComprehension FinishDictComp(Expression key, Expression value, int oStart, int oEnd) {
            ComprehensionIterator[] iters = ParseCompIter();
            Eat(TokenKind.RightBrace);

            var cStart = GetStart();
            var cEnd = GetEnd();
            
            if (_sink != null) {
                _sink.MatchPair(
                    new SourceSpan(_tokenizer.IndexToLocation(oStart), _tokenizer.IndexToLocation(oEnd)),
                    new SourceSpan(_tokenizer.IndexToLocation(cStart), _tokenizer.IndexToLocation(cEnd)),
                    1
                );
            }
            var ret = new DictionaryComprehension(key, value, iters);
            ret.SetLoc(_globalParent, oStart, cEnd);
            return ret;
        }
Пример #5
0
 public override bool Walk(DictionaryComprehension node)
 {
     node.Parent = _currentScope;
     PushScope(node.Scope);
     return base.Walk(node);
 }
Пример #6
0
        public override void PostWalk(DictionaryComprehension node)
        {
            base.PostWalk(node);
            PopScope();

            if (node.Scope.NeedsLocalsDictionary) {
                _currentScope.NeedsLocalsDictionary = true;
            }
        }
Пример #7
0
 public override bool Walk(DictionaryComprehension node)
 {
     node.Parent = _currentScope;
     PushScope(node.Scope);
     return(base.Walk(node));
 }
Пример #8
0
 internal DictComp(DictionaryComprehension comp)
     : this()
 {
     _key = Convert(comp.Key);
     _value = Convert(comp.Value);
     _generators = Convert(comp.Iterators);
 }
Пример #9
0
        // DictComp
        public override bool Walk(DictionaryComprehension node) {
            BitArray save = _bits;
            _bits = new BitArray(_bits);

            foreach (ComprehensionIterator iter in node.Iterators) {
                iter.Walk(this);
            }
            node.Key.Walk(this);
            node.Value.Walk(this);

            _bits = save;
            return false;
        }
Пример #10
0
 public string Visit(PyAst.DictionaryComprehension node) => throw CreateNotImplementedEx();