public override ICodeNode VisitExpressionStatement(ExpressionStatement node) { node.Expression = (Expression)Visit(node.Expression); if (node.Expression == null) { if (node.Label != null && node.Label != string.Empty) { Statement nextStatement = node.GetNextStatement(); if (nextStatement == null || nextStatement.Label != null && nextStatement.Label != string.Empty) { var result = new EmptyStatement() { Label = node.Label }; this.methodContext.GotoLabels[node.Label] = result; return result; } nextStatement.Label = node.Label; this.methodContext.GotoLabels[node.Label] = nextStatement; } return null; } return node; }
public override ICodeNode VisitExpressionStatement(ExpressionStatement node) { Expression result = (Expression)Visit(node.Expression); if (result == null) { if (!string.IsNullOrEmpty(node.Label)) { Statement nextStatement = node.GetNextStatement(); if (nextStatement == null || !string.IsNullOrEmpty(nextStatement.Label)) { Statement newStatement = new EmptyStatement(); newStatement.Label = node.Label; return newStatement; } nextStatement.Label = node.Label; } return null; } node.Expression = result; return node; }