//General Test F. Type a very long class name, verify colorization happens correctly only upto the correct size (118324)
class TestClassXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/*Scen8*/{ }
class TestClassXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX22/*Scen9*/{ }
class yield
{
void Foo<U>(__arglist)
{
C<U> c = null;
c.M<int>(5, default(U));
TypedReference tr = __makeref(c);
Type t = __reftype(tr);
int j = __refvalue(tr, int);
Params(a: t, b: t);
Params(ref c, out c);
}
void Params(ref dynamic a, out dynamic b, params dynamic[] c) {}
void Params(out dynamic a = 2, ref dynamic c = default(dynamic), params dynamic[][] c) {}
public override string ToString() { return base.ToString(); }
public partial void OnError();
public partial void method()
{
int?[] a = new int?[5];/*[] bug*/ // YES []
int[] var = { 1, 2, 3, 4, 5 };/*,;*/
int i = a[i];/*[]*/
Foo<T> f = new Foo<int>();/*<> ()*/
f.method();/*().*/
i = i + i - i * i / i % i & i | i ^ i;/*+ - * / % & | ^*/
bool b = true & false | true ^ false;/*& | ^*/
b = !b;/*!*/
i = ~i;/*~i*/
b = i < i && i > i;/*<&&>*/
int? ii = 5;/*? bug*/ // NO ?
int f = true ? 1 : 0;/*? :*/ // YES :
i++;/*++*/
i--;/*--*/
b = true && false || true;/*&& ||*/
i << 5;/*<<*/
i >> 5;/*>>*/
b = i == i && i != i && i <= i && i >= i;/*= == && != <= >=*/
i += 5.0;/*+=*/
i -= i;/*-=*/
i *= i;/**=*/
i /= i;/*/=*/
i %= i;/*%=*/
i &= i;/*&=*/
i |= i;/*|=*/
i ^= i;/*^=*/
i <<= i;/*<<=*/
i >>= i;/*>>=*/
object s = x => x + 1;/*=>*/
Point point;
unsafe
{
Point* p = &point;/** &*/
p->x = 10;/*->*/
}
IO::BinaryReader br = null;
}
struct Point { public int X; public int Y; public void ThisAccess() { this = this; } }
<Module:System.Copyright(vbLf & vbTab & ChrW(&H123).ToString() & "(C) 2009" & ChrW(&H123).ToString())>
Friend Interface CoContra(Of Out T, In K)
End Interface
Public Delegate Sub CoContra2()
Namespace My
Friend Interface CoContra(Of Out T, In K)
End Interface
Friend Delegate Sub CoContra2(Of Out T, In K)()
Partial Public Class A
Inherits CSType1
Implements I
Shared Sub New()
End Sub
<Obsolete()>
Public Sub New(<Obsolete()> ByVal foo As Integer)
MyBase.New(1)
L:
Dim i As Integer = Len(New Integer)
i += 1
#If DEBUG Then
Console.WriteLine(export.iefSupplied.command)
#End If
Const local? As Integer = Integer.MaxValue
Const local0? As Guid = New Guid(r.ToString())
'Inserted Compiling code
Dim r As Integer
Dim Varioblelocal? As Integer = Integer.MaxValue
Dim Varioblelocal0? As Guid = New Guid(r.ToString())
Dim привет = local
Dim мир = local
Dim local3 = 0, local4 = 1
Dim local5 = If(TryCast(Nothing, Action), Nothing)
Dim local6 = TypeOf local5 Is Action
Dim u = 1UI
Dim U_Renamed = 1UI
Dim hex As Long = &HBADC0DE, Hex_Renamed As Long = &HDEADBEEFL, l As Long = -1L, L_Renamed As Long = 1L
Dim ul As ULong = 1UL, Ul_Renamed As ULong = 1UL, uL_Renamed2 As ULong = 1UL, UL_Renamed3 As ULong = 1UL, lu As ULong = 1UL, Lu_Renamed1 As ULong = 1UL, lU_Renamed2 As ULong = 1UL, LU_Renamed3 As ULong = 1UL
Dim o4 = New MyObject(dynamic) With {.A = 0, .B = 0, .C = 0}
Dim o5 = New With {Key .A = 0}
Dim a() As Integer = {0, 1, 2, 3, 4, 5}
Select Case i
Case 1
GoTo CaseLabel1
Case 2
CaseLabel1:
GoTo CaseLabel2
Exit Select
Case Else
CaseLabel2:
Return
End Select
Do While i < 10
i += 1
Loop
Do
i += 1
Loop While i < 10
Do
i += 1
Loop Until i > 20
Do
Exit Do
Loop
For j As Integer = 0 To 99
Console.WriteLine(j)
Next j
'Modified to include items
Dim items = {1, 2, 3, 4, 5, 6, 7, 8}
For Each i In items
If i = 7 Then
Return
Else
Continue For
End If
Next i
' There is no equivalent to a 'checked' block in VB.NET
' checked
i += 1
'Modified use of synclock functions for VB
Dim sText As String
Dim objLock As Object = New Object()
SyncLock objLock
sText = "Hello"
End SyncLock
Using v = BeginScope()
Using a As New A()
Using BeginScope()
Return
End Using
End Using
End Using
' VB does not support iterators and has no equivalent to the C# 'yield' keyword:
'yield Return Me.items(i)
' VB does not support iterators and has no equivalent to the C# 'yield' keyword:
'yield(break)
' There is no equivalent to a 'fixed' block in VB.NET
'Integer* p = Nothing
Try
Throw New Exception 'Nothing
Catch av As System.AccessViolationException
Throw av
Catch e1 As Exception
Throw
Finally
End Try
Dim anonymous = New With {.a = 1, .B = 2, .c = 3}
Dim qry = From i1 In {1, 2, 3, 4, 5, 6} Where i1 < 5 Select New With {.id = i1}
Dim query = From c In customers Let d = c Where d IsNot Nothing Join c1 In customers On c1.GetHashCode() Equals c.GetHashCode() Group Join c1 In customers On c1.GetHashCode() Equals c.GetHashCode() Into e() Order By g.Count() Ascending Order By g.Key Descending Select New With {.Country = g.Key, .CustCount = g.Count()}
'XML Literals
Dim x = <xmlliteral><test name="test"/><test name="test2"></test></xmlliteral>
Friend Class TestClassXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 'Scen8
End Class
Friend Class TestClass1XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX22 'Scen9
End Class
Friend Class yield
''INSTANT VB TODO TASK: There is no equivalent to the undocumented C# '__arglist' keyword in VB:
'Private Sub Foo(Of U)(ByVal __arglist)
' Dim c1 As C(Of U) = Nothing
' c1.M(Of Integer)(5, Nothing)
' Dim tr As TypedReference = __makeref(c1)
' Dim t As Type = __reftype(tr)
' Dim j As Integer = __refvalue(tr, Integer)
' Params(a:=t, b:=t)
'End Sub
Private Sub Params(ByRef a As Object, <System.Runtime.InteropServices.Out()> ByRef b As Object, ByVal ParamArray c() As Object)
End Sub
'Private Sub Params(Optional <System.Runtime.InteropServices.Out()> ByRef a As dynamic = 2, Optional ByRef c As dynamic = Nothing, ParamArray ByVal c()() As dynamic)
'End Sub
Public Overrides Function ToString() As String
Return MyBase.ToString()
End Function
Public Sub method()
Dim a?(4) As Integer '[] bug
' YES []
Dim var() As Integer = {1, 2, 3, 4, 5} ',;
Dim i As Integer = a(i) '[]
Dim f As New Foo(Of T)() '<> ()
f.method()
i = i + i - i * i \ i Mod i And i Or i Xor i '+ - * / % & | ^
Dim b As Boolean = True And False Or True Xor False '& | ^
b = Not b '!
i = Not i '~i
b = i < i AndAlso i > i '<&&>
Dim ii? As Integer = 5 '? bug
' NO ?
Dim f1 As Integer = If(True, 1, 0) '? :
' YES :
i += 1 '++
i -= 1 '--
b = True AndAlso False OrElse True '&& ||
i = i << 5 '<<
i = i >> 5 '>>
b = i = i AndAlso i <> i AndAlso i <= i AndAlso i >= i '= == && != <= >=
i += 5.0 '+=
i -= i '-=
i *= i '*=
i \= i '/
'=
i = i Mod i '%=
i = i And i '&=
i = i Or i '|=
i = i Xor i '^=
i <<= i '<<=
i >>= i '>>=
Dim s As Object = Function(x) x + 1 '=>
' There is no equivalent to an 'unsafe' block in VB.NET
' unsafe
' Point* p = &point '* &
' p->x = 10 '->
Dim p As Point
p.X = 10
p.Y = 12
Dim p2 As New Point With {.X = 10, .Y = 12}
Dim br As IO.BinaryReader = Nothing
End Sub
Friend Structure Point
Public X As Integer
Public Y As Integer
End Structure
End Class
'Extension Method
Module Module1
<Runtime.CompilerServices.Extension()>
Function FooExtension(ByVal x As String) As String
Return x & "test"
End Function
<Runtime.CompilerServices.Extension()>
Function FooExtension(ByVal x As String, ByVal y As Integer) As String
'With Implicit Line Continuation
Return x & "test2"
End Function
Sub Foo()
'Collections
Dim i As New List(Of String) From {"test", "item"}
Dim i1 As New Dictionary(Of Integer, String) From {{1, "test"}, {2, "item"}}
<Module: System.Copyright(vbLf & vbTab & ChrW(&H123).ToString() & "(C) 2009" & ChrW(&H123).ToString())>
Friend Interface CoContra(Of Out T, In K)
End Interface
Public Delegate Sub CoContra2()
Namespace My
Friend Interface CoContra(Of Out T, In K)
End Interface
Friend Delegate Sub CoContra2(Of Out T, In K)()
Partial Public Class A
Inherits CSType1
Implements I
Shared Sub New()
End Sub
<Obsolete()>
Public Sub New(<Obsolete()> ByVal foo As Integer)
MyBase.New(1)
L:
Dim i As Integer = Len(New Integer)
i += 1
#If DEBUG Then
Console.WriteLine(export.iefSupplied.command)
#End If
Const local? As Integer = Integer.MaxValue
Const local0? As Guid = New Guid(r.ToString())
'Inserted Compiling code
Dim r As Integer
Dim Varioblelocal? As Integer = Integer.MaxValue
Dim Varioblelocal0? As Guid = New Guid(r.ToString())
Dim привет = local
Dim мир = local
Dim local3 = 0, local4 = 1
Dim local5 = If(TryCast(Nothing, Action), Nothing)
Dim local6 = TypeOf local5 Is Action
Dim u = 1UI
Dim U_Renamed = 1UI
Dim hex As Long = &HBADC0DE, Hex_Renamed As Long = &HDEADBEEFL, l As Long = -1L, L_Renamed As Long = 1L
Dim ul As ULong = 1UL, Ul_Renamed As ULong = 1UL, uL_Renamed2 As ULong = 1UL, UL_Renamed3 As ULong = 1UL, lu As ULong = 1UL, Lu_Renamed1 As ULong = 1UL, lU_Renamed2 As ULong = 1UL, LU_Renamed3 As ULong = 1UL
Friend Class TestClassXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 'Scen8
End Class
Friend Class TestClass1XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX22 'Scen9
End Class
Friend Class yield
''INSTANT VB TODO TASK: There is no equivalent to the undocumented C# '__arglist' keyword in VB:
'Private Sub Foo(Of U)(ByVal __arglist)
' Dim c1 As C(Of U) = Nothing
' c1.M(Of Integer)(5, Nothing)
' Dim tr As TypedReference = __makeref(c1)
' Dim t As Type = __reftype(tr)
' Dim j As Integer = __refvalue(tr, Integer)
' Params(a:=t, b:=t)
'End Sub
Private Sub Params(ByRef a As Object, <System.Runtime.InteropServices.Out()> ByRef b As Object, ByVal ParamArray c() As Object)
End Sub
'Private Sub Params(Optional <System.Runtime.InteropServices.Out()> ByRef a As dynamic = 2, Optional ByRef c As dynamic = Nothing, ParamArray ByVal c()() As dynamic)
'End Sub
Public Overrides Function ToString() As String
Return MyBase.ToString()
End Function
Public Sub method()
Dim a?(4) As Integer '[] bug
' YES []
Dim var() As Integer = {1, 2, 3, 4, 5} ',;
Dim i As Integer = a(i) '[]
Dim f As New Foo(Of T)() '<> ()
f.method()
i = i + i - i * i \ i Mod i And i Or i Xor i '+ - * / % & | ^
Dim b As Boolean = True And False Or True Xor False '& | ^
b = Not b '!
i = Not i '~i
b = i < i AndAlso i > i '<&&>
Dim ii? As Integer = 5 '? bug
' NO ?
Dim f1 As Integer = If(True, 1, 0) '? :
' YES :
i += 1 '++
i -= 1 '--
b = True AndAlso False OrElse True '&& ||
i = i << 5 '<<
i = i >> 5 '>>
b = i = i AndAlso i <> i AndAlso i <= i AndAlso i >= i '= == && != <= >=
i += 5.0 '+=
i -= i '-=
i *= i '*=
i \= i '/
'=
i = i Mod i '%=
i = i And i '&=
i = i Or i '|=
i = i Xor i '^=
i <<= i '<<=
i >>= i '>>=
Dim s As Object = Function(x) x + 1 '=>
' There is no equivalent to an 'unsafe' block in VB.NET
' unsafe
' Point* p = &point '* &
' p->x = 10 '->
Dim p As Point
p.X = 10
p.Y = 12
Dim p2 As New Point With {.X = 10, .Y = 12}
Dim br As IO.BinaryReader = Nothing
End Sub
Friend Structure Point
Public X As Integer
Public Y As Integer
End Structure
End Class
'Extension Method
Module Module1
<Runtime.CompilerServices.Extension()> Function FooExtension(ByVal x As String) As String
Return x & "test"
End Function
<Runtime.CompilerServices.Extension()> Function FooExtension(ByVal x As String,
ByVal y As Integer) As String
'With Implicit Line Continuation
Return x & "test2"
End Function
Sub Foo()
'Collections
Dim i As New List(Of String) From {"test", "item"}
Dim i1 As New Dictionary(Of Integer, String) From {{1, "test"}, {2, "item"}}