385 references to BinaryOperatorKind
Microsoft.CodeAnalysis (46)
Generated\Operations.Generated.cs (20)
1031BinaryOperatorKind OperatorKind { get; } 1409BinaryOperatorKind OperatorKind { get; } 2563BinaryOperatorKind Relation { get; } 2750BinaryOperatorKind OperatorKind { get; } 3269/// Kind of binary pattern; either <see cref="BinaryOperatorKind.And" /> or <see cref="BinaryOperatorKind.Or" />. 3271BinaryOperatorKind OperatorKind { get; } 3323BinaryOperatorKind OperatorKind { get; } 5269internal BinaryOperation(BinaryOperatorKind operatorKind, IOperation leftOperand, IOperation rightOperand, bool isLifted, bool isChecked, bool isCompareText, IMethodSymbol? operatorMethod, ITypeSymbol? constrainedToType, IMethodSymbol? unaryOperatorMethod, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, ConstantValue? constantValue, bool isImplicit) 5284public BinaryOperatorKind OperatorKind { get; } 5933internal CompoundAssignmentOperation(IConvertibleConversion inConversion, IConvertibleConversion outConversion, BinaryOperatorKind operatorKind, bool isLifted, bool isChecked, IMethodSymbol? operatorMethod, ITypeSymbol? constrainedToType, IOperation target, IOperation value, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 5949public BinaryOperatorKind OperatorKind { get; } 7902internal RelationalCaseClauseOperation(IOperation value, BinaryOperatorKind relation, ILabelSymbol? label, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 7909public BinaryOperatorKind Relation { get; } 8219internal TupleBinaryOperation(BinaryOperatorKind operatorKind, IOperation leftOperand, IOperation rightOperand, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 8227public BinaryOperatorKind OperatorKind { get; } 9516internal BinaryPatternOperation(BinaryOperatorKind operatorKind, IPatternOperation leftPattern, IPatternOperation rightPattern, ITypeSymbol inputType, ITypeSymbol narrowedType, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 9523public BinaryOperatorKind OperatorKind { get; } 9598internal RelationalPatternOperation(BinaryOperatorKind operatorKind, IOperation value, ITypeSymbol inputType, ITypeSymbol narrowedType, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 9604public BinaryOperatorKind OperatorKind { get; }
Operations\ControlFlowGraphBuilder.cs (26)
2139case BinaryOperatorKind.ConditionalOr: 2140case BinaryOperatorKind.ConditionalAnd: 2256case BinaryOperatorKind.ConditionalOr: 2260case BinaryOperatorKind.ConditionalAnd: 2522new BinaryOperation(isAndAlso ? BinaryOperatorKind.And : BinaryOperatorKind.Or, 2612new BinaryOperation(isAndAlso ? BinaryOperatorKind.And : BinaryOperatorKind.Or, 4863isUp = new BinaryOperation(BinaryOperatorKind.GreaterThanOrEqual, 4983var comparisonKind = BinaryOperatorKind.None; 4988comparisonKind = BinaryOperatorKind.LessThanOrEqual; 4995comparisonKind = BinaryOperatorKind.GreaterThanOrEqual; 4999comparisonKind = BinaryOperatorKind.LessThanOrEqual; 5006if (comparisonKind == BinaryOperatorKind.None && ITypeSymbolHelpers.IsSignedIntegralType(stepEnumUnderlyingTypeOrSelf)) 5008comparisonKind = BinaryOperatorKind.LessThanOrEqual; 5015if (comparisonKind != BinaryOperatorKind.None) 5054eitherLimitOrControlVariableIsNull = new BinaryOperation(BinaryOperatorKind.Or, 5095condition = new BinaryOperation(BinaryOperatorKind.LessThanOrEqual, 5115condition = new BinaryOperation(BinaryOperatorKind.GreaterThanOrEqual, 5149var shiftedStep = new BinaryOperation(BinaryOperatorKind.RightShift, 5164return new BinaryOperation(BinaryOperatorKind.ExclusiveOr, 5236IOperation condition = new BinaryOperation(BinaryOperatorKind.Or, 5288IOperation increment = new BinaryOperation(BinaryOperatorKind.Add, 5482condition = new BinaryOperation(BinaryOperatorKind.Equals, 5532if (relationalValueClause.Relation == BinaryOperatorKind.Equals)
Microsoft.CodeAnalysis.CodeStyle (13)
AbstractRemoveRedundantEqualityDiagnosticAnalyzer.cs (3)
42if (operation.OperatorKind is not (BinaryOperatorKind.Equals or BinaryOperatorKind.NotEquals)) 66var isOperatorEquals = operation.OperatorKind == BinaryOperatorKind.Equals;
AbstractUseThrowExpressionDiagnosticAnalyzer.cs (1)
221if (binaryOperator.OperatorKind != BinaryOperatorKind.Equals)
HashCodeAnalyzer.OperationDeconstructor.cs (2)
108if (binary.OperatorKind == BinaryOperatorKind.Equals) 114else if (binary.OperatorKind == BinaryOperatorKind.NotEquals)
ISemanticFactsExtensions.cs (4)
86return op.OperatorKind is BinaryOperatorKind.Add or 87BinaryOperatorKind.Subtract or 88BinaryOperatorKind.Multiply or 89BinaryOperatorKind.Divide;
PopulateSwitchExpressionHelpers.cs (3)
67if (binaryPattern?.OperatorKind == BinaryOperatorKind.Or) 99BinaryOperatorKind.Or => IsDefault(binaryPattern.LeftPattern) || IsDefault(binaryPattern.RightPattern), 101BinaryOperatorKind.And => IsDefault(binaryPattern.LeftPattern) && IsDefault(binaryPattern.RightPattern),
Microsoft.CodeAnalysis.CodeStyle.Fixes (48)
SyntaxGeneratorExtensions_Negate.cs (47)
19private static readonly ImmutableDictionary<BinaryOperatorKind, BinaryOperatorKind> s_negatedBinaryMap = 20new Dictionary<BinaryOperatorKind, BinaryOperatorKind> 22{ BinaryOperatorKind.Equals, BinaryOperatorKind.NotEquals }, 23{ BinaryOperatorKind.NotEquals, BinaryOperatorKind.Equals }, 24{ BinaryOperatorKind.LessThan, BinaryOperatorKind.GreaterThanOrEqual }, 25{ BinaryOperatorKind.GreaterThan, BinaryOperatorKind.LessThanOrEqual }, 26{ BinaryOperatorKind.LessThanOrEqual, BinaryOperatorKind.GreaterThan }, 27{ BinaryOperatorKind.GreaterThanOrEqual, BinaryOperatorKind.LessThan }, 28{ BinaryOperatorKind.Or, BinaryOperatorKind.And }, 29{ BinaryOperatorKind.And, BinaryOperatorKind.Or }, 30{ BinaryOperatorKind.ConditionalOr, BinaryOperatorKind.ConditionalAnd }, 31{ BinaryOperatorKind.ConditionalAnd, BinaryOperatorKind.ConditionalOr }, 170if (!s_negatedBinaryMap.TryGetValue(binaryOperation.OperatorKind, out var negatedKind)) 176&& binaryOperation.OperatorKind is BinaryOperatorKind.LessThan or 177BinaryOperatorKind.LessThanOrEqual or 178BinaryOperatorKind.GreaterThan or 179BinaryOperatorKind.GreaterThanOrEqual) 184if (binaryOperation.OperatorKind is BinaryOperatorKind.Or or 185BinaryOperatorKind.And or 186BinaryOperatorKind.ConditionalAnd or 187BinaryOperatorKind.ConditionalOr) 193var newBinaryExpressionSyntax = negatedKind is BinaryOperatorKind.Equals or BinaryOperatorKind.NotEquals 356BinaryOperatorKind operationKind, 361BinaryOperatorKind.LessThanOrEqual => IsSpecialCaseBinaryExpression(binaryOperation, operationKind) 364BinaryOperatorKind.GreaterThanOrEqual => IsSpecialCaseBinaryExpression(binaryOperation, operationKind) 367BinaryOperatorKind.LessThan => generator.LessThanExpression(leftOperand, rightOperand), 368BinaryOperatorKind.GreaterThan => generator.GreaterThanExpression(leftOperand, rightOperand), 369BinaryOperatorKind.Or => generator.BitwiseOrExpression(leftOperand, rightOperand), 370BinaryOperatorKind.And => generator.BitwiseAndExpression(leftOperand, rightOperand), 371BinaryOperatorKind.ConditionalOr => generator.LogicalOrExpression(leftOperand, rightOperand), 372BinaryOperatorKind.ConditionalAnd => generator.LogicalAndExpression(leftOperand, rightOperand), 384BinaryOperatorKind operationKind) 394BinaryOperatorKind.LessThanOrEqual when rightOperand.IsNumericLiteral() 396BinaryOperatorKind.GreaterThanOrEqual when leftOperand.IsNumericLiteral()
SyntaxGeneratorInternal.cs (1)
93public abstract SyntaxNode NegateEquality(SyntaxGenerator generator, SyntaxNode binaryExpression, SyntaxNode left, BinaryOperatorKind negatedKind, SyntaxNode right);
Microsoft.CodeAnalysis.CSharp (30)
Operations\CSharpOperationFactory.cs (9)
1292BinaryOperatorKind operatorKind = Helper.DeriveBinaryOperatorKind(boundCompoundAssignmentOperator.Operator.Kind); 1418BinaryOperatorKind operatorKind = Helper.DeriveBinaryOperatorKind(boundBinaryOperator.OperatorKind); 1442BinaryOperatorKind operatorKind = Helper.DeriveBinaryOperatorKind(boundBinaryOperator.OperatorKind); 1448(operatorKind == BinaryOperatorKind.ConditionalAnd || operatorKind == BinaryOperatorKind.ConditionalOr) && 1498BinaryOperatorKind operatorKind = Helper.DeriveBinaryOperatorKind(boundTupleBinaryOperator.OperatorKind); 2410BinaryOperatorKind operatorKind = Helper.DeriveBinaryOperatorKind(boundRelationalPattern.Relation); 2529boundBinaryPattern.Disjunction ? BinaryOperatorKind.Or : BinaryOperatorKind.And,
Operations\CSharpOperationFactory_Methods.cs (21)
467internal static BinaryOperatorKind DeriveBinaryOperatorKind(CSharp.BinaryOperatorKind operatorKind) 472return BinaryOperatorKind.Add; 475return BinaryOperatorKind.Subtract; 478return BinaryOperatorKind.Multiply; 481return BinaryOperatorKind.Divide; 484return BinaryOperatorKind.Remainder; 487return BinaryOperatorKind.LeftShift; 490return BinaryOperatorKind.RightShift; 493return BinaryOperatorKind.UnsignedRightShift; 496return BinaryOperatorKind.And; 499return BinaryOperatorKind.Or; 502return BinaryOperatorKind.ExclusiveOr; 505return BinaryOperatorKind.LessThan; 508return BinaryOperatorKind.LessThanOrEqual; 511return BinaryOperatorKind.Equals; 514return BinaryOperatorKind.NotEquals; 517return BinaryOperatorKind.GreaterThanOrEqual; 520return BinaryOperatorKind.GreaterThan; 523return BinaryOperatorKind.ConditionalAnd; 526return BinaryOperatorKind.ConditionalOr; 529return BinaryOperatorKind.None;
Microsoft.CodeAnalysis.CSharp.CodeStyle (20)
AnalyzedPattern.cs (12)
106public readonly BinaryOperatorKind OperatorKind; 109public Relational(BinaryOperatorKind operatorKind, ExpressionSyntax value, IOperation target) : base(target) 181private static BinaryOperatorKind Negate(BinaryOperatorKind kind) 185BinaryOperatorKind.LessThan => BinaryOperatorKind.GreaterThanOrEqual, 186BinaryOperatorKind.GreaterThan => BinaryOperatorKind.LessThanOrEqual, 187BinaryOperatorKind.LessThanOrEqual => BinaryOperatorKind.GreaterThan, 188BinaryOperatorKind.GreaterThanOrEqual => BinaryOperatorKind.LessThan,
CastSimplifier.cs (2)
789private static bool ConvertedHasUserDefinedEquals(BinaryOperatorKind operatorKind, IOperation operation) 805var opName = operatorKind == BinaryOperatorKind.Equals
CSharpUsePatternCombinatorsAnalyzer.cs (5)
11using static BinaryOperatorKind; 44case IBinaryOperation { OperatorKind: BinaryOperatorKind.Equals } op: 125private static bool IsRelationalOperator(BinaryOperatorKind operatorKind) 147public static BinaryOperatorKind Flip(BinaryOperatorKind operatorKind)
Helpers.cs (1)
54binaryOperation.OperatorKind == BinaryOperatorKind.Subtract)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (18)
ConvertToRecordHelpers.cs (10)
158OperatorKind: BinaryOperatorKind.Equals, 662var expectedKind = successRequirement 663? BinaryOperatorKind.NotEquals 664: BinaryOperatorKind.Equals; 737(true, IBinaryOperation { OperatorKind: BinaryOperatorKind.ConditionalAnd } andOp) 744(false, IBinaryOperation { OperatorKind: BinaryOperatorKind.ConditionalOr } orOp) 751OperatorKind: BinaryOperatorKind.Equals, 759OperatorKind: BinaryOperatorKind.NotEquals, 803OperatorKind: BinaryOperatorKind.ConditionalAnd, 815OperatorKind: BinaryOperatorKind.ConditionalOr,
CSharpSyntaxGeneratorInternal.cs (3)
137public override SyntaxNode NegateEquality(SyntaxGenerator generator, SyntaxNode binaryExpression, SyntaxNode left, BinaryOperatorKind negatedKind, SyntaxNode right) 140BinaryOperatorKind.Equals => generator.ReferenceEqualsExpression(left, right), 141BinaryOperatorKind.NotEquals => generator.ReferenceNotEqualsExpression(left, right),
CSharpUsePatternCombinatorsCodeFixProvider.cs (5)
42private static SyntaxKind MapToSyntaxKind(BinaryOperatorKind kind) 46BinaryOperatorKind.LessThan => SyntaxKind.LessThanToken, 47BinaryOperatorKind.GreaterThan => SyntaxKind.GreaterThanToken, 48BinaryOperatorKind.LessThanOrEqual => SyntaxKind.LessThanEqualsToken, 49BinaryOperatorKind.GreaterThanOrEqual => SyntaxKind.GreaterThanEqualsToken,
Microsoft.CodeAnalysis.CSharp.Features (39)
AnalyzedPattern.cs (12)
106public readonly BinaryOperatorKind OperatorKind; 109public Relational(BinaryOperatorKind operatorKind, ExpressionSyntax value, IOperation target) : base(target) 181private static BinaryOperatorKind Negate(BinaryOperatorKind kind) 185BinaryOperatorKind.LessThan => BinaryOperatorKind.GreaterThanOrEqual, 186BinaryOperatorKind.GreaterThan => BinaryOperatorKind.LessThanOrEqual, 187BinaryOperatorKind.LessThanOrEqual => BinaryOperatorKind.GreaterThan, 188BinaryOperatorKind.GreaterThanOrEqual => BinaryOperatorKind.LessThan,
ConvertIfToSwitch\CSharpConvertIfToSwitchCodeRefactoringProvider.Rewriting.cs (6)
22private static readonly Dictionary<BinaryOperatorKind, SyntaxKind> s_operatorMap = new Dictionary<BinaryOperatorKind, SyntaxKind> 24{ BinaryOperatorKind.LessThan, SyntaxKind.LessThanToken }, 25{ BinaryOperatorKind.GreaterThan, SyntaxKind.GreaterThanToken }, 26{ BinaryOperatorKind.LessThanOrEqual, SyntaxKind.LessThanEqualsToken }, 27{ BinaryOperatorKind.GreaterThanOrEqual, SyntaxKind.GreaterThanEqualsToken },
ConvertToRecordHelpers.cs (10)
158OperatorKind: BinaryOperatorKind.Equals, 662var expectedKind = successRequirement 663? BinaryOperatorKind.NotEquals 664: BinaryOperatorKind.Equals; 737(true, IBinaryOperation { OperatorKind: BinaryOperatorKind.ConditionalAnd } andOp) 744(false, IBinaryOperation { OperatorKind: BinaryOperatorKind.ConditionalOr } orOp) 751OperatorKind: BinaryOperatorKind.Equals, 759OperatorKind: BinaryOperatorKind.NotEquals, 803OperatorKind: BinaryOperatorKind.ConditionalAnd, 815OperatorKind: BinaryOperatorKind.ConditionalOr,
CSharpUsePatternCombinatorsAnalyzer.cs (5)
11using static BinaryOperatorKind; 44case IBinaryOperation { OperatorKind: BinaryOperatorKind.Equals } op: 125private static bool IsRelationalOperator(BinaryOperatorKind operatorKind) 147public static BinaryOperatorKind Flip(BinaryOperatorKind operatorKind)
CSharpUsePatternCombinatorsCodeFixProvider.cs (5)
42private static SyntaxKind MapToSyntaxKind(BinaryOperatorKind kind) 46BinaryOperatorKind.LessThan => SyntaxKind.LessThanToken, 47BinaryOperatorKind.GreaterThan => SyntaxKind.GreaterThanToken, 48BinaryOperatorKind.LessThanOrEqual => SyntaxKind.LessThanEqualsToken, 49BinaryOperatorKind.GreaterThanOrEqual => SyntaxKind.GreaterThanEqualsToken,
J\s\src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\Helpers.cs\Helpers.cs (1)
54binaryOperation.OperatorKind == BinaryOperatorKind.Subtract)
Microsoft.CodeAnalysis.CSharp.Workspaces (5)
CastSimplifier.cs (2)
789private static bool ConvertedHasUserDefinedEquals(BinaryOperatorKind operatorKind, IOperation operation) 805var opName = operatorKind == BinaryOperatorKind.Equals
CSharpSyntaxGeneratorInternal.cs (3)
137public override SyntaxNode NegateEquality(SyntaxGenerator generator, SyntaxNode binaryExpression, SyntaxNode left, BinaryOperatorKind negatedKind, SyntaxNode right) 140BinaryOperatorKind.Equals => generator.ReferenceEqualsExpression(left, right), 141BinaryOperatorKind.NotEquals => generator.ReferenceNotEqualsExpression(left, right),
Microsoft.CodeAnalysis.Features (16)
AbstractRemoveRedundantEqualityDiagnosticAnalyzer.cs (3)
42if (operation.OperatorKind is not (BinaryOperatorKind.Equals or BinaryOperatorKind.NotEquals)) 66var isOperatorEquals = operation.OperatorKind == BinaryOperatorKind.Equals;
AbstractUseThrowExpressionDiagnosticAnalyzer.cs (1)
221if (binaryOperator.OperatorKind != BinaryOperatorKind.Equals)
ConvertIfToSwitch\AbstractConvertIfToSwitchCodeRefactoringProvider.AnalyzedNodes.cs (2)
101public readonly BinaryOperatorKind OperatorKind; 104public Relational(BinaryOperatorKind operatorKind, TExpressionSyntax value)
ConvertIfToSwitch\AbstractConvertIfToSwitchCodeRefactoringProvider.Analyzer.cs (5)
15using static BinaryOperatorKind; 277case IBinaryOperation { OperatorKind: BinaryOperatorKind.Equals } op: 407private static BinaryOperatorKind Flip(BinaryOperatorKind operatorKind) 420private static bool IsRelationalOperator(BinaryOperatorKind operatorKind)
HashCodeAnalyzer.OperationDeconstructor.cs (2)
108if (binary.OperatorKind == BinaryOperatorKind.Equals) 114else if (binary.OperatorKind == BinaryOperatorKind.NotEquals)
PopulateSwitchExpressionHelpers.cs (3)
67if (binaryPattern?.OperatorKind == BinaryOperatorKind.Or) 99BinaryOperatorKind.Or => IsDefault(binaryPattern.LeftPattern) || IsDefault(binaryPattern.RightPattern), 101BinaryOperatorKind.And => IsDefault(binaryPattern.LeftPattern) && IsDefault(binaryPattern.RightPattern),
Microsoft.CodeAnalysis.Test.Utilities (45)
Compilation\ControlFlowGraphVerifier.cs (6)
985(binOp.OperatorKind == Operations.BinaryOperatorKind.And || binOp.OperatorKind == Operations.BinaryOperatorKind.Or) && 1011binOp.OperatorKind == Operations.BinaryOperatorKind.And && 1018binOp.OperatorKind == Operations.BinaryOperatorKind.Or && 1901return (binary.OperatorKind != Operations.BinaryOperatorKind.ConditionalAnd && binary.OperatorKind != Operations.BinaryOperatorKind.ConditionalOr) ||
Compilation\OperationTreeVerifier.cs (6)
1181var kindStr = $"{nameof(BinaryOperatorKind)}.{operation.OperatorKind}"; 1209var kindStr = $"{nameof(BinaryOperatorKind)}.{operation.OperatorKind}"; 1655var kindStr = $"{nameof(BinaryOperatorKind)}.{operation.OperatorKind}"; 1808var kindStr = $"{nameof(BinaryOperatorKind)}.{operation.Relation}"; 1928LogString($" ({nameof(BinaryOperatorKind)}.{operation.OperatorKind})"); 1943LogString($" ({nameof(BinaryOperatorKind)}.{operation.OperatorKind})");
Compilation\TestOperationVisitor.cs (14)
230var relation = operation.Relation; 748var binaryOperationKind = operation.OperatorKind; 754if (binaryOperationKind is BinaryOperatorKind.ConditionalAnd or BinaryOperatorKind.ConditionalOr) 815var binaryOperationKind = operation.OperatorKind; 1154var binaryOperationKind = operation.OperatorKind; 1357Assert.True(operation.OperatorKind is Operations.BinaryOperatorKind.LessThan or 1358Operations.BinaryOperatorKind.LessThanOrEqual or 1359Operations.BinaryOperatorKind.GreaterThan or 1360Operations.BinaryOperatorKind.GreaterThanOrEqual or 1361Operations.BinaryOperatorKind.Equals or // Error cases 1362Operations.BinaryOperatorKind.NotEquals); 1371Assert.True(operation.OperatorKind switch { Operations.BinaryOperatorKind.Or => true, Operations.BinaryOperatorKind.And => true, _ => false });
Diagnostics\OperationTestAnalyzer.cs (19)
190BinaryOperatorKind? advanceOperationCode; 196if (advanceOperationCode.Value == BinaryOperatorKind.Subtract) 198advanceOperationCode = BinaryOperatorKind.Add; 202if (advanceOperationCode.Value == BinaryOperatorKind.Add && 204(condition.OperatorKind == BinaryOperatorKind.LessThan || 205condition.OperatorKind == BinaryOperatorKind.LessThanOrEqual || 206condition.OperatorKind == BinaryOperatorKind.NotEquals || 207condition.OperatorKind == BinaryOperatorKind.GreaterThan || 208condition.OperatorKind == BinaryOperatorKind.GreaterThanOrEqual)) 229out BinaryOperatorKind? advanceOperationCode, out Optional<object> advanceIncrementOpt) 281advanceOperationCode = BinaryOperatorKind.Add; 407case BinaryOperatorKind.Equals: 411case BinaryOperatorKind.NotEquals: 413case BinaryOperatorKind.LessThan: 417case BinaryOperatorKind.LessThanOrEqual: 421case BinaryOperatorKind.GreaterThanOrEqual: 425case BinaryOperatorKind.GreaterThan: 1516if (binary.OperatorKind == BinaryOperatorKind.Add && binary.OperatorMethod != null && binary.OperatorMethod.Name.Contains("Addition")) 1521if (binary.OperatorKind == BinaryOperatorKind.Multiply && binary.Type.SpecialType == SpecialType.System_Double)
Microsoft.CodeAnalysis.VisualBasic (36)
Operations\VisualBasicOperationFactory.vb (6)
626Dim operatorKind As BinaryOperatorKind = If(binaryOperatorInfo.OperatorKind = BinaryOperatorKind.And, BinaryOperatorKind.ConditionalAnd, BinaryOperatorKind.ConditionalOr) 1134Dim relation As BinaryOperatorKind = If(valueExpression IsNot Nothing, Helper.DeriveBinaryOperatorKind(boundRelationalCaseClause.OperatorKind, leftOpt:=Nothing), BinaryOperatorKind.None)
Operations\VisualBasicOperationFactory_Methods.vb (30)
102binaryOperatorKind As BinaryOperatorKind, 118Public ReadOnly OperatorKind As BinaryOperatorKind 633Friend Shared Function DeriveBinaryOperatorKind(operatorKind As VisualBasic.BinaryOperatorKind, leftOpt As BoundExpression) As BinaryOperatorKind 636Return BinaryOperatorKind.Add 638Return BinaryOperatorKind.Subtract 640Return BinaryOperatorKind.Multiply 642Return BinaryOperatorKind.Divide 644Return BinaryOperatorKind.IntegerDivide 646Return BinaryOperatorKind.Remainder 648Return BinaryOperatorKind.And 650Return BinaryOperatorKind.Or 652Return BinaryOperatorKind.ExclusiveOr 654Return BinaryOperatorKind.ConditionalAnd 656Return BinaryOperatorKind.ConditionalOr 658Return BinaryOperatorKind.LeftShift 660Return BinaryOperatorKind.RightShift 662Return BinaryOperatorKind.LessThan 664Return BinaryOperatorKind.LessThanOrEqual 666Return If(leftOpt?.Type?.SpecialType = SpecialType.System_Object, BinaryOperatorKind.ObjectValueEquals, BinaryOperatorKind.Equals) 668Return If(leftOpt?.Type?.SpecialType = SpecialType.System_Object, BinaryOperatorKind.ObjectValueNotEquals, BinaryOperatorKind.NotEquals) 670Return BinaryOperatorKind.Equals 672Return BinaryOperatorKind.NotEquals 674Return BinaryOperatorKind.GreaterThanOrEqual 676Return BinaryOperatorKind.GreaterThan 678Return BinaryOperatorKind.Power 680Return BinaryOperatorKind.Like 682Return BinaryOperatorKind.Concatenate 684Return BinaryOperatorKind.None
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (3)
VisualBasicSyntaxGeneratorInternal.vb (3)
130Public Overrides Function NegateEquality(generator As SyntaxGenerator, node As SyntaxNode, left As SyntaxNode, negatedKind As Operations.BinaryOperatorKind, right As SyntaxNode) As SyntaxNode 132Case BinaryOperatorKind.Equals 136Case BinaryOperatorKind.NotEquals
Microsoft.CodeAnalysis.VisualBasic.Features (7)
ConvertIfToSwitch\VisualBasicConvertIfToSwitchCodeRefactoringProvider.Rewriting.vb (7)
12Private Shared ReadOnly s_operatorMap As Dictionary(Of BinaryOperatorKind, (CaseClauseKind As SyntaxKind, OperatorTokenKind As SyntaxKind)) = 13New Dictionary(Of BinaryOperatorKind, (SyntaxKind, SyntaxKind))() From 15{BinaryOperatorKind.NotEquals, (SyntaxKind.CaseNotEqualsClause, SyntaxKind.LessThanGreaterThanToken)}, 16{BinaryOperatorKind.LessThan, (SyntaxKind.CaseLessThanClause, SyntaxKind.LessThanToken)}, 17{BinaryOperatorKind.GreaterThan, (SyntaxKind.CaseGreaterThanClause, SyntaxKind.GreaterThanToken)}, 18{BinaryOperatorKind.LessThanOrEqual, (SyntaxKind.CaseLessThanOrEqualClause, SyntaxKind.LessThanEqualsToken)}, 19{BinaryOperatorKind.GreaterThanOrEqual, (SyntaxKind.CaseGreaterThanOrEqualClause, SyntaxKind.GreaterThanEqualsToken)}
Microsoft.CodeAnalysis.VisualBasic.Workspaces (3)
VisualBasicSyntaxGeneratorInternal.vb (3)
130Public Overrides Function NegateEquality(generator As SyntaxGenerator, node As SyntaxNode, left As SyntaxNode, negatedKind As Operations.BinaryOperatorKind, right As SyntaxNode) As SyntaxNode 132Case BinaryOperatorKind.Equals 136Case BinaryOperatorKind.NotEquals
Microsoft.CodeAnalysis.Workspaces (52)
ISemanticFactsExtensions.cs (4)
86return op.OperatorKind is BinaryOperatorKind.Add or 87BinaryOperatorKind.Subtract or 88BinaryOperatorKind.Multiply or 89BinaryOperatorKind.Divide;
SyntaxGeneratorExtensions_Negate.cs (47)
19private static readonly ImmutableDictionary<BinaryOperatorKind, BinaryOperatorKind> s_negatedBinaryMap = 20new Dictionary<BinaryOperatorKind, BinaryOperatorKind> 22{ BinaryOperatorKind.Equals, BinaryOperatorKind.NotEquals }, 23{ BinaryOperatorKind.NotEquals, BinaryOperatorKind.Equals }, 24{ BinaryOperatorKind.LessThan, BinaryOperatorKind.GreaterThanOrEqual }, 25{ BinaryOperatorKind.GreaterThan, BinaryOperatorKind.LessThanOrEqual }, 26{ BinaryOperatorKind.LessThanOrEqual, BinaryOperatorKind.GreaterThan }, 27{ BinaryOperatorKind.GreaterThanOrEqual, BinaryOperatorKind.LessThan }, 28{ BinaryOperatorKind.Or, BinaryOperatorKind.And }, 29{ BinaryOperatorKind.And, BinaryOperatorKind.Or }, 30{ BinaryOperatorKind.ConditionalOr, BinaryOperatorKind.ConditionalAnd }, 31{ BinaryOperatorKind.ConditionalAnd, BinaryOperatorKind.ConditionalOr }, 170if (!s_negatedBinaryMap.TryGetValue(binaryOperation.OperatorKind, out var negatedKind)) 176&& binaryOperation.OperatorKind is BinaryOperatorKind.LessThan or 177BinaryOperatorKind.LessThanOrEqual or 178BinaryOperatorKind.GreaterThan or 179BinaryOperatorKind.GreaterThanOrEqual) 184if (binaryOperation.OperatorKind is BinaryOperatorKind.Or or 185BinaryOperatorKind.And or 186BinaryOperatorKind.ConditionalAnd or 187BinaryOperatorKind.ConditionalOr) 193var newBinaryExpressionSyntax = negatedKind is BinaryOperatorKind.Equals or BinaryOperatorKind.NotEquals 356BinaryOperatorKind operationKind, 361BinaryOperatorKind.LessThanOrEqual => IsSpecialCaseBinaryExpression(binaryOperation, operationKind) 364BinaryOperatorKind.GreaterThanOrEqual => IsSpecialCaseBinaryExpression(binaryOperation, operationKind) 367BinaryOperatorKind.LessThan => generator.LessThanExpression(leftOperand, rightOperand), 368BinaryOperatorKind.GreaterThan => generator.GreaterThanExpression(leftOperand, rightOperand), 369BinaryOperatorKind.Or => generator.BitwiseOrExpression(leftOperand, rightOperand), 370BinaryOperatorKind.And => generator.BitwiseAndExpression(leftOperand, rightOperand), 371BinaryOperatorKind.ConditionalOr => generator.LogicalOrExpression(leftOperand, rightOperand), 372BinaryOperatorKind.ConditionalAnd => generator.LogicalAndExpression(leftOperand, rightOperand), 384BinaryOperatorKind operationKind) 394BinaryOperatorKind.LessThanOrEqual when rightOperand.IsNumericLiteral() 396BinaryOperatorKind.GreaterThanOrEqual when leftOperand.IsNumericLiteral()
SyntaxGeneratorInternal.cs (1)
93public abstract SyntaxNode NegateEquality(SyntaxGenerator generator, SyntaxNode binaryExpression, SyntaxNode left, BinaryOperatorKind negatedKind, SyntaxNode right);
Roslyn.Compilers.VisualBasic.IOperation.UnitTests (4)
IOperation\IOperationTests.vb (4)
67Assert.Equal(add1.OperatorKind, Operations.BinaryOperatorKind.Add) 100Assert.Equal(add2.OperatorKind, Operations.BinaryOperatorKind.Add) 196Assert.Equal(assignment1.OperatorKind, Operations.BinaryOperatorKind.Add) 224Assert.Equal(assignment2.OperatorKind, Operations.BinaryOperatorKind.Add)