bytecodealliance / javy

JS to WebAssembly toolchain
Apache License 2.0
2.29k stars 110 forks source link

Switch option groups to use `ValueParserFactory` instead of `FromStr` #742

Closed jeffcharles closed 2 months ago

jeffcharles commented 3 months ago

What is the idea?

At the moment, we use FromStr implementations for parsing the codegen and JS runtime option groups (see this example). We could implement a custom value parser and use a ValueParserFactory to parse these two option groups instead.

What problem does it solve?

We could detect duplicate keys and raise an error and possibly output more useful helpful messages.