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

Make parser allow a slot list at top level #14

Open
sin-ack opened this issue Aug 12, 2022 · 0 comments
Open

Make parser allow a slot list at top level #14

sin-ack opened this issue Aug 12, 2022 · 0 comments

Comments

@sin-ack
Copy link
Owner

sin-ack commented Aug 12, 2022

Currently we only allow slot lists in objects. This prevents the following from being valid code:

| foo. bar |
foo: 123.
bar: 456.
foo * bar; asString printLine.

There is no reason for the top-level context to not be a method object (in fact, the runtime already wraps the top-level context in a method object before activating it!). Therefore it makes equal sense to have the parser allow a slot list to be valid there.

sin-ack added a commit that referenced this issue Mar 21, 2024
This accomplishes several things:

- Improve parser soundness by having a provable grammar.
- Fix some of the ickier parts of the parser and make things more
  "regular".
- Prepare for some performance-related changes. Namely, method and block
  objects may no longer have parent slots.
- Prepare for some QoL features like #14.

No impact expected on performance.

As a bonus, I've added the BNF grammar I used as a basis for the new
parser to the repository.
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

No branches or pull requests

1 participant