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

Parse tuple types, tuple literals, tuple expressions, and tuple indexing expressions #72

Closed
mohammadfawaz opened this issue Jun 28, 2023 · 0 comments · Fixed by #93
Closed

Comments

@mohammadfawaz
Copy link
Contributor

  • Tuple types: (int, real, string)
  • Tuple literals: (5, 3.3, (2, 2));
  • Tuple expressions: (x, y, z);
  • Tuple indexing expressions: let x = my_tuple.0
@mohammadfawaz mohammadfawaz changed the title Parser tuple types, tuple literals, tuple expressions, and tuple indexing expressions Parse tuple types, tuple literals, tuple expressions, and tuple indexing expressions Jun 28, 2023
@mohammadfawaz mohammadfawaz self-assigned this Jul 10, 2023
mohammadfawaz added a commit that referenced this issue Jul 12, 2023
Closes #72 

Fairly simple change:
- Tuple types
- Tuple expressions
- Tuple indexing expressions. Error out on invalid indices such as `0xa`
or anything that is not a `usize`.

Note that `t.0.0` does not currently work, but `t.0 .0`. Once we
implement #66, we can then write `(t.0).0`. In the future, we can
support `t.0.0` which can be done in two ways:
- Special case the lexer to _not_ parse the `0.0` as a real in the case
of a tuple access (this means the lexer now has to concern itself with
the context).
- Break the real `0.0` apart in the pasrer, which kinda what Rust does
(see rust-lang/rust#71322 after an attempt for
the other method in rust-lang/rust#70420)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant