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

Clean up parser #24

Merged
merged 36 commits into from
Aug 29, 2021
Merged

Clean up parser #24

merged 36 commits into from
Aug 29, 2021

Conversation

certainty
Copy link
Owner

@certainty certainty commented Aug 29, 2021

This started as a refactoring to clean up the parser and turned into a huge clean-up plus partial rewrite of the frontend.
I'll merge this into main soon and will add another round of clean-up after which refactors some parts that are still too messy. At this point I don't want to continue too far without some clean-up.

Changes

  1. The compiler uses denotation tracking to identify special forms and distinguish them from local bindings. In other word things like (define (foo if) (if #t 'yes 'no)) compile correctly and will yield and error, since if is a local binding instead of the if special form in this instance

  2. The frontend contains an expansion phase, which is used to expand defines and quasi-quotes for now, but can be extended to expand arbitrary macros (I hope).

  3. The representation of Datum and Sexp has been made a bit more ergnomic. Among other things you can display datum and sexp in a convenient way now. Also it's easier to construct Datum now.

  4. Support for vector and improper list added. The reader now recognised vectors and improper lists correctly. So now the only missing sexp literal seems to be bytevectors.

  5. Error reporting uses codespan_reporting. This improves the error messages for the compiler alot, as it provides nicely formatted information about what went wrong. Well at least in theory. In practice all the machinary is in place, but I didn't give a lot of love to the error messages yet.

  6. Various smaller changes in the structure. Elided life-times, moves files and modules, renamed several associated functions.

@certainty certainty merged commit 3211ab5 into main Aug 29, 2021
@certainty certainty deleted the clean-up-parser branch September 25, 2021 08:33
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.

1 participant