-
Notifications
You must be signed in to change notification settings - Fork 123
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 grammar specification #73
Conversation
docs/grammar.md
Outdated
## Extensions | ||
|
||
```ebnf | ||
extensions = { "#", ws, "!", ws, "[", ws, extensions_inner, ws, "]", ws } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see any reason to support ws
between #
and !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's what Rust allows, too. And that's what I implemented. Should I change the implementation?
docs/grammar.md
Outdated
## Value | ||
|
||
```ebnf | ||
value = unsigned | signed | float | string | char | bool | option | list | map | tuple | struct | enum_variant |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know much about grammar specs, but can we have something that is more formal? E.g. something like ron.ebnf
(or any other notation) that is parse-able and validate-able.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've thought about putting everything into one file and creating automated tests for our parser with it. But I don't have that much time and I think this is useful as is.
docs/grammar.md
Outdated
|
||
```ebnf | ||
digit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | ||
unsigned = digit, { digit } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we've got to support other numerical systems (I know we don't support them atm)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bors r+
Build succeeded |
Fixes #46