ParserError with DataRowVersion #517

Open
opened 2016-05-03 12:12:21 -05:00 by wilsade · 4 comments
wilsade commented 2016-05-03 12:12:21 -05:00 (Migrated from github.com)

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

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 2016-05-18 13:27:33 -05:00 (Migrated from github.com)

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

It also happens in my app. Is it going to be fixed?
ibirite commented 2016-05-19 08:48:28 -05:00 (Migrated from github.com)

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

It seems that it happens only when you are using the ternary operator. But it's a bug, indeed.
wilsade commented 2016-06-22 11:55:53 -05:00 (Migrated from github.com)

Hi.

Still no response?

Wilsade

Hi. Still no response? Wilsade
dgrunwald commented 2016-06-22 14:39:17 -05:00 (Migrated from github.com)

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

No, this is not going to be fixed. There is no one maintaining the NRefactory parser.
This discussion has been locked. Commenting is limited to contributors.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-icsharpcode/NRefactory#517
No description provided.