Browse Source

Fixed forum-10436: bugs in VBNetOutputVisitor.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/3.0@5430 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
pull/1/head
Daniel Grunwald 16 years ago
parent
commit
80fb379076
  1. 28
      src/Libraries/NRefactory/Project/Src/PrettyPrinter/VBNet/VBNetOutputVisitor.cs
  2. 15
      src/Libraries/NRefactory/Test/Output/VBNet/VBNetOutputTest.cs

28
src/Libraries/NRefactory/Project/Src/PrettyPrinter/VBNet/VBNetOutputVisitor.cs

@ -459,18 +459,18 @@ namespace ICSharpCode.NRefactory.PrettyPrinter @@ -459,18 +459,18 @@ namespace ICSharpCode.NRefactory.PrettyPrinter
switch (optionDeclaration.OptionType) {
case OptionType.Strict:
outputFormatter.PrintToken(Tokens.Strict);
if (!optionDeclaration.OptionValue) {
outputFormatter.Space();
outputFormatter.PrintToken(Tokens.Off);
}
outputFormatter.Space();
outputFormatter.PrintToken(optionDeclaration.OptionValue ? Tokens.On : Tokens.Off);
break;
case OptionType.Explicit:
outputFormatter.PrintToken(Tokens.Explicit);
outputFormatter.Space();
if (!optionDeclaration.OptionValue) {
outputFormatter.Space();
outputFormatter.PrintToken(Tokens.Off);
}
outputFormatter.PrintToken(optionDeclaration.OptionValue ? Tokens.On : Tokens.Off);
break;
case OptionType.Infer:
outputFormatter.PrintToken(Tokens.Infer);
outputFormatter.Space();
outputFormatter.PrintToken(optionDeclaration.OptionValue ? Tokens.On : Tokens.Off);
break;
case OptionType.CompareBinary:
outputFormatter.PrintToken(Tokens.Compare);
@ -658,11 +658,13 @@ namespace ICSharpCode.NRefactory.PrettyPrinter @@ -658,11 +658,13 @@ namespace ICSharpCode.NRefactory.PrettyPrinter
this.AppendCommaSeparatedList(eventDeclaration.Parameters);
outputFormatter.PrintToken(Tokens.CloseParenthesis);
}
outputFormatter.Space();
outputFormatter.PrintToken(Tokens.As);
outputFormatter.Space();
VisitReturnTypeAttributes(eventDeclaration.Attributes, data);
TrackedVisit(eventDeclaration.TypeReference, data);
if (!eventDeclaration.TypeReference.IsNull) {
outputFormatter.Space();
outputFormatter.PrintToken(Tokens.As);
outputFormatter.Space();
VisitReturnTypeAttributes(eventDeclaration.Attributes, data);
TrackedVisit(eventDeclaration.TypeReference, data);
}
PrintInterfaceImplementations(eventDeclaration.InterfaceImplementations);

15
src/Libraries/NRefactory/Test/Output/VBNet/VBNetOutputTest.cs

@ -482,5 +482,20 @@ End Using"); @@ -482,5 +482,20 @@ End Using");
" .Encoding = Encoding.UTF8 _\n" +
"}");
}
[Test]
public void EventDefinition()
{
TestTypeMember("Public Event MyEvent(ByVal sender As Object)");
}
[Test]
public void Options()
{
TestProgram("Option Strict On\n" +
"Option Explicit On\n" +
"Option Infer On\n" +
"Option Compare Text");
}
}
}

Loading…
Cancel
Save