RFR: 7903788: preparation towards json configuration for jextract tool

Athijegannathan Sundararajan sundar at openjdk.org
Fri Aug 16 13:25:00 UTC 2024


On Fri, 16 Aug 2024 12:00:39 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> * adding json skara code into org.openjdk.jextract.json.parser package. Minor changes done - pretty printing, JSONValue is made sealed and access changes (private final fields).
>> * org.openjdk.jextract.json package for JSON interface to the rest of the jextract tool. Main interface is org.openjdk.jextract.json.JSON. parse and toString methods to convert record into JSON String and vice versa.
>> * Other classes are public mainly for testing purposes. build.gradle adjusted with the required --add-exports clauses so that jextract module does not have to export the new json packages.
>
> build.gradle line 62:
> 
>> 60:     options.release = 22
>> 61:     options.compilerArgs << "--enable-preview"
>> 62:     options.compilerArgs << "-Xlint:unchecked"
> 
> Are there many of these? Would be preferrable to fix them in place with `@SuppressWarnings`

It was left over from debugging. Added SuppressWarnings as needed. Will remove this.

> src/main/java/org/openjdk/jextract/json/parser/JWCC.java line 32:
> 
>> 30:  * Comments are stripped and are not present in the parsed result.
>> 31:  */
>> 32: public final class JWCC {
> 
> This class (and related test) don't seem very useful. I think we can just drop them

That means we'll not support extensions like comments and trailing comma (optionally). I'll remove that JSON.parse method then.

-------------

PR Review Comment: https://git.openjdk.org/jextract/pull/257#discussion_r1719833789
PR Review Comment: https://git.openjdk.org/jextract/pull/257#discussion_r1719835319


More information about the jextract-dev mailing list