Browse Source

Fixed output of enum members and the "const" modifier.

pull/10/head
Daniel Grunwald 15 years ago
parent
commit
4b21238342
  1. 1
      NRefactory/ICSharpCode.NRefactory/CSharp/Ast/CSharpModifierToken.cs
  2. 18
      NRefactory/ICSharpCode.NRefactory/CSharp/OutputVisitor/OutputVisitor.cs

1
NRefactory/ICSharpCode.NRefactory/CSharp/Ast/CSharpModifierToken.cs

@ -58,6 +58,7 @@ namespace ICSharpCode.NRefactory.CSharp @@ -58,6 +58,7 @@ namespace ICSharpCode.NRefactory.CSharp
{ Modifiers.Volatile, "volatile".Length },
{ Modifiers.Extern, "extern".Length },
{ Modifiers.Partial, "partial".Length },
{ Modifiers.Const, "const".Length },
};
public static ICollection<Modifiers> AllModifiers {

18
NRefactory/ICSharpCode.NRefactory/CSharp/OutputVisitor/OutputVisitor.cs

@ -1157,8 +1157,22 @@ namespace ICSharpCode.NRefactory.CSharp @@ -1157,8 +1157,22 @@ namespace ICSharpCode.NRefactory.CSharp
constraint.AcceptVisitor(this, data);
}
OpenBrace(braceStyle);
foreach (var member in typeDeclaration.Members) {
member.AcceptVisitor(this, data);
if (typeDeclaration.ClassType == ClassType.Enum) {
bool first = true;
foreach (var member in typeDeclaration.Members) {
if (first) {
first = false;
} else {
Comma(member);
NewLine();
}
member.AcceptVisitor(this, data);
}
NewLine();
} else {
foreach (var member in typeDeclaration.Members) {
member.AcceptVisitor(this, data);
}
}
CloseBrace(braceStyle);
NewLine();

Loading…
Cancel
Save