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

Fix more tuple indices #2717

Merged
merged 2 commits into from
Nov 15, 2023
Merged

Fix more tuple indices #2717

merged 2 commits into from
Nov 15, 2023

Conversation

P-E-P
Copy link
Member

@P-E-P P-E-P commented Oct 31, 2023

Fix a tricky case with lexer floating point disambiguation.

Requires #2694

Fixes #2663

@P-E-P P-E-P added this to the GCC 14.1 release milestone Oct 31, 2023
@P-E-P P-E-P self-assigned this Oct 31, 2023
@powerboat9
Copy link
Contributor

powerboat9 commented Oct 31, 2023

Should a space be required in tuple_float_index.rs? It seems like rustc compiles it even without the space.

Edit: oh, I see, #2663

When a float has a floating point but no value after it, a zero was added
this lead to errors when trying to disambiguate a float into a tuple
index.

gcc/rust/ChangeLog:

	* lex/rust-lex.cc (Lexer::parse_decimal_int_or_float): Remove
	additional zero after empty floating point.
	* parse/rust-parse-impl.h (Parser::left_denotation): Handle float with
	empty floating point.

Signed-off-by: Pierre-Emmanuel Patry <[email protected]>
This new regression test highlight the behavior fixed for float
disambiguation with empty floating point.

gcc/testsuite/ChangeLog:

	* rust/compile/tuple_float_index.rs: New test.

Signed-off-by: Pierre-Emmanuel Patry <[email protected]>
@P-E-P P-E-P marked this pull request as ready for review November 6, 2023 10:57
@P-E-P P-E-P added this pull request to the merge queue Nov 15, 2023
Merged via the queue into Rust-GCC:master with commit fd7d577 Nov 15, 2023
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Cannot parse weird tupple index
3 participants