-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add EBNF grammar as doc comments for TerminalKind and NonterminalKind #1169
base: main
Are you sure you want to change the base?
Conversation
… .d.ts files using the `jco types` command. This command is better for our use case than `jco transpile` because it generates the declarations directly from the source .wit files, whereas `jco transpile` uses the WASM binaries to generate them. This means that `jco types` has access to the documentation that's written in the wit interfaces, and `jco transpile` does not. Since we're generating the interfaces in a separate step, I'm disabling typescript in the original `jco transpile` step. This is just a precaution to avoid confusion or possible conflicting declaration files interferring with each other.
…is correctly propagating through the build process.
…rpose of this is so that both processes use the same `CodegenFileSystem` instance. If they used separate instances, then the files generated in one function would get deleted by the next.
…the variant ID as well as the EBNF form of the kind to use as documentation. Getting the EBNF form involves creating an instance of `SpecModel` and serializing the ID using that.
…guage` field to be a `&Language` instead of an `Rc<Language>` because of some weird issue getting `KindBuilder` to instantiate properly given that `KindsModel::from_language` received a `&Rc<Language>` param. However, I realized afterwards that I could just use `to_owned` when creating the SpecModel instead of changing SpecModel everywhere.
|
When generating documentation for
TerminalKind
andNonterminalKind
, generate the EBNF grammar for the current variant and include that in the final output. This affects the Wit output and Rust output (using templatescst.wit.jinja2
and(terminal|nonterminal)_kind.rs.jinja2
).Depends on #1157
Depends on NomicFoundation/jco#3
Closes #1165