Closed Mossaka closed 3 weeks ago
Could you expand on what you think the solution to this might be? Are you thinking it would be something like "name": { "raw": "bool" }
or similar? To me this looks like the JSON is an accurate representation of the WIT and re-rendering as WIT would require the re-rendering process to understand WIT keywords to re-add %
characters
(or, alternatively, that's something that wasm-tools
could possibly implement too: "ingest this JSON and output WIT"
yeah I realized a simple solution is to re-add %
character back to the WIT keywords in wit-bindgen-go and in fact it's already doing so. So gonna close this issue now. Thanks!
Isn't % encoding only in WIT? Eg the function would be named bool
in the resolve struct (here and in Go)? The Go code generation handles collisions with Go keywords (including bool
).
Consider the following WIT file
The
%bool
function has aToken::ExplicitId
and inparse_id()
the symbol%
is striped away, resulting the serializedFunction
struct that has difference between explicitID vs. ID, i.e.which could be an issue for tools like https://github.com/ydnar/wasm-tools-go because turning the json back to wit is not possible anymore. cc @ydnar