Inheritance: Comprehension
Esempio n. 1
0
        public override void PostWalk(SetComprehension node)
        {
            base.PostWalk(node);
            PopScope();

            if (node.Scope.NeedsLocalsDictionary)
            {
                _currentScope.NeedsLocalsDictionary = true;
            }
        }
Esempio n. 2
0
        // SetComp
        public override bool Walk(SetComprehension node)
        {
            BitArray save = _bits;

            _bits = new BitArray(_bits);

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

            _bits = save;
            return(false);
        }
Esempio n. 3
0
        // comp_iter '}'
        private SetComprehension FinishSetComp(Expression item, 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 SetComprehension(item, iters);
            ret.SetLoc(_globalParent, oStart, cEnd);
            return ret;
        }
Esempio n. 4
0
 public override bool Walk(SetComprehension node)
 {
     node.Parent = _currentScope;
     PushScope(node.Scope);
     return base.Walk(node);
 }
Esempio n. 5
0
        public override void PostWalk(SetComprehension node)
        {
            base.PostWalk(node);
            PopScope();

            if (node.Scope.NeedsLocalsDictionary) {
                _currentScope.NeedsLocalsDictionary = true;
            }
        }
Esempio n. 6
0
 public override bool Walk(SetComprehension node)
 {
     node.Parent = _currentScope;
     PushScope(node.Scope);
     return(base.Walk(node));
 }
Esempio n. 7
0
 internal SetComp(SetComprehension comp)
     : this()
 {
     _elt = Convert(comp.Item);
     _generators = Convert(comp.Iterators);
 }
Esempio n. 8
0
 public override bool Walk(SetComprehension node)
 {
     WalkComprehensionIterators(node);
     node.Item.Walk(this);
     return(false);
 }
Esempio n. 9
0
        // SetComp
        public override bool Walk(SetComprehension node) {
            BitArray save = _bits;
            _bits = new BitArray(_bits);

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

            _bits = save;
            return false;
        }
Esempio n. 10
0
 public string Visit(PyAst.SetComprehension node) => throw CreateNotImplementedEx();