-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CSharp] Parsing source with syntax error causes ClassCastExceptin #2612
Comments
The grammars-v4/csharp/ parser gives a syntax error for that input:
Output:
Please clarify what you are trying to do. |
I am intentionally entering source code that results in a syntax error. The expected result is that CSharpParser reports a syntax error.
2 is a pointing error, as I found a problem with my checking method. To reproduce 1, follow the steps You need to test on a java target.
Modifying CShapParserBase.java reports the following syntax error
|
Got it. Yes, it doesn't work. |
I am concerned about the different syntax error messages when run with dotnet and when run with java. dotnet
java
|
I agree. I have a PR to fix the cast problem, but we'll need to find out why the diff in the runtimes. |
Close this issue after confirming the merge. |
I found this to be a cast error when entering the wrong C++ syntax into CSharp's parser.
This does not appear to be the correct way to handle syntax errors.
Sources containing syntax error
Added the following cast check to avoid cast errors in CSharpParserBase.java.
However, it should be a syntax error, but it is not a syntax error.Few people may consider this use case important.
Maybe it should be managed as a separate issue.
The text was updated successfully, but these errors were encountered: