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 grammar specification #73

Merged
merged 2 commits into from
Jan 17, 2018
Merged

Add grammar specification #73

merged 2 commits into from
Jan 17, 2018

Conversation

torkleyy
Copy link
Contributor

@torkleyy torkleyy commented Jan 17, 2018

Fixes #46

docs/grammar.md Outdated
## Extensions

```ebnf
extensions = { "#", ws, "!", ws, "[", ws, extensions_inner, ws, "]", ws }
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 see any reason to support ws between # and !

Copy link
Contributor Author

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
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 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.

Copy link
Contributor Author

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 }
Copy link
Collaborator

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)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed

Copy link
Collaborator

@kvark kvark left a comment

Choose a reason for hiding this comment

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

bors r+

bors bot added a commit that referenced this pull request Jan 17, 2018
73: Add grammar specification r=kvark a=torkleyy

Fixes #46
@bors
Copy link
Contributor

bors bot commented Jan 17, 2018

Build succeeded

@bors bors bot merged commit 0cc7514 into ron-rs:master Jan 17, 2018
@torkleyy torkleyy deleted the docs branch January 17, 2018 18:38
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.

2 participants