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 closure in closure parsing #2673

Merged
merged 2 commits into from
Oct 17, 2023
Merged

Conversation

P-E-P
Copy link
Member

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

Fix a the parsing of a closure in another closure without a space lead to the lexer creating an OR token.

Fixes #2656

@P-E-P P-E-P added this to the GCC 14.1 release milestone Oct 10, 2023
@P-E-P P-E-P requested a review from CohenArthur October 10, 2023 12:19
@P-E-P P-E-P self-assigned this Oct 10, 2023
@P-E-P P-E-P marked this pull request as ready for review October 10, 2023 12:19
gcc/rust/parse/rust-parse-impl.h Outdated Show resolved Hide resolved
gcc/rust/parse/rust-parse-impl.h Outdated Show resolved Hide resolved
@CohenArthur
Copy link
Member

the test is a good one haha

P-E-P added 2 commits October 17, 2023 13:57
The parser was unable to process as closure inside a closure because the
lexer could not differentiate an OR from two PIPE tokens.

gcc/rust/ChangeLog:

	* parse/rust-parse-impl.h (Parser::parse_closure_expr_pratt): Fix
	closure parsing function to handle consecutive parameter lists.

Signed-off-by: Pierre-Emmanuel Patry <[email protected]>
This new test highlight the fix of Rust-GCC#2656.

gcc/testsuite/ChangeLog:

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

Signed-off-by: Pierre-Emmanuel Patry <[email protected]>
@P-E-P P-E-P force-pushed the fix-closure-in-closure branch from 45ec354 to 83a7a99 Compare October 17, 2023 11:58
@P-E-P P-E-P added this pull request to the merge queue Oct 17, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Oct 17, 2023
@P-E-P P-E-P added this pull request to the merge queue Oct 17, 2023
Merged via the queue into Rust-GCC:master with commit 25eb53d Oct 17, 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 closure in closure without space
2 participants