本文整理汇总了C#中Microsoft.CodeAnalysis.CSharp.BoundExpressionStatement.Update方法的典型用法代码示例。如果您正苦于以下问题:C# BoundExpressionStatement.Update方法的具体用法?C# BoundExpressionStatement.Update怎么用?C# BoundExpressionStatement.Update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.CodeAnalysis.CSharp.BoundExpressionStatement
的用法示例。
在下文中一共展示了BoundExpressionStatement.Update方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: VisitExpressionStatement
// All nodes with a single child expression are rewritten in the same manner.
//
// If the node is an expression and the child contains an await expression, then the rewriting transforms:
// Expression(Spill(sideEffects, Value))
// to:
// Spill(sideEffects, Expression(Value))
//
// If the node is a statement and the child contains an await expression, then the rewriting transforms:
// ExpressionStatement(Spill(sideEffects, Value))
// to:
// Block(sideEffects, ExpressionStatement(Value))
//
// If the child expression does not contain an await expression then no rewriting is performed.
public override BoundNode VisitExpressionStatement(BoundExpressionStatement node)
{
BoundExpression expression = (BoundExpression)this.Visit(node.Expression);
if (expression.Kind != BoundKind.SpillSequence)
{
return node.Update(expression);
}
return RewriteSpillSequenceAsBlock((BoundSpillSequence)expression);
}
示例2: VisitExpressionStatement
public override BoundNode VisitExpressionStatement(BoundExpressionStatement node)
{
var syntax = node.Syntax;
var loweredExpression = VisitUnusedExpression(node.Expression);
if (loweredExpression == null)
{
// NOTE: not using a BoundNoOpStatement, since we don't want a nop to be emitted.
// CONSIDER: could use a BoundNoOpStatement (DevDiv #12943).
return BoundStatementList.Synthesized(syntax);
}
else
{
return AddSequencePoint(node.Update(loweredExpression));
}
}
示例3: RewriteExpressionStatement
private BoundStatement RewriteExpressionStatement(BoundExpressionStatement node, bool suppressInstrumentation = false)
{
var loweredExpression = VisitUnusedExpression(node.Expression);
if (loweredExpression == null)
{
return null;
}
else
{
BoundStatement result = node.Update(loweredExpression);
if (!suppressInstrumentation && this.Instrument && !node.WasCompilerGenerated)
{
result = _instrumenter.InstrumentExpressionStatement(node, result);
}
return result;
}
}
示例4: VisitExpressionStatement
public override BoundNode VisitExpressionStatement(BoundExpressionStatement node)
{
BoundSpillSequence2 ss = null;
BoundExpression expr;
if (node.Expression.Kind == BoundKind.AwaitExpression)
{
// await expression with result discarded
var awaitExpression = (BoundAwaitExpression)node.Expression;
var expression = VisitExpression(ref ss, awaitExpression.Expression);
expr = awaitExpression.Update(expression, awaitExpression.GetAwaiter, awaitExpression.IsCompleted, awaitExpression.GetResult, awaitExpression.Type);
}
else
{
expr = VisitExpression(ref ss, node.Expression);
}
Debug.Assert(expr != null);
Debug.Assert(ss == null || ss.Value == null);
BoundStatement replacement = UpdateStatement(ss, node.Update(expr));
return replacement;
}
示例5: VisitExpressionStatement
public override BoundNode VisitExpressionStatement(BoundExpressionStatement node)
{
// ref assignments might be translated away (into nothing). If so just
// return no statement. The enclosing statement list will just omit it.
BoundExpression expression = (BoundExpression)this.Visit(node.Expression);
return (expression == null) ? null : node.Update(expression);
}
示例6: VisitExpressionStatement
public override BoundNode VisitExpressionStatement(BoundExpressionStatement node)
{
if (node.Expression.Kind == BoundKind.AwaitExpression)
{
var awaitExpression = VisitAwaitExpression((BoundAwaitExpression)node.Expression, resultsDiscarded: true);
return node.Update(awaitExpression);
}
return base.VisitExpressionStatement(node);
}
示例7: VisitExpressionStatement
public override BoundNode VisitExpressionStatement(BoundExpressionStatement node)
{
if (node.Expression.Kind == BoundKind.AwaitExpression)
{
return VisitAwaitExpression((BoundAwaitExpression)node.Expression, resultPlace: null);
}
else if (node.Expression.Kind == BoundKind.AssignmentOperator)
{
var expression = (BoundAssignmentOperator)node.Expression;
if (expression.Right.Kind == BoundKind.AwaitExpression)
{
return VisitAwaitExpression((BoundAwaitExpression)expression.Right, resultPlace: expression.Left);
}
}
BoundExpression expr = (BoundExpression)this.Visit(node.Expression);
return (expr != null) ? node.Update(expr) : (BoundStatement)F.Block();
}