aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/hir
diff options
context:
space:
mode:
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>2023-02-28 17:34:31 +0100
committerPhilip Herron <philip.herron@embecosm.com>2023-02-28 22:37:17 +0000
commitc2a3b370a9f42846f7d82512719d4127fa3fca4b (patch)
treee4a71c66ac76dc47c704b63b7d7de8f5423eaaa5 /gcc/rust/hir
parent41890d20e27d9be91fe5b35d5c85fb6a4ddcd2dd (diff)
downloadgcc-c2a3b370a9f42846f7d82512719d4127fa3fca4b.zip
gcc-c2a3b370a9f42846f7d82512719d4127fa3fca4b.tar.gz
gcc-c2a3b370a9f42846f7d82512719d4127fa3fca4b.tar.bz2
ast: Add RestPattern AST node
Add the RestPattern AST node representing ".." code in some rust context. This commit also provides the different visitors for this node. gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Add visitor. * ast/rust-ast-dump.h: Add visitor prototype. * ast/rust-ast-full-decls.h (class RestPattern): Add forward declaration for class RestPattern. * ast/rust-ast-visitor.h: Add visitor prototype. * ast/rust-ast.cc (RestPattern::accept_vis): Add function to accept a foreign visitor. * ast/rust-pattern.h (class RestPattern): Add class RestPattern. * checks/errors/rust-feature-gate.h: Add visitor prototype. * expand/rust-attribute-visitor.cc (AttrVisitor::visit): Add visitor implementation. * expand/rust-attribute-visitor.h: Add visitor prototype. * hir/rust-ast-lower-base.cc (ASTLoweringBase::visit): Add visitor implementation. * hir/rust-ast-lower-base.h: Add visitor prototype. * resolve/rust-ast-resolve-base.cc (ResolverBase::visit): Add visitor implementation. * resolve/rust-ast-resolve-base.h: Add visitor prototype. * resolve/rust-early-name-resolver.cc (EarlyNameResolver::visit): Add visitor implementation. * resolve/rust-early-name-resolver.h: Add visitor prototype. * util/rust-attributes.cc (AttributeChecker::visit): Add visitor implementation. * util/rust-attributes.h: Add visitor prototype. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Diffstat (limited to 'gcc/rust/hir')
-rw-r--r--gcc/rust/hir/rust-ast-lower-base.cc3
-rw-r--r--gcc/rust/hir/rust-ast-lower-base.h1
2 files changed, 4 insertions, 0 deletions
diff --git a/gcc/rust/hir/rust-ast-lower-base.cc b/gcc/rust/hir/rust-ast-lower-base.cc
index 1651b00..c21f511 100644
--- a/gcc/rust/hir/rust-ast-lower-base.cc
+++ b/gcc/rust/hir/rust-ast-lower-base.cc
@@ -409,6 +409,9 @@ ASTLoweringBase::visit (AST::IdentifierPattern &)
void
ASTLoweringBase::visit (AST::WildcardPattern &)
{}
+void
+ASTLoweringBase::visit (AST::RestPattern &)
+{}
// void ASTLoweringBase::visit(RangePatternBoundbound) {}
void
ASTLoweringBase::visit (AST::RangePatternBoundLiteral &)
diff --git a/gcc/rust/hir/rust-ast-lower-base.h b/gcc/rust/hir/rust-ast-lower-base.h
index 60ed3a9..d0171a5 100644
--- a/gcc/rust/hir/rust-ast-lower-base.h
+++ b/gcc/rust/hir/rust-ast-lower-base.h
@@ -211,6 +211,7 @@ public:
virtual void visit (AST::LiteralPattern &pattern);
virtual void visit (AST::IdentifierPattern &pattern);
virtual void visit (AST::WildcardPattern &pattern);
+ virtual void visit (AST::RestPattern &pattern);
// virtual void visit(RangePatternBound& bound);
virtual void visit (AST::RangePatternBoundLiteral &bound);
virtual void visit (AST::RangePatternBoundPath &bound);