From c9644897bb18bc625fa95f8dc3a6ed52d4c4c57a Mon Sep 17 00:00:00 2001 From: Pierre-Emmanuel Patry Date: Wed, 1 Mar 2023 11:00:29 +0100 Subject: gccrs: parser: Add RestPattern parsing Add simple RestPattern parsing to the pattern parsing function. gcc/rust/ChangeLog: * parse/rust-parse-impl.h (Parser::parse_pattern_no_alt): Handle RestPattern correctly. Signed-off-by: Pierre-Emmanuel Patry --- gcc/rust/parse/rust-parse-impl.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gcc') diff --git a/gcc/rust/parse/rust-parse-impl.h b/gcc/rust/parse/rust-parse-impl.h index de693eb..2317169 100644 --- a/gcc/rust/parse/rust-parse-impl.h +++ b/gcc/rust/parse/rust-parse-impl.h @@ -10737,6 +10737,10 @@ Parser::parse_pattern_no_alt () lexer.skip_token (); return std::unique_ptr ( new AST::WildcardPattern (t->get_locus ())); + case DOT_DOT: + lexer.skip_token (); + return std::unique_ptr ( + new AST::RestPattern (t->get_locus ())); case REF: case MUT: return parse_identifier_pattern (); -- cgit v1.1