-
Notifications
You must be signed in to change notification settings - Fork 251
Java 8 syntax not supported in actions #258
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
Comments
If you use javacc 8 I think it does On Mar 26, 2023 5:52 AM, Jerome Abela ***@***.***> wrote:
Using a method reference (Class::method) in an action raises an exception with Javacc 7.0.12:
org.javacc.parser.ParseException: Encountered " "::" ":: "" at line 36, column 21.
Was expecting one of:
"instanceof" ...
")" ...
"," ...
"<" ...
"?" ...
"==" ...
"<=" ...
">=" ...
"!=" ...
"||" ...
"&&" ...
"++" ...
"--" ...
"+" ...
"-" ...
"*" ...
"/" ...
"&" ...
"|" ...
"^" ...
"%" ...
">" ...
"<" ...
Are there any plans to support Java 8 in the near future?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
You should really do yourself a favor and check out the more evolved version of JavaCC, which is CongoCC. The Java parser that is built into the tool parses all the syntax (stable features mind you, not necessarily all the preview features) up through JDK 20, so that obviously includes lambdas and method references, which were introduced in JDK 8.
Well, really, the truth of the matter is that the legacy JavaCC project has no plans of any sort. It is not being actively developed. Just look at their commit record. Just page back some years and see if you can find anything resembling a new feature. In any case, CongoCC is basically committed to supporting the latest stable version of Java on an ongoing basis. See here for some more information. If you have any further questions, it is better to take it up here because, almost certainly, the owners of this project are not very keen on my participation here. |
You think so, eh? Well, that's a very confident, authoritative answer. Well, I guess you're free to think that it does, but I just checked and it doesn't. I just looked here and here, and, scanning over the thing, it is quite obvious that there is nothing in either grammar to handle lambdas or method references. Also, one should note that the last commit on either file is from June 2021, nearly 2 years ago. Actually, the last meaningful change to the file was a patch by iponomarev from March 16, 2019. That patch did take the Java support in code actions to JDK 7 level. However, Ponomarev's changes were not applied to JJTree.jjt so you can use JDK 7 features like try-with-resources if you use plain JavaCC, but not if you use JJTree. That is a rather strange design decision, is it not? Could you clarify that? |
Using a method reference (Class::method) in an action raises an exception with Javacc 7.0.12:
org.javacc.parser.ParseException: Encountered " "::" ":: "" at line 36, column 21.
Was expecting one of:
"instanceof" ...
")" ...
"," ...
"<" ...
"?" ...
"==" ...
"<=" ...
">=" ...
"!=" ...
"||" ...
"&&" ...
"++" ...
"--" ...
"+" ...
"-" ...
"*" ...
"/" ...
"&" ...
"|" ...
"^" ...
"%" ...
">" ...
"<" ...
Are there any plans to support Java 8 in the near future?
The text was updated successfully, but these errors were encountered: