]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: Add comma for expr delimiter to fix match arms
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Wed, 11 Oct 2023 12:31:25 +0000 (14:31 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 18:09:13 +0000 (19:09 +0100)
Add a comma as an expr delimiter, this will allow correct parsing of
match arm expressions.

gcc/rust/ChangeLog:

* parse/rust-parse-impl.h (Parser::parse_expr): Add comma delimiter.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
gcc/rust/parse/rust-parse-impl.h

index 345ef0eeb6ee9ddd789e1a0a32af2664a03f7afc..8c04a1af17588bbf990d730392f6a8bc20bd92a0 100644 (file)
@@ -12086,7 +12086,7 @@ Parser<ManagedTokenSource>::parse_expr (int right_binding_power,
     {
       TokenId id = current_token->get_id ();
       if (id == SEMICOLON || id == RIGHT_PAREN || id == RIGHT_CURLY
-         || id == RIGHT_SQUARE)
+         || id == RIGHT_SQUARE || id == COMMA)
        return nullptr;
     }