You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#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:
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).
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.
#93 introduces support for tuple index expressions but does not allow
t.0.0
to be parsed because the lexer tokenizes this as an identifiert
followed by a dot.
and then a real0.0
.We can support this in two ways:
0.0
as a real in the case of a tuple access (this means the lexer now has to concern itself with the context).0.0
apart in the pasrer, which kinda what Rust does (see Accept tuple.0.0 as tuple indexing (take 2) rust-lang/rust#71322 after an attempt for the other method in Accept tuple.0.0 as tuple indexing rust-lang/rust#70420)The text was updated successfully, but these errors were encountered: