Ejemplo n.º 1
0
 public override SyntaxNode VisitEqualsValueClause(EqualsValueClauseSyntax node)
 {
     if (node.Value.Kind().Equals(SyntaxKind.ParenthesizedExpression))
     {
         NumberOperations ne = new NumberOperations();
         ParenthesizedExpressionSyntax pe = (ParenthesizedExpressionSyntax)node.Value;
         ExpressionSyntax        es       = SyntaxFactory.ParseExpression(ne.ExpressionParser(pe.Expression.ToString()).ToString());
         EqualsValueClauseSyntax newNode  = node.WithValue(es);
         return(base.VisitEqualsValueClause(node.ReplaceNode(node, newNode)));
     }
     return(base.VisitEqualsValueClause(node));
 }
Ejemplo n.º 2
0
 public override SyntaxNode VisitEqualsValueClause(EqualsValueClauseSyntax node)
 {
     if (node.Value.Kind().Equals(SyntaxKind.NumericLiteralExpression))
     {
         NumberOperations        ne      = new NumberOperations();
         LiteralExpressionSyntax les     = (LiteralExpressionSyntax)node.Value;
         ExpressionSyntax        es      = SyntaxFactory.ParseExpression(ne.UnwrapNumber(les.Token.ValueText));
         EqualsValueClauseSyntax newNode = node.WithValue(es);
         return(base.VisitEqualsValueClause(node.ReplaceNode(node, newNode)));
     }
     return(base.VisitEqualsValueClause(node));
 }