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); }
public override BoundNode VisitDeclarationExpression(BoundDeclarationExpression node) { if (inExpressionLambda) { Error(ErrorCode.ERR_ExpressionTreeContainsDeclarationExpression, node); } return(base.VisitDeclarationExpression(node)); }
public override BoundNode VisitDeclarationExpression(BoundDeclarationExpression node) { if (IsInside) { variablesDeclared.Add(node.LocalSymbol); } return base.VisitDeclarationExpression(node); }
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); }
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); }