Skip to content
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 to node kinds #1165

Open
OmarTawfik opened this issue Nov 26, 2024 · 0 comments · May be fixed by #1169
Open

add EBNF grammar to node kinds #1165

OmarTawfik opened this issue Nov 26, 2024 · 0 comments · May be fixed by #1169
Assignees

Comments

@OmarTawfik
Copy link
Collaborator

We should generate doc comments for each variant of TerminalKind and NonterminalKind. More specifically, it should contain something like:

// This kind represents a `{ variant name }` node, with the following structure:
// {variant docs}

The initial ground work for this has been done in:

  1. codegen_ebnf::EbnfModel type, where it can generate EBNF docs for each variant separately.
  2. terminal_kind.rs.jinja2 and nonterminal_kind.rs.jinja2 where they have a commented out snippet like below. Maybe we can change variant to be a structure containing .name and .documentation instead:
        {%- for variant in model.kinds.terminal_kinds -%}
            {# variant.documentation | indent(prefix = "/// ", first = true, blank = true) #}
            {{ variant.name }},
        {%- endfor -%}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ⏳ Todo
Development

Successfully merging a pull request may close this issue.

2 participants