From a2a077fc0e9f6faddf28030fe06f1342f133068c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20Kr=C3=BCger?= Date: Sun, 4 Sep 2011 15:31:37 +0200 Subject: [PATCH] added enum member assign token & case label colon token. --- ICSharpCode.NRefactory.CSharp/Parser/CSharpParser.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ICSharpCode.NRefactory.CSharp/Parser/CSharpParser.cs b/ICSharpCode.NRefactory.CSharp/Parser/CSharpParser.cs index 19ee45aaf7..481ec8f0ce 100644 --- a/ICSharpCode.NRefactory.CSharp/Parser/CSharpParser.cs +++ b/ICSharpCode.NRefactory.CSharp/Parser/CSharpParser.cs @@ -605,6 +605,7 @@ namespace ICSharpCode.NRefactory.CSharp newField.AddChild (Identifier.Create (em.Name, Convert (em.Location)), AstNode.Roles.Identifier); if (em.Initializer != null) { + newField.AddChild (new CSharpTokenNode (Convert (em.Initializer.Location), 1), EnumMemberDeclaration.Roles.Assign); newField.AddChild ((Expression)em.Initializer.Accept (this), EnumMemberDeclaration.InitializerRole); } @@ -1618,7 +1619,9 @@ namespace ICSharpCode.NRefactory.CSharp newLabel.AddChild (new CSharpTokenNode (Convert (caseLabel.Location), "case".Length), SwitchStatement.Roles.Keyword); if (caseLabel.Label != null) newLabel.AddChild ((Expression)caseLabel.Label.Accept (this), SwitchStatement.Roles.Expression); - + var colonLocation = LocationsBag.GetLocations (caseLabel); + if (colonLocation != null) + result.AddChild (new CSharpTokenNode (Convert (colonLocation [0]), 1), SwitchStatement.Roles.Colon); newSection.AddChild (newLabel, SwitchSection.CaseLabelRole); }