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 for AST to book #1066

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open

Add EBNF for AST to book #1066

wants to merge 14 commits into from

Conversation

cmester0
Copy link
Contributor

No description provided.

@cmester0 cmester0 marked this pull request as draft October 29, 2024 12:02
@cmester0
Copy link
Contributor Author

File generated by #1038 and #986

@W95Psp
Copy link
Collaborator

W95Psp commented Oct 31, 2024

We chatted about this, we said we should put that file in the book directly in a "Input language" section that contains the grammar for the input language (filtering features already for Features.Rust only) and a small summary of https://github.com/hacspec/hax/issues?q=is%3Aissue%20is%3Aopen%20label%3Aunsupported-rust%20

@W95Psp
Copy link
Collaborator

W95Psp commented Nov 26, 2024

@cmester0 shall this be still a draft PR?

@cmester0 cmester0 marked this pull request as ready for review November 26, 2024 15:45
@W95Psp
Copy link
Collaborator

W95Psp commented Nov 28, 2024

Let's chat, it feels like some rules are missing, e.g. generic params

Copy link
Member

@franziskuskiefer franziskuskiefer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be added to the SUMMARY.md to show up in the book.

book/src/contributing/ast_ebnf.md Outdated Show resolved Hide resolved
| "self"
| goal
| "dyn"
| <!TODO!>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we can remove this TODO altogether?
The category impl is a bit weird since it has no Rust syntax, but I think it's fine

| (ty "->")* ty
| impl "::" ident
| "impl" ty
| (goal)*
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't get this (goal)* line here. From what variant in AST does this come from?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be

| "dyn" (goal)*

| "use" path ";"
```

The full AST description
Copy link
Collaborator

@W95Psp W95Psp Dec 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The full AST description is really just a cat of all previous ebnf code blocks, right?

I guess this is for visualization?
In that case, let's just create a EBNF file on the side or something like that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, wanted it to have the full description somewhere, but could just be a separate file.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Throwing this onto https://rr.red-dove.com/ui gives me errors. Can you check what's wrong?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems it does not like escaping " as \". And comments/TODO formatting is incorrect.

@@ -15,6 +15,7 @@
- [F*]()
- [Coq]()
- [`libcore`]()
- [AST](contributing/ast_ebnf.md)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be moved in the section contributing? Or be named something like "Input language"?

For now, I'd say we should move it to Contributing

@W95Psp
Copy link
Collaborator

W95Psp commented Dec 11, 2024

Shall I review again @cmester0? is this in a good shape?
We should backport things from the paper probably.

Also there is a conflict

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants