Closed Specy closed 1 month ago
I Added most of the typings and features, Grammar and Parser should mostly be completed, i only lack some typings for the various tables as i'm not sure how to type IndexMap and IndexSet, i'll have to see what serde spits out as json. i've published the package on npm here
IndexMap and IndexSet are for preserving insertion order. So that the output format is deterministic. Other than this they are pretty much the same as HashMap and HashSet, so you should be able to save it as JSON object.
Ordering of JavaScript objects are not guaranteed, so you can't just load the object while preserving order. However, there are global Map and Set classes, which have the exact same semantics as IndexMap and IndexSet, so I'd look into those!
Seems like wasm_bindgen correctly converted IndexMap and IndexSet to a Map and an array, the set wouldn't make too much sense in javascript so i'm leaving it as an array.
The library should be pretty much complete by now, i've added the last typings and some documentation for the readme of the npm module. I've been trying it on my website and it seems to be working good! i'll link it here after i get to publish a beta version of it
I'll open this PR for adding wasm support to the lib plus a TS wrapper over it to make a more javascripty idiomatic experience.
This PR is still ongoing, for now i added basic support for creating a grammar and a parser, still have to work out the rest, there will be a lot of serialization work going on! It shouldn't be that hard to add the wasm layer, might take a few days
Implements #8