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

Support nested tuple indexing without parentheses t.0.0 #100

Closed
mohammadfawaz opened this issue Jul 12, 2023 · 1 comment · Fixed by #102
Closed

Support nested tuple indexing without parentheses t.0.0 #100

mohammadfawaz opened this issue Jul 12, 2023 · 1 comment · Fixed by #102

Comments

@mohammadfawaz
Copy link
Contributor

mohammadfawaz commented Jul 12, 2023

#93 introduces support for tuple index expressions but does not allow t.0.0 to be parsed because the lexer tokenizes this as an identifier t followed by a dot . and then a real 0.0.

We can support this in two ways:

@otrho
Copy link
Contributor

otrho commented Jul 12, 2023

In the second case the token would be .0.0 -- note the first dot. Since it's a longer match than just . or 0.0 it would be matched at higher priority.

The token could keep a Vec<&str> or something potentially, pre-splitting prior to parsing. Ideally Logos would allow callbacks to return an iterator so the splits could appear flattened in the Lexer toke stream but it doesn't look like it's supported.

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.

2 participants