VB -> C#: Support LeftShiftAssignment, RightShiftAssignment
This commit is contained in:
Родитель
9ef202fa2d
Коммит
fdd42d7ad6
|
@ -378,6 +378,10 @@ namespace ICSharpCode.CodeConverter.CSharp
|
|||
return SyntaxKind.MultiplyAssignmentExpression;
|
||||
case VBasic.SyntaxKind.DivideAssignmentStatement:
|
||||
return SyntaxKind.DivideAssignmentExpression;
|
||||
case VBasic.SyntaxKind.LeftShiftAssignmentStatement:
|
||||
return SyntaxKind.LeftShiftAssignmentExpression;
|
||||
case VBasic.SyntaxKind.RightShiftAssignmentStatement:
|
||||
return SyntaxKind.RightShiftAssignmentExpression;
|
||||
// Casts
|
||||
case VBasic.SyntaxKind.CObjKeyword:
|
||||
return SyntaxKind.ObjectKeyword;
|
||||
|
|
|
@ -109,6 +109,10 @@ namespace ICSharpCode.CodeConverter.Util
|
|||
return SyntaxKind.PlusEqualsToken;
|
||||
case SyntaxKind.SubtractAssignmentExpression:
|
||||
return SyntaxKind.MinusEqualsToken;
|
||||
case SyntaxKind.LeftShiftAssignmentExpression:
|
||||
return SyntaxKind.LessThanLessThanEqualsToken;
|
||||
case SyntaxKind.RightShiftAssignmentExpression:
|
||||
return SyntaxKind.GreaterThanGreaterThanEqualsToken;
|
||||
// unary
|
||||
case SyntaxKind.UnaryPlusExpression:
|
||||
return SyntaxKind.PlusToken;
|
||||
|
|
|
@ -60,6 +60,31 @@ End Class", @"class TestClass
|
|||
}");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ShiftAssignment()
|
||||
{
|
||||
TestConversionVisualBasicToCSharp(@"Class TestClass
|
||||
Private Sub TestMethod()
|
||||
Dim x = 1
|
||||
x <<= 4
|
||||
x >>= 3
|
||||
End Sub
|
||||
End Class", @"using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.VisualBasic;
|
||||
|
||||
class TestClass
|
||||
{
|
||||
private void TestMethod()
|
||||
{
|
||||
var x = 1;
|
||||
x <<= 4;
|
||||
x >>= 3;
|
||||
}
|
||||
}");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void FullyTypeInferredEnumerableCreation()
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче