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

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

@ -482,5 +482,20 @@ End Using");
" .Encoding = Encoding.UTF8 _\n" + " .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