public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/rust/master] parser: Add RestPattern parsing
@ 2023-03-05 11:41 Thomas Schwinge
0 siblings, 0 replies; only message in thread
From: Thomas Schwinge @ 2023-03-05 11:41 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:0e41289aa52993a6d4844e7458dc4cb08e4618ad
commit 0e41289aa52993a6d4844e7458dc4cb08e4618ad
Author: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Date: Wed Mar 1 11:00:29 2023 +0100
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 <pierre-emmanuel.patry@embecosm.com>
Diff:
---
gcc/rust/parse/rust-parse-impl.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/gcc/rust/parse/rust-parse-impl.h b/gcc/rust/parse/rust-parse-impl.h
index 2cea013ce56..63e425e5b83 100644
--- a/gcc/rust/parse/rust-parse-impl.h
+++ b/gcc/rust/parse/rust-parse-impl.h
@@ -10737,6 +10737,10 @@ Parser<ManagedTokenSource>::parse_pattern_no_alt ()
lexer.skip_token ();
return std::unique_ptr<AST::WildcardPattern> (
new AST::WildcardPattern (t->get_locus ()));
+ case DOT_DOT:
+ lexer.skip_token ();
+ return std::unique_ptr<AST::RestPattern> (
+ new AST::RestPattern (t->get_locus ()));
case REF:
case MUT:
return parse_identifier_pattern ();
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-03-05 11:41 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-05 11:41 [gcc/devel/rust/master] parser: Add RestPattern parsing Thomas Schwinge
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).