icsharpcode / NRefactory

NRefactory - Refactoring Your C# Code
684 stars 264 forks source link

ParserError with DataRowVersion #517

Open wilsade opened 8 years ago

wilsade commented 8 years ago

Hi there.

I've got a parser error when parsing this code:

` [TestMethod] public void WhenParsingThisCodeReturnNoError() { const string sampleCode = @" using System.Data; namespace Test { public class TestClass { void TestMethod() { DataRow row = null;

  row[""AnyField""] = row.RowState == DataRowState.Deleted ? 
    row[""OtherField"", DataRowVersion.Original] : 
    row[""SomeField""];
}

} }"; var parser = new ICSharpCode.NRefactory.CSharp.CSharpParser(); var syntaxTree = parser.Parse(sampleCode); Assert.IsTrue(syntaxTree.Errors.Count == 0, "Parser error"); }`

If I remove the DataRowVersion, the parse is OK:

row[""AnyField""] = row.RowState == DataRowState.Deleted ? row[""OtherField""] : row[""SomeField""];

Thanks, Wilsade

fabiosfs commented 8 years ago

It also happens in my app. Is it going to be fixed?

ibirite commented 8 years ago

It seems that it happens only when you are using the ternary operator. But it's a bug, indeed.

wilsade commented 8 years ago

Hi.

Still no response?

Wilsade

dgrunwald commented 8 years ago

No, this is not going to be fixed. There is no one maintaining the NRefactory parser.