We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The reference grammar in rust/src/grammar/lexer.l returns LIT_INTEGER for any sort of integer, including hex, octal, etc.
rust/src/grammar/lexer.l
LIT_INTEGER
Then parser-lalr.y implements tuple field expressions as:
parser-lalr.y
| expr '.' LIT_INTEGER { $$ = mk_node("ExprTupleIndex", 1, $1); }
However, rustc rejects hexadecimal here:
b7.rs:4:31: 4:34 error: invalid tuple or tuple struct index b7.rs:4 println!("{}, {}", x.0, x.0x1);
My guess is that the reference lexer is incorrect here.
The text was updated successfully, but these errors were encountered:
rustc also seems to reject decimal literals including underscores, so "x.1_" is invalid.
Sorry, something went wrong.
cc #15880
Triage: all of this is vestigial at this point, and the grammar WG is handling these kinds of issues. Closing.
No branches or pull requests
The reference grammar in
rust/src/grammar/lexer.l
returnsLIT_INTEGER
for any sort of integer, including hex, octal, etc.Then
parser-lalr.y
implements tuple field expressions as:However, rustc rejects hexadecimal here:
My guess is that the reference lexer is incorrect here.
The text was updated successfully, but these errors were encountered: