public override BoundNode VisitDeclarationExpression(BoundDeclarationExpression node)
        {
            if (IsInside)
            {
                variablesDeclared.Add(node.LocalSymbol);
            }

            return(base.VisitDeclarationExpression(node));
        }
        protected override void VisitLvalueDeclarationExpression(BoundDeclarationExpression node)
        {
            if (IsInside)
            {
                variablesDeclared.Add(node.LocalSymbol);
            }

            base.VisitLvalueDeclarationExpression(node);
        }
예제 #3
0
        public override BoundNode VisitDeclarationExpression(BoundDeclarationExpression node)
        {
            if (inExpressionLambda)
            {
                Error(ErrorCode.ERR_ExpressionTreeContainsDeclarationExpression, node);
            }

            return(base.VisitDeclarationExpression(node));
        }
예제 #4
0
        protected override void VisitLvalueDeclarationExpression(BoundDeclarationExpression node)
        {
            if (IsInside)
            {
                variablesDeclared.Add(node.LocalSymbol);
            }

            base.VisitLvalueDeclarationExpression(node);
        }
예제 #5
0
        public override BoundNode VisitDeclarationExpression(BoundDeclarationExpression node)
        {
            if (IsInside)
            {
                variablesDeclared.Add(node.LocalSymbol);
            }

            return base.VisitDeclarationExpression(node);
        }
예제 #6
0
        public override BoundNode VisitDeclarationExpression(BoundDeclarationExpression node)
        {
            if (node.InitializerOpt != null)
            {
                var rvalue      = VisitRvalue(node.InitializerOpt) as BoundExpression;
                var valueHolder = MakeValueHolder(rvalue);
                this.State.variables[node.LocalSymbol] = valueHolder.value;
            }

            // Treat similar to BoundLocal. This might need an adjustment for a semicolon operators.
            base.VisitDeclarationExpression(node);
            Value result;

            this.State.variables.TryGetValue(node.LocalSymbol, out result);
            return(result != null ? new BoundValueHolder(result, node.Type, node.Syntax) : null);
        }
예제 #7
0
        public override BoundNode VisitDeclarationExpression(BoundDeclarationExpression node)
        {
            var local = new BoundLocal(node.Syntax, node.LocalSymbol, null, node.LocalSymbol.Type);

            if (node.InitializerOpt == null)
            {
                return(local);
            }

            return(new BoundSequence(node.Syntax,
                                     ImmutableArray <LocalSymbol> .Empty,
                                     ImmutableArray.Create <BoundExpression>(new BoundAssignmentOperator(
                                                                                 node.Syntax,
                                                                                 new BoundLocal(
                                                                                     local.Syntax,
                                                                                     local.LocalSymbol,
                                                                                     null,
                                                                                     local.Type
                                                                                     ),
                                                                                 VisitExpression(node.InitializerOpt),
                                                                                 local.Type)),
                                     local,
                                     local.Type));
        }
        public override BoundNode VisitDeclarationExpression(BoundDeclarationExpression node)
        {
            var local = new BoundLocal(node.Syntax, node.LocalSymbol, null, node.LocalSymbol.Type);

            if (node.InitializerOpt == null)
            {
                return local;
            }

            return new BoundSequence(node.Syntax, 
                                     ImmutableArray<LocalSymbol>.Empty, 
                                     ImmutableArray.Create<BoundExpression>(new BoundAssignmentOperator(
                                                                                                        node.Syntax,
                                                                                                        new BoundLocal(
                                                                                                            local.Syntax,
                                                                                                            local.LocalSymbol,
                                                                                                            null,
                                                                                                            local.Type
                                                                                                        ),
                                                                                                        VisitExpression(node.InitializerOpt),
                                                                                                        local.Type)),
                                     local,
                                     local.Type);
        }
        public override BoundNode VisitDeclarationExpression(BoundDeclarationExpression node)
        {
            if (inExpressionLambda)
            {
                Error(ErrorCode.ERR_ExpressionTreeContainsDeclarationExpression, node);
            }

            return base.VisitDeclarationExpression(node);
        }