Allow empty type parameters in Java code of grammar files.#75
Allow empty type parameters in Java code of grammar files.#75new-javacc merged 1 commit intojavacc:masterfrom
Conversation
This allows one to use the diamond when constructing a generic class: new ArrayList<>() This feature of the Java compiler is documented at https://docs.oracle.com/javase/7/docs/technotes/guides/language/type-inference-generic-instance-creation.html
|
This one together with my PR #71 introduces another Java7 feature. However, both your and my changes are missing tests. Maybe some of the maintainers will point out the right way to add demo examples/tests for 'diamond operator' and 'try-with-resources' block. |
|
@inponomarev You could add whatever tests you want to the test or example directories, but you would have to add the testing process into teh Ant build.xml like the other tests |
|
@zosrothko I reworked #71, added all the remaining Java 7 features and added the tests. The proposed @emspishak 's change was cherry-picked into #71 's branch. |
|
Like I'e been saying the solution is to get rid of checking the java syntax. I want to eventually remove all java grammar elements from the javacc grammar. But may be it's ok for now. Also, it's best to keep grammars simple - not complicate with complex java constructs and features. You should do those in your super/sub classes. |
|
@emspishak Could you backport your PR to the 8.0.0 branch? TIA |
This allows one to use the diamond when constructing a generic class: new ArrayList<>()
This feature of the Java compiler is documented at https://docs.oracle.com/javase/7/docs/technotes/guides/language/type-inference-generic-instance-creation.html