-
Notifications
You must be signed in to change notification settings - Fork 4
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
Basic PEG grammar for Stoffel Lang #42
base: main
Are you sure you want to change the base?
Conversation
… a capital letter.
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.
Looks good to me. I haven't used pest before but it seems that this is exactly the right tool for developing a new language/grammar in Rust.
The pairs api seems to allow to iterate over the parsed tokens. I think this is where we will have to add our optimizations. After that we can start translating to VM bytecode.
… as opposed to within the grammar
I amended the HoneyBadgerSwap example to fit the current grammar. The last thing to add before converting this draft PR into an actual PR is some skeleton code for the parser. |
I have a more complete grammar, have amended the honey badger swap example further and added some skeleton code for the parser. With Pest, a lot of the code is auto-generated, so all that is need is to define enums/structs and use the corresponding derive macros. |
I have a basic PEG grammar for StoffelLang along with some skeleton code for what the parser should do and to provide some more guidance of what the compiler's functionality should be. I haven't amended the honeybadgerswap examples as there is still some more thought that needs to go into the grammar.
Currently, the grammar doesn't support the following: