gcc/rust/ChangeLog:
* hir/tree/rust-hir-pattern.h
(class AltPattern): Remove duplicate access specifier.
(AltPattern::get_alts): Add.
* hir/tree/rust-hir.cc
(AltPattern::as_string): Add.
(AltPattern::accept_vis): Add.
Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
Location locus;
Analysis::NodeMapping mappings;
-public:
public:
std::string as_string () const override;
AltPattern (AltPattern &&other) = default;
AltPattern &operator= (AltPattern &&other) = default;
+ std::vector<std::unique_ptr<Pattern>> &get_alts () { return alts; }
+ const std::vector<std::unique_ptr<Pattern>> &get_alts () const
+ {
+ return alts;
+ }
+
Location get_locus () const override { return locus; }
void accept_vis (HIRFullVisitor &vis) override;
return str;
}
+std::string
+AltPattern::as_string () const
+{
+ std::string str ("AltPattern: ");
+
+ for (const auto &pattern : alts)
+ {
+ str += "\n " + pattern->as_string ();
+ }
+
+ return str;
+}
+
std::string
TuplePatternItemsMultiple::as_string () const
{
vis.visit (*this);
}
+void
+AltPattern::accept_vis (HIRFullVisitor &vis)
+{
+ vis.visit (*this);
+}
+
void
EmptyStmt::accept_vis (HIRFullVisitor &vis)
{
vis.visit (*this);
}
+void
+AltPattern::accept_vis (HIRPatternVisitor &vis)
+{
+ vis.visit (*this);
+}
+
void
RangePattern::accept_vis (HIRPatternVisitor &vis)
{